From 58693db8d7cc1cf4abd658b3230c072e2b8ed171 Mon Sep 17 00:00:00 2001 From: "Gourl.io" Date: Mon, 11 May 2020 17:56:38 +0100 Subject: [PATCH] Version 2.2.0 Several new enhancements. Mandatory update --- history.txt | 9 +++++++++ js/_source/ajax.js | 2 +- js/_source/cryptobox.js | 6 ++++-- js/_source/support.js | 2 +- js/cryptobox.min.js | 2 +- lib/cryptobox.callback.php | 2 +- lib/cryptobox.class.php | 41 +++++++++++++++++++++++++++----------- readme.md | 2 +- 8 files changed, 47 insertions(+), 19 deletions(-) diff --git a/history.txt b/history.txt index e17839d..e4a9dbc 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,12 @@ +=============================================================================== +== Version 2.2.0 (May 2020) +=============================================================================== + +- Several new enhancements. Mandatory update. + + + + =============================================================================== == Version 2.1.7 (January 2020) =============================================================================== diff --git a/js/_source/ajax.js b/js/_source/ajax.js index f551e60..7e9774f 100644 --- a/js/_source/ajax.js +++ b/js/_source/ajax.js @@ -4,7 +4,7 @@ * @category Javascript * @website https://gourl.io * @api https://gourl.io/api.html - * @version 2.1.7 + * @version 2.2.0 */ /** diff --git a/js/_source/cryptobox.js b/js/_source/cryptobox.js index 92fcf89..ada695b 100644 --- a/js/_source/cryptobox.js +++ b/js/_source/cryptobox.js @@ -4,7 +4,7 @@ * @category Javascript * @website https://gourl.io * @api https://gourl.io/api.html - * @version 2.1.7 + * @version 2.2.0 */ /** @@ -12,7 +12,7 @@ * Full Instruction - https://gourl.io/bitcoin-payment-gateway-api.html */ - function cryptobox_show(boxID, coinName, public_key, amount, amountUSD, period, language, iframeID, userID, userFormat, orderID, cookieName, webdev_key, hash, width, height) + function cryptobox_show(boxID, coinName, public_key, amount, amountUSD, period, language, iframeID, userID, userFormat, orderID, cookieName, webdev_key, ver, hash, width, height) { if (typeof width !== 'number') width = 0; if (typeof height !== 'number') height = 0; @@ -30,6 +30,7 @@ else if (period == '') alert('Invalid period'); else if (public_key.length != 50) alert('Invalid public key'); else if (webdev_key != '' && (webdev_key.indexOf("DEV") == -1 || webdev_key.length < 20)) alert('Invalid webdev_key, leave it empty'); + else if (ver == '') alert('Invalid ver value'); else if (hash == '') alert('Invalid payment box hash'); else { @@ -40,6 +41,7 @@ '/pe/'+encodeURIComponent(period.replace(' ', '_'))+'/l/'+encodeURIComponent(language)+ '/i/'+encodeURIComponent(iframeID)+'/u/'+encodeURIComponent(userID)+ '/us/'+encodeURIComponent(userFormat)+'/o/'+encodeURIComponent(orderID)+ + '/t/'+encodeURIComponent(ver)+ (webdev_key?'/w/'+encodeURIComponent(webdev_key):'')+ (width>0?'/ws/'+encodeURIComponent(width):'')+ (height>0?'/hs/'+encodeURIComponent(height):'')+ diff --git a/js/_source/support.js b/js/_source/support.js index 954f167..b11bbee 100644 --- a/js/_source/support.js +++ b/js/_source/support.js @@ -4,7 +4,7 @@ * @category Javascript * @website https://gourl.io * @api https://gourl.io/api.html - * @version 2.1.7 + * @version 2.2.0 */ /** diff --git a/js/cryptobox.min.js b/js/cryptobox.min.js index c91a6e5..c13b576 100644 --- a/js/cryptobox.min.js +++ b/js/cryptobox.min.js @@ -1 +1 @@ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('C 1E(q,n,d,g,o,p,m,f,s,i,a,r,b,c,l,j){2(Y l!=="W"){l=0}2(Y j!=="W"){j=0}7 k=d.2s(0,d.x("1r"));2(k==""||q!=k||d.x("1q")==-1){5("6 9 8 1S")}4{2((g<=0&&o<=0)||(g>0&&o>0)){5("K 1T 1U A 9 8 1d 1W V 1f 17: I 21 T. K 14 22 16 A Q 2b 10 2c")}4{2(g!=0&&((g-0)!=g||g<0.2e)){5("6 9 8 I")}4{2(o!=0&&((o-0)!=o||o<0.2j)){5("6 9 8 T")}4{2(i!="B"&&i!="2q"&&i!="1n"&&i!="2o"){5("6 9 8 2n L")}4{2(i=="B"&&r==""){5("6 9 8 D 2m")}4{2(i=="B"&&G(r)==""){2(v.y(f).F!=Z){v.y(f).F="J://S.N/2l/11.12"}5("X 2i 2h A 2g 2f !")}4{2(i=="B"&&G(r)!=s){5("6 D L. 15 2a 29 28 27 26 25 18 19 V O U Q 1Z 1b A O P 1g. X 1o M P 1R, 1p 1P 1O/1s-1t 1L H 1K U")}4{2(a==""){5("6 1I")}4{2(p==""){5("6 1H")}4{2(d.t!=1x){5("6 1y 1z")}4{2(b!=""&&(b.x("1C")==-1||b.t<20)){5("6 1F, 1G 1M 1N")}4{2(c==""){5("6 9 8 1X")}4{7 e="J://23.S.N/b/"+3(q)+"/c/"+3(n)+"/p/"+3(d)+"/a/"+3(g)+"/1m/"+3(o)+"/1l/"+3(p.1j(" ","1i"))+"/l/"+3(m)+"/i/"+3(f)+"/u/"+3(s)+"/1e/"+3(i)+"/o/"+3(a)+(b?"/w/"+3(b):"")+(l>0?"/1c/"+3(l):"")+(j>0?"/1h/"+3(j):"")+"/h/"+3(c)+"/z/"+1u.1v();7 h=v.y(f);2(h==Z){5(\'1D 1J 1Q M 1Y "\'+f+\'" 24 2d!\')}4{h.F=e}}}}}}}}}}}}}}E 13}C G(b){7 e=b+"=";7 a=v.D.1a(";");H(7 d=0;d35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('y 2t(r,o,d,h,p,q,n,g,t,j,a,s,b,f,c,m,k){2(Z m!=="Y"){m=0}2(Z k!=="Y"){k=0}8 l=d.1N(0,d.A("1w"));2(l==""||r!=l||d.A("1R")==-1){4("6 7 9 1S")}5{2((h<=0&&p<=0)||(h>0&&p>0)){4("V 1T 2u B 7 9 1V 1W T 1X 1g: N 22 L. V 23 1j 25 B M 14 26 1o")}5{2(h!=0&&((h-0)!=h||h<0.11)){4("6 7 9 N")}5{2(p!=0&&((p-0)!=p||p<0.17)){4("6 7 9 L")}5{2(j!="C"&&j!="2i"&&j!="2j"&&j!="2k"){4("6 7 9 2r I")}5{2(j=="C"&&s==""){4("6 7 9 F 2q")}5{2(j=="C"&&E(s)==""){2(x.D(g).G!=Q){x.D(g).G="U://X.K/2p/2o.2n"}4("S 2m 12 B 13 1k !")}5{2(j=="C"&&E(s)!=t){4("6 F I. 2g 2f 2e 15 16 2b 2a 1f 18 T R P M 1d 19 B R J 21. S 1h 10 J 1l, 1p 1U 1q/1r-1s 1Q O 1t P")}5{2(a==""){4("6 1u")}5{2(q==""){4("6 1M")}5{2(d.v!=1L){4("6 1K 1y")}5{2(b!=""&&(b.A("1I")==-1||b.v<20)){4("6 1B, 1C 1F 1G")}5{2(f==""){4("6 1J I")}5{2(c==""){4("6 7 9 1Y")}5{8 e="U://24.X.K/b/"+3(r)+"/c/"+3(o)+"/p/"+3(d)+"/a/"+3(h)+"/2c/"+3(p)+"/2l/"+3(q.1n(" ","1m"))+"/l/"+3(n)+"/i/"+3(g)+"/u/"+3(t)+"/1i/"+3(j)+"/o/"+3(a)+"/t/"+3(f)+(b?"/w/"+3(b):"")+(m>0?"/1a/"+3(m):"")+(k>0?"/1c/"+3(k):"")+"/h/"+3(c)+"/z/"+1v.1x();8 i=x.D(g);2(i==Q){4(\'1D 1H 1O 10 1Z "\'+g+\'" 27 29!\')}5{i.G=e}}}}}}}}}}}}}}}H 2h}y E(b){8 e=b+"=";8 a=x.F.1b(";");O(8 d=0;dCURL extension in PHP. Read here »", "http://php.net/manual/en/book.curl.php", "http://stackoverflow.com/questions/1347146/how-to-enable-curl-in-php-xampp")); if (!function_exists( 'mysqli_connect' )) die(sprintf("Error. Please enable MySQLi extension in PHP. Read here »", "http://php.net/manual/en/book.mysqli.php", "http://crybit.com/how-to-enable-mysqli-extension-on-web-server/")); if (version_compare(phpversion(), '5.4.0', '<')) die(sprintf("Error. You need PHP 5.4.0 (or greater). Current php version: %s", phpversion())); - - + foreach($options as $key => $value) if (in_array($key, array("public_key", "private_key", "webdev_key", "amount", "amountUSD", "period", "language", "iframeID", "orderID", "userID", "userFormat"))) $this->$key = (is_string($value)) ? trim($value) : $value; @@ -241,6 +241,18 @@ public function __construct($options = array()) } } + // version string + $this->ver = "version | gourlphp " . CRYPTOBOX_VERSION; + if (CRYPTOBOX_WORDPRESS) $this->ver .= " | gourlwordpress" . (defined('GOURL_VERSION') ? " ".GOURL_VERSION : ""); + if (CRYPTOBOX_WORDPRESS && defined('GOURLWC_VERSION') && strpos($this->orderID, "gourlwoocommerce.") === 0) $this->ver .= " | gourlwoocommerce " . GOURLWC_VERSION; + if (CRYPTOBOX_WORDPRESS && defined('GOURLAP_VERSION') && strpos($this->orderID, "gourlappthemes.") === 0) $this->ver .= " | gourlappthemes " . GOURLAP_VERSION; + if (CRYPTOBOX_WORDPRESS && defined('GOURLEDD_VERSION') && strpos($this->orderID, "gourledd.") === 0) $this->ver .= " | gourledd " . GOURLEDD_VERSION; + if (CRYPTOBOX_WORDPRESS && defined('GOURLPMP_VERSION') && strpos($this->orderID, "gourlpmpro.") === 0) $this->ver .= " | gourlpmpro " . GOURLPMP_VERSION; + if (CRYPTOBOX_WORDPRESS && defined('GOURLGV_VERSION') && strpos($this->orderID, "gourlgive.") === 0) $this->ver .= " | gourlgive " . GOURLGV_VERSION; + if (CRYPTOBOX_WORDPRESS && defined('GOURLJI_VERSION') && strpos($this->orderID, "gourljigoshop.") === 0) $this->ver .= " | gourljigoshop " . GOURLJI_VERSION; + if (CRYPTOBOX_WORDPRESS && defined('GOURLWPSC_VERSION') && strpos($this->orderID, "gourlwpecommerce.") === 0) $this->ver .= " | gourlwpecommerce " . GOURLWPSC_VERSION; + if (CRYPTOBOX_WORDPRESS && defined('GOURLMP_VERSION') && strpos($this->orderID, "gourlmarketpress.") === 0) $this->ver .= " | gourlmarketpress " . GOURLMP_VERSION; + if (!$this->iframeID) $this->iframeID = $this->iframe_id(); $this->check_payment(); @@ -273,6 +285,8 @@ public function display_cryptobox($submit_btn = true, $width = "540", $height = $width = intval($width); $height = intval($height); + + $box_style = trim($box_style, "; ") .";max-width:".$width."px !important;max-height:".$height."px !important;"; $cryptobox_html = ""; $val = md5($this->iframeID.$this->private_key.$this->userID); @@ -295,7 +309,7 @@ public function display_cryptobox($submit_btn = true, $width = "540", $height = $cryptobox_html .= "
"; $cryptobox_html .= "
"; if ($submit_btn && !$this->paid) @@ -355,6 +369,7 @@ public function cryptobox_json_url() "j" => 1, // json "d" => base64_encode($ip), "f" => base64_encode($this->ua(false)), + "t" => base64_encode($this->ver), "h" => $hash ); @@ -433,8 +448,8 @@ public function get_json_values() public function cryptobox_hash($json = false, $width = 0, $height = 0) { - if ($json) $hash_str = $this->boxID."|".$this->coinName."|".$this->public_key."|".$this->private_key."|".$this->webdev_key."|".$this->amount."|".$this->amountUSD."|".$this->period."|". $this->language."|".$this->orderID."|".$this->userID."|".$this->userFormat."|".$this->ip_address(); - else $hash_str = $this->boxID."|".$this->coinName."|".$this->public_key."|".$this->private_key."|".$this->webdev_key."|".$this->amount."|".$this->amountUSD."|".$this->period."|". $this->language."|".$this->orderID."|".$this->userID."|".$this->userFormat."|".$this->iframeID."|".$width."|".$height; + if ($json) $hash_str = $this->boxID."|".$this->coinName."|".$this->public_key."|".$this->private_key."|".$this->webdev_key."|".$this->amount."|".$this->amountUSD."|".$this->period."|". $this->language."|".$this->orderID."|".$this->userID."|".$this->userFormat."|".$this->ver."|".$this->ip_address(); + else $hash_str = $this->boxID."|".$this->coinName."|".$this->public_key."|".$this->private_key."|".$this->webdev_key."|".$this->amount."|".$this->amountUSD."|".$this->period."|". $this->language."|".$this->orderID."|".$this->userID."|".$this->userFormat."|".$this->ver."|".$this->iframeID."|".$width."|".$height; $hash = md5($hash_str); @@ -1317,7 +1332,7 @@ private function check_payment_live() { $ip = $this->ip_address(); $private_key_hash = strtolower(hash("sha512", $this->private_key)); - $hash = md5($this->boxID.$private_key_hash.$this->userID.$this->orderID.$this->language.$this->period.$ip); + $hash = md5($this->boxID.$private_key_hash.$this->userID.$this->orderID.$this->language.$this->period.$this->ver.$ip); $box_status = ""; $data = array( @@ -1327,6 +1342,7 @@ private function check_payment_live() "u" => $this->userID, "l" => $this->language, "e" => $this->period, + "t" => $this->ver, "i" => $ip, "h" => $hash ); @@ -1915,11 +1931,12 @@ function convert_currency_live($from_Currency, $to_Currency, $amount, $currencyc } - // d. get rates from https://free.currencyconverterapi.com/api/v6/convert?q=BTC_EUR&compact=y + // d. get rates from https://free.currconv.com/api/v7/convert?q=BTC_EUR&compact=y&apiKey=your_free_currencyconverterapi_key + // free api key here - https://free.currencyconverterapi.com/free-api-key // ---------------- if (!$val) { - $data = json_decode(get_url_contents("https://free.currencyconverterapi.com/api/v6/convert?q=".$key."&compact=ultra&apiKey=".$currencyconverterapi_key, 20, TRUE), TRUE); + $data = json_decode(get_url_contents("https://free.currconv.com/api/v7/convert?q=".$key."&compact=ultra&apiKey=".$currencyconverterapi_key, 20, TRUE), TRUE); if (isset($data[$key]) && $data[$key] > 0) $val = $data[$key]; elseif(isset($data["error"])) echo "

