Changeset 2683703
- Timestamp:
- 02/23/2022 12:08:00 PM (4 years ago)
- Location:
- bsecure/trunk
- Files:
-
- 4 edited
-
bsecure.php (modified) (1 diff)
-
includes/class-bsecure-checkout.php (modified) (13 diffs)
-
includes/class-wc-bsecure.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bsecure/trunk/bsecure.php
r2680494 r2683703 6 6 * Author: bSecure 7 7 * Author URI: 8 * Version: 1.6. 28 * Version: 1.6.3 9 9 * 10 10 */ -
bsecure/trunk/includes/class-bsecure-checkout.php
r2680494 r2683703 40 40 const BSECURE_INITIATED_STATUS = 2; 41 41 const BSECURE_EXPIRED_STATUS = 6; 42 const BSECURE_FAILED_STATUS = 7; 42 43 const BSECURE_DEV_VIEW_ORDER_URL = 'https://partners-dev.bsecure.app/view-order/'; 43 44 const BSECURE_STAGE_VIEW_ORDER_URL = 'https://partners-stage.bsecure.app/view-order/'; … … 296 297 */ 297 298 public function manage_order_webhook_api(){ 298 299 299 300 $order_data = json_decode(file_get_contents('php://input')); 300 301 … … 334 335 335 336 if(!empty($wc_order)){ 336 337 337 338 $order = wc_get_order($wc_order->ID); 338 339 … … 343 344 344 345 $bsecure_order_id = $order->get_meta('_bsecure_order_id'); 346 $bsecure_order_id = !empty($bsecure_order_id) ? $bsecure_order_id : $order->get_id(); 345 347 346 348 $return_json = ['status' => true, 'msg' => __("Order status updated successfully.", 'wc-bsecure'),'bsecure_order_id' => $bsecure_order_id]; … … 352 354 || $placement_status == Bsecure_Checkout::BSECURE_INITIATED_STATUS) { 353 355 354 $return_json = ['status' => true, 'msg' =>__("Sorry! your order has not been proccessed.","wc-bsecure"), 'bsecure_order_id' => $ bsecure_order_id];355 356 } else {356 $return_json = ['status' => true, 'msg' =>__("Sorry! your order has not been proccessed.","wc-bsecure"), 'bsecure_order_id' => $order_data->merchant_order_id]; 357 358 } else { 357 359 358 360 $order_id = $this->createOrderFromBsecureToWc($order_data); … … 363 365 364 366 $bsecure_order_id = $order->get_meta('_bsecure_order_id'); 367 $bsecure_order_id = !empty($bsecure_order_id) ? $bsecure_order_id : $order->get_id(); 365 368 366 369 // if order not success … … 372 375 } else { 373 376 374 $return_json = ['status' => true, 'msg' => __("Order added successfully at woocommerce.", "wc-bsecure"), 'bsecure_order_id' => $bsecure_order_id]; 377 $msg = __("Order added successfully at woocommerce.", "wc-bsecure"); 378 379 if($placement_status == Bsecure_Checkout::BSECURE_EXPIRED_STATUS || $placement_status == Bsecure_Checkout::BSECURE_FAILED_STATUS){ 380 $statusTitle = ($order_data->placement_status == Bsecure_Checkout::BSECURE_EXPIRED_STATUS) ? __('expired','wc-bsecure') : __('failed','wc-bsecure'); 381 382 $msg = __("This order is ".$statusTitle." at bSecure portal but status is different at woocommerce.", "wc-bsecure"); 383 } 384 385 $return_json = ['status' => true, 'msg' => $msg, 'bsecure_order_id' => $bsecure_order_id]; 375 386 376 387 } … … 612 623 613 624 // Get Order // 614 $this->access_token = $response->access_token; 615 616 //$headers = 'Authorization: Bearer '.$this->access_token; 617 618 //$headers = ['Authorization' => 'Bearer '.$this->access_token]; 625 $this->access_token = $response->access_token; 619 626 620 627 $headers = $this->getApiHeaders($this->access_token); … … 679 686 } 680 687 681 else if ($order_data->placement_status == Bsecure_Checkout::BSECURE_EXPIRED_STATUS ) { 688 else if ($order_data->placement_status == Bsecure_Checkout::BSECURE_EXPIRED_STATUS || $order_data->placement_status == Bsecure_Checkout::BSECURE_FAILED_STATUS ) { 689 690 $statusTitle = ($order_data->placement_status == Bsecure_Checkout::BSECURE_EXPIRED_STATUS) ? __('expired','wc-bsecure') : __('failed','wc-bsecure'); 682 691 683 692 if( ! WC()->cart->is_empty() ){ … … 688 697 wc_clear_notices(); 689 698 690 wc_add_notice(__("Sorry! Your order has been expired.","wc-bsecure"), 'notice' );699 wc_add_notice(__("Sorry! Your order has been ".$statusTitle.".","wc-bsecure"), 'notice' ); 691 700 692 701 wp_redirect(wc_get_page_permalink( 'shop' )); … … 810 819 811 820 } 812 813 return $this->updateOrderPaymentGateway($order, $order_data, $isCustomer); 821 822 // check if payment method is bSecure then update status 823 if($order->get_payment_method() == 'bsecures' || ($order_data->payment_method->id == 1 && $order->get_payment_method() == 'cod' )){ 824 825 return $this->updateOrderPaymentGateway($order, $order_data, $isCustomer); 826 }else{ 827 828 return $order->get_id(); 829 } 814 830 815 831 } … … 2203 2219 * Use this function if payment gateway order type used 2204 2220 */ 2205 public function updateOrderPaymentGateway($order, $order_data, $customer){ 2221 public function updateOrderPaymentGateway($order, $order_data, $customer){ 2206 2222 2207 2223 $placement_status = $order_data->placement_status; … … 2346 2362 2347 2363 if( function_exists('WC') ){ 2348 2364 2365 WC()->session = new WC_Session_Handler(); 2366 WC()->session->init(); 2349 2367 WC()->cart = new WC_Cart(); 2350 2368 2351 2369 if( ! WC()->cart->is_empty() ){ 2352 2353 2370 WC()->cart->empty_cart(); 2354 2371 } -
bsecure/trunk/includes/class-wc-bsecure.php
r2680494 r2683703 30 30 31 31 const PLUGIN_NAME = 'WooCommerce'; 32 const PLUGIN_VERSION = '1.6. 2';32 const PLUGIN_VERSION = '1.6.3'; 33 33 const QISSTPAY_PER_MONTH = 4; 34 34 const QISSTPAY_AMOUNT_MAX_LIMIT = 50000; -
bsecure/trunk/readme.txt
r2680494 r2683703 5 5 Tested up to: 5.9 6 6 Requires PHP: 5.6.20 or above 7 Stable tag: 1.6. 27 Stable tag: 1.6.3 8 8 License: GNU General Public License v3.0 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 95 95 * 1.5.2 is a general update and QisstPay feature is live 96 96 97 == 1.5.4 September 10, 2021 ==98 * 1.5.4 is a general update99 100 == 1.5.6 October 07, 2021 ==101 * 1.5.6 General Update & bug resolved102 103 97 == 1.5.7 October 26, 2021 == 104 98 * 1.5.7 General Update & Buyer Protection Feature … … 110 104 * 1.6.0 Released General Update & Bug Fixes 111 105 112 == 1.6.1 February 11, 202 1==106 == 1.6.1 February 11, 2022 == 113 107 * 1.6.1 Released General Update, PIM api integration and Bug Fixes 114 108 109 == 1.6.3 February 23, 2022 == 110 * 1.6.3 Released General Update and Bug Fixes 111 115 112 == Screenshots ==
Note: See TracChangeset
for help on using the changeset viewer.