Changeset 2307714
- Timestamp:
- 05/19/2020 07:50:55 AM (6 years ago)
- Location:
- woo-eftsecure-gateway/trunk
- Files:
-
- 5 edited
-
changelog.txt (modified) (1 diff)
-
includes/class-wc-eftsecure-api.php (modified) (3 diffs)
-
includes/class-wc-gateway-eftsecure.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
woocommerce-gateway-eftsecure.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-eftsecure-gateway/trunk/changelog.txt
r1691756 r2307714 15 15 * Added redirect support and option to enable checkout 16 16 * Precreate order for Checkout widget 17 18 = 1.0.4 - 2020.05.16 = 19 * Woocommerce 3.X support -
woo-eftsecure-gateway/trunk/includes/class-wc-eftsecure-api.php
r1691756 r2307714 115 115 ); 116 116 117 if (is_wp_error($response)) { 118 WC_Eftsecure::log( "WP Error: ".$response->get_error_message()); 119 return $response; 120 } 121 122 WC_Eftsecure::log( "Response: ".json_encode($response)); 123 117 124 $parsed_response = json_decode( $response['body'] ); 125 118 126 119 127 if(empty( $response['body'] ) ) { … … 128 136 129 137 // Handle response 130 if ( ! empty( $parsed_response->status ) && $parsed_response->status != 200 ) { 131 $error = new WP_Error( $parsed_response->status, $parsed_response->name ); 132 return $error; 133 } else { 134 return $parsed_response; 135 } 138 return $parsed_response; 136 139 } 137 140 … … 160 163 if ( is_wp_error( $response ) ) { 161 164 WC_Eftsecure::log( 'EFTsecure Transaction API Error: '.$response->get_error_message() ); 162 throw new Exception('EFTsecure Transaction: '.$response->get_error_message());163 165 } 164 166 return $response; -
woo-eftsecure-gateway/trunk/includes/class-wc-gateway-eftsecure.php
r1691756 r2307714 335 335 336 336 if ( $order->has_status( array( 'pending', 'failed' ) ) ) { 337 $order->reduce_order_stock(); 337 if ( version_compare( WC_VERSION, '3.0', '>=' ) ) { 338 // new version code 339 wc_reduce_stock_levels($order); 340 } else { 341 $order->reduce_order_stock(); 342 } 338 343 } 339 344 … … 350 355 throw new Exception( __( 'OrderID was not specified in IPN response', 'woocommerce-gateway-eftsecure' ) ); 351 356 } 357 358 WC_Eftsecure::log( __( 'EFT IPN response received '.json_encode($_REQUEST), 'woocommerce-gateway-eftsecure' ) ); 352 359 353 360 $order_id = $_REQUEST['order_id']; … … 391 398 392 399 if ($response->successful == 1) { 393 394 400 if ($order->has_status(array('pending', 'failed'))) { 395 $order->reduce_order_stock(); 401 if ( version_compare( WC_VERSION, '3.0', '>=' ) ) { 402 // new version code 403 wc_reduce_stock_levels($order); 404 } else { 405 $order->reduce_order_stock(); 406 } 396 407 } 397 408 -
woo-eftsecure-gateway/trunk/readme.txt
r1691756 r2307714 21 21 22 22 == Changelog == 23 = 1.0.4 - 2020.05.16 = 24 * Woocommerce 3.X support 25 23 26 = 1.0.3 - 2017.05.05 = 24 27 * Additional validation bug fixes -
woo-eftsecure-gateway/trunk/woocommerce-gateway-eftsecure.php
r1691756 r2307714 5 5 * Author: CallPay 6 6 * Author URI: http://www.eftsecure.co.za/ 7 * Version: 1.0. 37 * Version: 1.0.4 8 8 * Text Domain: woocommerce-gateway-eftsecure 9 9 * Domain Path: /languages … … 19 19 * Required minimums and constants 20 20 */ 21 define( 'WC_EFTSECURE_VERSION', '1.0. 3' );21 define( 'WC_EFTSECURE_VERSION', '1.0.4' ); 22 22 define( 'WC_EFTSECURE_MIN_WC_VER', '2.2.0' ); 23 23 define( 'WC_EFTSECURE_MAIN_FILE', __FILE__ );
Note: See TracChangeset
for help on using the changeset viewer.