Changeset 2690001
- Timestamp:
- 03/07/2022 01:39:17 PM (4 years ago)
- Location:
- bsecure/trunk
- Files:
-
- 4 edited
-
bsecure.php (modified) (1 diff)
-
includes/class-bsecure-checkout.php (modified) (4 diffs)
-
includes/class-wc-bsecure.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bsecure/trunk/bsecure.php
r2688113 r2690001 6 6 * Author: bSecure 7 7 * Author URI: 8 * Version: 1.6. 48 * Version: 1.6.5 9 9 * 10 10 */ -
bsecure/trunk/includes/class-bsecure-checkout.php
r2688113 r2690001 143 143 add_action('woocommerce_add_to_cart', array($this, 'bsecure_custom_add_to_cart' )); 144 144 145 add_filter('woocommerce_rest_prepare_product_object', array($this,'custom_product_api_response'), 10, 3); 145 add_filter('woocommerce_rest_prepare_product_object', array($this,'custom_product_api_response'), 10, 3); 146 147 // trigger when wc order status changed 148 add_action( 'woocommerce_order_status_changed', array($this,'bsecure_action_woocommerce_order_status_changed'), 10, 1 ); 146 149 147 150 } … … 346 349 $bsecure_order_id = !empty($bsecure_order_id) ? $bsecure_order_id : $order->get_id(); 347 350 351 $this->bsecure_action_woocommerce_order_status_changed($order->get_id()); 352 348 353 $return_json = ['status' => true, 'msg' => __("Order status updated successfully.", 'wc-bsecure'),'bsecure_order_id' => $bsecure_order_id]; 349 354 … … 383 388 } 384 389 390 $this->bsecure_action_woocommerce_order_status_changed($order->get_id()); 391 385 392 $return_json = ['status' => true, 'msg' => $msg, 'bsecure_order_id' => $bsecure_order_id]; 386 393 … … 2899 2906 } 2900 2907 2908 /** 2909 * The function used when order status changes at woocommerce 2910 * Send webhook response to bsecure server 2911 */ 2912 2913 public function bsecure_action_woocommerce_order_status_changed($order_id){ 2914 2915 $order = wc_get_order($order_id); 2916 $store_id = get_option('wc_bsecure_store_id', ''); 2917 $base_url = get_option('wc_bsecure_base_url', ''); 2918 $request_data = ["order_id" => $order_id, 'store_slug' => $store_id]; 2919 $webhook_endpoint = '/webhook/pim/order-created'; 2920 2921 $webhook_url = $base_url.$webhook_endpoint; 2922 2923 if(!empty($order->get_items())){ 2924 foreach ($order->get_items() as $order_item_id => $order_item) { 2925 2926 $productInfo = ($order_item->get_data()); 2927 2928 $product_id = !empty($productInfo['variation_id']) ? $productInfo['variation_id'] : $productInfo['product_id']; 2929 2930 $request_data["line_items"][] = [ 2931 'product_id' => $productInfo['product_id'], 2932 'variant_id' => $productInfo['variation_id'] 2933 ]; 2934 2935 } 2936 } 2937 2938 2939 if($order->get_status() == Bsecure_Checkout::STATUS_PROCESSING && get_option('wc_bsecure_is_active', 'no') == 'yes'){ 2940 2941 $response = $this->bsecureGetOauthToken(); 2942 2943 $validateResponse = $this->validateResponse($response,'token_request'); 2944 2945 if( $validateResponse['error'] ){ 2946 2947 status_header( 422 ); 2948 2949 die('Response Error: '.$validateResponse['msg']); 2950 2951 }else{ 2952 2953 $headers = $this->getApiHeaders($response->access_token); 2954 2955 $params = [ 2956 2957 'method' => 'POST', 2958 'body' => $request_data, 2959 'headers' => $headers, 2960 2961 ]; 2962 2963 $this->bsecureSendCurlRequest($webhook_url,$params); 2964 } 2965 2966 } 2967 2968 } 2901 2969 2902 2970 } -
bsecure/trunk/includes/class-wc-bsecure.php
r2688113 r2690001 30 30 31 31 const PLUGIN_NAME = 'WooCommerce'; 32 const PLUGIN_VERSION = '1.6. 4';32 const PLUGIN_VERSION = '1.6.5'; 33 33 const QISSTPAY_PER_MONTH = 4; 34 34 const QISSTPAY_AMOUNT_MAX_LIMIT = 50000; -
bsecure/trunk/readme.txt
r2688113 r2690001 5 5 Tested up to: 5.9 6 6 Requires PHP: 5.6.20 or above 7 Stable tag: 1.6. 47 Stable tag: 1.6.5 8 8 License: GNU General Public License v3.0 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 82 82 * Tweak - Tested compatibility with WP 5.4. 83 83 84 == 1.6.1 February 11, 2022 == 85 * 1.6.1 Released General Update, PIM api integration and Bug Fixes 86 87 == 1.6.3 February 23, 2022 == 88 * 1.6.3 Released General Update and Bug Fixes 89 90 == 1.6.4 March 3, 2022 == 91 * 1.6.4 Released General Update and Bug Fixes 92 93 == 1.6.5 March 7, 2022 == 94 * 1.6.5 Released General Update, New Feature (PIM) and Bug Fixes 95 84 96 == Upgrade Notice == 85 97 = 1.0 =
Note: See TracChangeset
for help on using the changeset viewer.