15
15
* @example https://gourl.io/lib/examples/example_customize_box.php <----
16
16
* @gitHub https://github.com/cryptoapi/Payment-Gateway
17
17
* @license Free GPLv2
18
- * @version 2.2.0
18
+ * @version 2.1.7
19
19
*
20
20
*
21
21
* CLASS CRYPTOBOX - LIST OF METHODS:
79
79
elseif (!defined ('ABSPATH ' )) exit ; // Wordpress
80
80
81
81
82
- define ("CRYPTOBOX_VERSION " , "2.2.0 " );
82
+ define ("CRYPTOBOX_VERSION " , "2.1.7 " );
83
83
84
84
// GoUrl supported crypto currencies
85
85
define ("CRYPTOBOX_COINS " , json_encode (array ('bitcoin ' , 'bitcoincash ' , 'bitcoinsv ' , 'litecoin ' , 'dash ' , 'dogecoin ' , 'speedcoin ' , 'reddcoin ' , 'potcoin ' , 'feathercoin ' , 'vertcoin ' , 'peercoin ' , 'monetaryunit ' , 'universalcurrency ' )));
@@ -131,7 +131,6 @@ class Cryptobox {
131
131
private $ processed = false ; // optional - set flag to paid & processed
132
132
private $ cookieName = "" ; // user cookie/session name (if cookies/sessions use)
133
133
private $ localisation = "" ; // localisation; en - English, es - Spanish, fr - French, de - German, nl - Dutch, it - Italian, ru - Russian, pl - Polish, pt - Portuguese, fa - Persian, ko - Korean, ja - Japanese, id - Indonesian, tr - Turkish, ar - Arabic, cn - Simplified Chinese, zh - Traditional Chinese, hi - Hindi
134
- private $ ver = "" ; // version
135
134
136
135
137
136
public function __construct ($ options = array ())
@@ -142,7 +141,8 @@ public function __construct($options = array())
142
141
if (!function_exists ( 'curl_init ' )) die (sprintf ("Error. Please enable <a target='_blank' href='%s'>CURL extension</a> in PHP. <a target='_blank' href='%s'>Read here »</a> " , "http://php.net/manual/en/book.curl.php " , "http://stackoverflow.com/questions/1347146/how-to-enable-curl-in-php-xampp " ));
143
142
if (!function_exists ( 'mysqli_connect ' )) die (sprintf ("Error. Please enable <a target='_blank' href='%s'>MySQLi extension</a> in PHP. <a target='_blank' href='%s'>Read here »</a> " , "http://php.net/manual/en/book.mysqli.php " , "http://crybit.com/how-to-enable-mysqli-extension-on-web-server/ " ));
144
143
if (version_compare (phpversion (), '5.4.0 ' , '< ' )) die (sprintf ("Error. You need PHP 5.4.0 (or greater). Current php version: %s " , phpversion ()));
145
-
144
+
145
+
146
146
foreach ($ options as $ key => $ value )
147
147
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 ;
148
148
@@ -241,18 +241,6 @@ public function __construct($options = array())
241
241
}
242
242
}
243
243
244
- // version string
245
- $ this ->ver = "version | gourlphp " . CRYPTOBOX_VERSION ;
246
- if (CRYPTOBOX_WORDPRESS ) $ this ->ver .= " | gourlwordpress " . (defined ('GOURL_VERSION ' ) ? " " .GOURL_VERSION : "" );
247
- if (CRYPTOBOX_WORDPRESS && defined ('GOURLWC_VERSION ' ) && strpos ($ this ->orderID , "gourlwoocommerce. " ) === 0 ) $ this ->ver .= " | gourlwoocommerce " . GOURLWC_VERSION ;
248
- if (CRYPTOBOX_WORDPRESS && defined ('GOURLAP_VERSION ' ) && strpos ($ this ->orderID , "gourlappthemes. " ) === 0 ) $ this ->ver .= " | gourlappthemes " . GOURLAP_VERSION ;
249
- if (CRYPTOBOX_WORDPRESS && defined ('GOURLEDD_VERSION ' ) && strpos ($ this ->orderID , "gourledd. " ) === 0 ) $ this ->ver .= " | gourledd " . GOURLEDD_VERSION ;
250
- if (CRYPTOBOX_WORDPRESS && defined ('GOURLPMP_VERSION ' ) && strpos ($ this ->orderID , "gourlpmpro. " ) === 0 ) $ this ->ver .= " | gourlpmpro " . GOURLPMP_VERSION ;
251
- if (CRYPTOBOX_WORDPRESS && defined ('GOURLGV_VERSION ' ) && strpos ($ this ->orderID , "gourlgive. " ) === 0 ) $ this ->ver .= " | gourlgive " . GOURLGV_VERSION ;
252
- if (CRYPTOBOX_WORDPRESS && defined ('GOURLJI_VERSION ' ) && strpos ($ this ->orderID , "gourljigoshop. " ) === 0 ) $ this ->ver .= " | gourljigoshop " . GOURLJI_VERSION ;
253
- if (CRYPTOBOX_WORDPRESS && defined ('GOURLWPSC_VERSION ' ) && strpos ($ this ->orderID , "gourlwpecommerce. " ) === 0 ) $ this ->ver .= " | gourlwpecommerce " . GOURLWPSC_VERSION ;
254
- if (CRYPTOBOX_WORDPRESS && defined ('GOURLMP_VERSION ' ) && strpos ($ this ->orderID , "gourlmarketpress. " ) === 0 ) $ this ->ver .= " | gourlmarketpress " . GOURLMP_VERSION ;
255
-
256
244
if (!$ this ->iframeID ) $ this ->iframeID = $ this ->iframe_id ();
257
245
258
246
$ this ->check_payment ();
@@ -285,8 +273,6 @@ public function display_cryptobox($submit_btn = true, $width = "540", $height =
285
273
286
274
$ width = intval ($ width );
287
275
$ height = intval ($ height );
288
-
289
- $ box_style = trim ($ box_style , "; " ) .";max-width: " .$ width ."px !important;max-height: " .$ height ."px !important; " ;
290
276
291
277
$ cryptobox_html = "" ;
292
278
$ val = md5 ($ this ->iframeID .$ this ->private_key .$ this ->userID );
@@ -309,7 +295,7 @@ public function display_cryptobox($submit_btn = true, $width = "540", $height =
309
295
310
296
$ cryptobox_html .= "<div align='center' style='min-width: " .$ width ."px'><iframe id=' $ this ->iframeID ' " .($ box_style ?'style=" ' .htmlspecialchars ($ box_style , ENT_COMPAT ).'" ' :'' )." scrolling='no' marginheight='0' marginwidth='0' frameborder='0' width=' $ width' height=' $ height'></iframe></div> " ;
311
297
$ cryptobox_html .= "<div><script type='text/javascript'> " ;
312
- $ cryptobox_html .= "cryptobox_show( $ this ->boxID , ' $ this ->coinName ', ' $ this ->public_key ', $ this ->amount , $ this ->amountUSD , ' $ this ->period ', ' $ this ->language ', ' $ this ->iframeID ', ' $ this ->userID ', ' $ this ->userFormat ', ' $ this ->orderID ', ' $ this ->cookieName ', ' $ this ->webdev_key ', ' " . base64_encode ( $ this -> ver ). " ', ' $ hash', $ width, $ height); " ;
298
+ $ cryptobox_html .= "cryptobox_show( $ this ->boxID , ' $ this ->coinName ', ' $ this ->public_key ', $ this ->amount , $ this ->amountUSD , ' $ this ->period ', ' $ this ->language ', ' $ this ->iframeID ', ' $ this ->userID ', ' $ this ->userFormat ', ' $ this ->orderID ', ' $ this ->cookieName ', ' $ this ->webdev_key ', ' $ hash', $ width, $ height); " ;
313
299
$ cryptobox_html .= "</script></div> " ;
314
300
315
301
if ($ submit_btn && !$ this ->paid )
@@ -369,7 +355,6 @@ public function cryptobox_json_url()
369
355
"j " => 1 , // json
370
356
"d " => base64_encode ($ ip ),
371
357
"f " => base64_encode ($ this ->ua (false )),
372
- "t " => base64_encode ($ this ->ver ),
373
358
"h " => $ hash
374
359
);
375
360
@@ -448,8 +433,8 @@ public function get_json_values()
448
433
public function cryptobox_hash ($ json = false , $ width = 0 , $ height = 0 )
449
434
{
450
435
451
- 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 ();
452
- 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 ;
436
+ 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 ();
437
+ 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 ;
453
438
454
439
455
440
$ hash = md5 ($ hash_str );
@@ -1332,7 +1317,7 @@ private function check_payment_live()
1332
1317
{
1333
1318
$ ip = $ this ->ip_address ();
1334
1319
$ private_key_hash = strtolower (hash ("sha512 " , $ this ->private_key ));
1335
- $ hash = md5 ($ this ->boxID .$ private_key_hash .$ this ->userID .$ this ->orderID .$ this ->language .$ this ->period .$ this -> ver . $ ip );
1320
+ $ hash = md5 ($ this ->boxID .$ private_key_hash .$ this ->userID .$ this ->orderID .$ this ->language .$ this ->period .$ ip );
1336
1321
$ box_status = "" ;
1337
1322
1338
1323
$ data = array (
@@ -1342,7 +1327,6 @@ private function check_payment_live()
1342
1327
"u " => $ this ->userID ,
1343
1328
"l " => $ this ->language ,
1344
1329
"e " => $ this ->period ,
1345
- "t " => $ this ->ver ,
1346
1330
"i " => $ ip ,
1347
1331
"h " => $ hash
1348
1332
);
@@ -2395,14 +2379,14 @@ function run_sql($sql)
2395
2379
);
2396
2380
2397
2381
if (!defined ("CRYPTOBOX_LOCALISATION " )) define ("CRYPTOBOX_LOCALISATION " , json_encode ($ cryptobox_localisation ));
2398
- unset($ cryptobox_localisation );
2382
+ unset($ cryptobox_localisation );
2399
2383
2400
2384
if (!CRYPTOBOX_WORDPRESS || defined ("CRYPTOBOX_PRIVATE_KEYS " ))
2401
2385
{
2402
2386
$ cryptobox_private_keys = explode ("^ " , CRYPTOBOX_PRIVATE_KEYS );
2403
2387
foreach ($ cryptobox_private_keys as $ v )
2404
2388
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. " ));
2405
2389
2406
- unset($ v ); unset($ cryptobox_private_keys );
2390
+ unset($ v ); unset($ cryptobox_private_keys );
2407
2391
}
2408
2392
?>
0 commit comments