Error in function convert_currency_live(...)! ". $data["error"] . "

"; } @@ -2378,7 +2395,7 @@ function run_sql($sql) ); if(!defined("CRYPTOBOX_LOCALISATION")) define("CRYPTOBOX_LOCALISATION", json_encode($cryptobox_localisation)); - unset($cryptobox_localisation); + unset($cryptobox_localisation); if (!CRYPTOBOX_WORDPRESS || defined("CRYPTOBOX_PRIVATE_KEYS")) { @@ -2386,6 +2403,6 @@ function run_sql($sql) foreach ($cryptobox_private_keys as $v) if (strpos($v, " ") !== false || strpos($v, "PRV") === false || strpos($v, "AA") === false || strpos($v, "77") === false) die("Invalid Private Key - ". (CRYPTOBOX_WORDPRESS ? "please setup it on your plugin settings page" : "$v in variable \$cryptobox_private_keys, file cryptobox.config.php.")); - unset($v); unset($cryptobox_private_keys); + unset($v); unset($cryptobox_private_keys); } ?> \ No newline at end of file diff --git a/readme.md b/readme.md index bebe1ba..9801bb0 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ GoUrl.io Cryptocoin Payment Gateway API ----------------------------------------- -Version 2.1.7 +Version 2.2.0 **Accept Bitcoin, Bitcoin Cash, Bitcoin SV, Litecoin, Dash, Dogecoin, Speedcoin, Reddcoin, Potcoin, Feathercoin, Vertcoin, Peercoin, UniversalCurrency, MonetaryUnit Payments Online on your website**