Changeset 2863185
- Timestamp:
- 02/10/2023 11:15:13 AM (3 years ago)
- Location:
- cashfree
- Files:
-
- 26 added
- 3 edited
-
tags/4.4.2 (added)
-
tags/4.4.2/LICENSE (added)
-
tags/4.4.2/README.md (added)
-
tags/4.4.2/assets (added)
-
tags/4.4.2/assets/js (added)
-
tags/4.4.2/assets/js/checkout.js (added)
-
tags/4.4.2/cashfree.php (added)
-
tags/4.4.2/includes (added)
-
tags/4.4.2/includes/class-wc-cashfree-api.php (added)
-
tags/4.4.2/includes/gateways (added)
-
tags/4.4.2/includes/gateways/class-wc-cashfree-gateway.php (added)
-
tags/4.4.2/includes/gateways/class-wc-cashfree-payments.php (added)
-
tags/4.4.2/includes/http (added)
-
tags/4.4.2/includes/http/class-wc-cashfree-adapter.php (added)
-
tags/4.4.2/includes/request (added)
-
tags/4.4.2/includes/request/class-wc-cashfree-request-billing.php (added)
-
tags/4.4.2/includes/request/class-wc-cashfree-request-checkout.php (added)
-
tags/4.4.2/includes/request/class-wc-cashfree-request-items.php (added)
-
tags/4.4.2/includes/request/class-wc-cashfree-request-shipping.php (added)
-
tags/4.4.2/includes/settings (added)
-
tags/4.4.2/includes/settings/cashfree-payments.php (added)
-
tags/4.4.2/includes/wc-cashfree-functions.php (added)
-
tags/4.4.2/includes/wc-cashfree-scripts.php (added)
-
tags/4.4.2/readme.txt (added)
-
tags/4.4.2/templates (added)
-
tags/4.4.2/templates/payment-fields.php (added)
-
trunk/cashfree.php (modified) (1 diff)
-
trunk/includes/http/class-wc-cashfree-adapter.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cashfree/trunk/cashfree.php
r2859422 r2863185 2 2 /** 3 3 * Plugin Name: Cashfree 4 * Version: 4.4. 14 * Version: 4.4.2 5 5 * Plugin URI: https://github.com/cashfree/cashfree-woocommerce 6 6 * Description: Payment gateway plugin by Cashfree Payments for Woocommerce sites. -
cashfree/trunk/includes/http/class-wc-cashfree-adapter.php
r2753558 r2863185 39 39 public function checkout( $order_id ) { 40 40 require_once WC_CASHFREE_DIR_PATH . 'includes/request/class-wc-cashfree-request-checkout.php'; 41 42 $getEnvValue = $this->getCurlValue(); 43 44 $getOrderUrl = $getEnvValue['curlUrl']."/".$order_id; 45 46 $args = array( 47 'timeout' => '30', 48 'headers' => array( 49 'x-api-version' => '2021-05-21', 50 'x-client-id' => $this->gateway->settings['app_id'], 51 'x-client-secret' => $this->gateway->settings['secret_key'], 52 ), 53 ); 54 55 56 $response = wp_remote_get( $getOrderUrl, $args ); 57 58 $http_code = wp_remote_retrieve_response_code( $response ); 59 if($http_code == 200){ 60 $cfOrder = json_decode(wp_remote_retrieve_body( $response )); 61 if(!empty($cfOrder)) { 62 $order = wc_get_order($order_id); 63 if($cfOrder == "PAID") { 64 throw new Exception("Please reach out to the support team"); 65 } else { 66 if(strtotime($cfOrder->order_expiry_time) > time() && round($cfOrder->order_amount) == round($order->get_total()) && $cfOrder->order_currency == $order->get_currency()) { 67 $response = [ 68 'order_token' => $cfOrder->order_token, 69 'environment' => $getEnvValue['environment'], 70 'payment_link' => $cfOrder->payment_link, 71 ]; 72 return $response; 73 } else { 74 throw new Exception("Please reach out to the support team"); 75 } 76 } 77 } 78 } 41 79 42 80 $requestParams = WC_Cashfree_Request_Checkout::build( $order_id, $this->gateway ); … … 246 284 // Get request for gateway 247 285 private function curlGetRequest($curlUrl) { 248 249 286 $args = array( 250 287 'timeout' => '30', … … 257 294 258 295 $response = wp_remote_get( $curlUrl, $args ); 296 259 297 $http_code = wp_remote_retrieve_response_code( $response ); 260 298 $body = json_decode(wp_remote_retrieve_body( $response )); 261 262 299 if($http_code == 200) { 263 300 return $body[0]; -
cashfree/trunk/readme.txt
r2859422 r2863185 4 4 Tested up to: 6.0 5 5 Requires PHP: 5.6 6 Stable tag: 4.4. 17 Version: 4.4. 16 Stable tag: 4.4.2 7 Version: 4.4.2 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 33 33 34 34 == Changelog == 35 36 = 4.4.2 = 37 * Handled same order id to get payments 35 38 36 39 = 4.4.1 =
Note: See TracChangeset
for help on using the changeset viewer.