Changeset 2919181
- Timestamp:
- 05/30/2023 03:13:09 PM (3 years ago)
- Location:
- triplea-cryptocurrency-payment-gateway-for-woocommerce
- Files:
-
- 6 edited
- 1 copied
-
tags/2.0.5 (copied) (copied from triplea-cryptocurrency-payment-gateway-for-woocommerce/trunk)
-
tags/2.0.5/includes/WooCommerce/TripleA_Payment_Gateway.php (modified) (5 diffs)
-
tags/2.0.5/readme.txt (modified) (3 diffs)
-
tags/2.0.5/triplea-cryptocurrency-payment-gateway-for-woocommerce.php (modified) (2 diffs)
-
trunk/includes/WooCommerce/TripleA_Payment_Gateway.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/triplea-cryptocurrency-payment-gateway-for-woocommerce.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
triplea-cryptocurrency-payment-gateway-for-woocommerce/tags/2.0.5/includes/WooCommerce/TripleA_Payment_Gateway.php
r2820420 r2919181 479 479 ); 480 480 481 if(is_string($payment_form_data)){ 482 $payment_form_data = json_decode($payment_form_data); 483 } 484 481 485 if (isset($payment_form_data->error) || !isset($payment_form_data->payment_reference)) { 482 486 … … 484 488 echo json_encode( 485 489 [ 486 'status' => ' notok',490 'status' => 'failed', 487 491 'code' => isset($payment_form_data->code) ? $payment_form_data->code : 'Unknown error code.', 488 492 'message' => isset($payment_form_data->message) ? $payment_form_data->message : 'Unknown error message.', … … 587 591 } 588 592 } 589 593 private function refreshOauthTokensForForms($refresh_for_api_id = FALSE) { 594 595 $date_now = (new DateTime())->getTimestamp(); 596 $date_expiry_limit = $date_now - 600; // 10 minutes before expiry token 597 598 $new_token_data = $this->getOauthToken($this->clientID, $this->clientSecret); 599 $this->logger->write_log( 'refreshOauthTokensForForms() OAuth token data received : ' . wc_print_r(json_encode($new_token_data), TRUE), $this->debugLog ); 600 601 if ($new_token_data !== FALSE 602 && isset($new_token_data->access_token) 603 && !empty($new_token_data->access_token) 604 && isset($new_token_data->expires_in) 605 && !empty($new_token_data->expires_in)) { 606 $this->oauthToken = $new_token_data->access_token; 607 $this->oauthTokenExpiry = $date_now + $new_token_data->expires_in; 608 $this->update_option('oauth_token', $this->oauthToken); 609 $this->update_option('oauth_token_expiry', $this->oauthTokenExpiry); 610 $this->logger->write_log( 'refreshOauthTokensForForms() Obtained and saved a new oauth token.', $this->debugLog ); 611 612 return $new_token_data->access_token; 613 } else { 614 $this->logger->write_log( 'refreshOauthTokensForForms() A problem happened, could not get a new oauth token. \n' . wc_print_r(json_encode($new_token_data), TRUE), $this->debugLog ); 615 $this->oauthToken = NULL; 616 $this->oauthTokenExpiry = NULL; 617 $this->update_option('oauth_token', $this->oauthToken); 618 $this->update_option('oauth_token_expiry', $this->oauthTokenExpiry); 619 620 return false; 621 } 622 623 } 590 624 private function getOauthToken( $client_id, $client_secret ) { 591 625 … … 636 670 ) { 637 671 $self = new TripleA_Payment_Gateway(); 638 $oauth_token = $this->get_option('oauth_token'); 672 673 // Refresh oauth tokens, Actually generating new tokens 674 $oauth_token = $self->refreshOauthTokensForForms(); 639 675 640 676 if (empty($oauth_token)) { … … 642 678 } 643 679 644 // Refresh oauth tokens 645 $self->refreshOauthTokens(); 680 646 681 647 682 $post_url = 'https://api.triple-a.io/api/v2/payment'; -
triplea-cryptocurrency-payment-gateway-for-woocommerce/tags/2.0.5/readme.txt
r2820420 r2919181 7 7 Requires at least: 5.5 8 8 Tested up to: 6.1.1 9 Stable tag: 2.0. 49 Stable tag: 2.0.5 10 10 Requires PHP: 7.0 11 11 License: GPLv2 or later … … 109 109 == Changelog == 110 110 111 = 2.0.5 = 112 Fixed: Payment form loading after clicking "Pay with Cryptocurrency" issue fixed 113 111 114 = 2.0.4 = 112 115 Removed: Payment Method description is removed … … 261 264 == Upgrade Notice == 262 265 266 = 2.0.5 = 267 Simply install the update. No further action is needed. 268 263 269 = 2.0.4 = 264 270 Simply install the update. No further action is needed. -
triplea-cryptocurrency-payment-gateway-for-woocommerce/tags/2.0.5/triplea-cryptocurrency-payment-gateway-for-woocommerce.php
r2820420 r2919181 17 17 * Plugin URI: https://wordpress.org/plugins/triplea-cryptocurrency-payment-gateway-for-woocommerce/ 18 18 * Description: Offer cryptocurrency as a payment option on your website and get access to even more clients. Receive payments in cryptocurrency or in your local currency, directly in your bank account. Enjoy an easy setup, no cryptocurrency expertise required. Powered by TripleA. 19 * Version: 2.0. 419 * Version: 2.0.5 20 20 * Author: TripleA Team 21 21 * Author URI: https://triple-a.io … … 45 45 * $var string 46 46 */ 47 const version = '2.0. 4';47 const version = '2.0.5'; 48 48 49 49 /* -
triplea-cryptocurrency-payment-gateway-for-woocommerce/trunk/includes/WooCommerce/TripleA_Payment_Gateway.php
r2820420 r2919181 479 479 ); 480 480 481 if(is_string($payment_form_data)){ 482 $payment_form_data = json_decode($payment_form_data); 483 } 484 481 485 if (isset($payment_form_data->error) || !isset($payment_form_data->payment_reference)) { 482 486 … … 484 488 echo json_encode( 485 489 [ 486 'status' => ' notok',490 'status' => 'failed', 487 491 'code' => isset($payment_form_data->code) ? $payment_form_data->code : 'Unknown error code.', 488 492 'message' => isset($payment_form_data->message) ? $payment_form_data->message : 'Unknown error message.', … … 587 591 } 588 592 } 589 593 private function refreshOauthTokensForForms($refresh_for_api_id = FALSE) { 594 595 $date_now = (new DateTime())->getTimestamp(); 596 $date_expiry_limit = $date_now - 600; // 10 minutes before expiry token 597 598 $new_token_data = $this->getOauthToken($this->clientID, $this->clientSecret); 599 $this->logger->write_log( 'refreshOauthTokensForForms() OAuth token data received : ' . wc_print_r(json_encode($new_token_data), TRUE), $this->debugLog ); 600 601 if ($new_token_data !== FALSE 602 && isset($new_token_data->access_token) 603 && !empty($new_token_data->access_token) 604 && isset($new_token_data->expires_in) 605 && !empty($new_token_data->expires_in)) { 606 $this->oauthToken = $new_token_data->access_token; 607 $this->oauthTokenExpiry = $date_now + $new_token_data->expires_in; 608 $this->update_option('oauth_token', $this->oauthToken); 609 $this->update_option('oauth_token_expiry', $this->oauthTokenExpiry); 610 $this->logger->write_log( 'refreshOauthTokensForForms() Obtained and saved a new oauth token.', $this->debugLog ); 611 612 return $new_token_data->access_token; 613 } else { 614 $this->logger->write_log( 'refreshOauthTokensForForms() A problem happened, could not get a new oauth token. \n' . wc_print_r(json_encode($new_token_data), TRUE), $this->debugLog ); 615 $this->oauthToken = NULL; 616 $this->oauthTokenExpiry = NULL; 617 $this->update_option('oauth_token', $this->oauthToken); 618 $this->update_option('oauth_token_expiry', $this->oauthTokenExpiry); 619 620 return false; 621 } 622 623 } 590 624 private function getOauthToken( $client_id, $client_secret ) { 591 625 … … 636 670 ) { 637 671 $self = new TripleA_Payment_Gateway(); 638 $oauth_token = $this->get_option('oauth_token'); 672 673 // Refresh oauth tokens, Actually generating new tokens 674 $oauth_token = $self->refreshOauthTokensForForms(); 639 675 640 676 if (empty($oauth_token)) { … … 642 678 } 643 679 644 // Refresh oauth tokens 645 $self->refreshOauthTokens(); 680 646 681 647 682 $post_url = 'https://api.triple-a.io/api/v2/payment'; -
triplea-cryptocurrency-payment-gateway-for-woocommerce/trunk/readme.txt
r2820420 r2919181 7 7 Requires at least: 5.5 8 8 Tested up to: 6.1.1 9 Stable tag: 2.0. 49 Stable tag: 2.0.5 10 10 Requires PHP: 7.0 11 11 License: GPLv2 or later … … 109 109 == Changelog == 110 110 111 = 2.0.5 = 112 Fixed: Payment form loading after clicking "Pay with Cryptocurrency" issue fixed 113 111 114 = 2.0.4 = 112 115 Removed: Payment Method description is removed … … 261 264 == Upgrade Notice == 262 265 266 = 2.0.5 = 267 Simply install the update. No further action is needed. 268 263 269 = 2.0.4 = 264 270 Simply install the update. No further action is needed. -
triplea-cryptocurrency-payment-gateway-for-woocommerce/trunk/triplea-cryptocurrency-payment-gateway-for-woocommerce.php
r2820420 r2919181 17 17 * Plugin URI: https://wordpress.org/plugins/triplea-cryptocurrency-payment-gateway-for-woocommerce/ 18 18 * Description: Offer cryptocurrency as a payment option on your website and get access to even more clients. Receive payments in cryptocurrency or in your local currency, directly in your bank account. Enjoy an easy setup, no cryptocurrency expertise required. Powered by TripleA. 19 * Version: 2.0. 419 * Version: 2.0.5 20 20 * Author: TripleA Team 21 21 * Author URI: https://triple-a.io … … 45 45 * $var string 46 46 */ 47 const version = '2.0. 4';47 const version = '2.0.5'; 48 48 49 49 /*
Note: See TracChangeset
for help on using the changeset viewer.