Changeset 2309547
- Timestamp:
- 05/21/2020 02:41:43 PM (6 years ago)
- Location:
- woo-eftsecure-gateway
- Files:
-
- 6 edited
- 6 copied
-
tags/1.0.5 (copied) (copied from woo-eftsecure-gateway/trunk)
-
tags/1.0.5/assets/js/eftsecure_checkout.js (modified) (2 diffs)
-
tags/1.0.5/changelog.txt (copied) (copied from woo-eftsecure-gateway/trunk/changelog.txt) (1 diff)
-
tags/1.0.5/includes/class-wc-eftsecure-api.php (copied) (copied from woo-eftsecure-gateway/trunk/includes/class-wc-eftsecure-api.php)
-
tags/1.0.5/includes/class-wc-gateway-eftsecure.php (copied) (copied from woo-eftsecure-gateway/trunk/includes/class-wc-gateway-eftsecure.php) (4 diffs)
-
tags/1.0.5/readme.txt (copied) (copied from woo-eftsecure-gateway/trunk/readme.txt) (2 diffs)
-
tags/1.0.5/woocommerce-gateway-eftsecure.php (copied) (copied from woo-eftsecure-gateway/trunk/woocommerce-gateway-eftsecure.php) (2 diffs)
-
trunk/assets/js/eftsecure_checkout.js (modified) (2 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/includes/class-wc-gateway-eftsecure.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/woocommerce-gateway-eftsecure.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-eftsecure-gateway/tags/1.0.5/assets/js/eftsecure_checkout.js
r1691756 r2309547 1 1 jQuery( function( $ ) { 2 2 'use strict'; 3 4 window.eftPaymentKey = null; 3 5 4 6 window.wc_checkout_form = { … … 112 114 e.preventDefault(); 113 115 114 jQuery.ajax({ 115 type: 'POST', 116 url: wc_checkout_params.checkout_url, 117 data: jQuery('form.checkout').serialize(), 118 dataType: 'json', 119 success: function(result) { 120 try { 121 if ('success' === result.result) { 122 var $paymentKey = result.paymentKey; 123 console.log($paymentKey); 124 console.log('Initiating transaction'); 125 eftSec.checkout.init({ 126 paymentKey: $paymentKey, 127 onLoad: function() { 128 wc_eftsecure_form.unblock(); 129 }, 130 onComplete: function(data) { 131 eftSec.checkout.hideFrame(); 132 wc_eftsecure_form.eftsecure_submit = true; 133 var $form = wc_eftsecure_form.form; 134 if ($form.find( 'input.eftsecure_transaction_id' ).length > 0) { 135 $form.find('input.eftsecure_transaction_id').remove(); 136 } 137 $form.append( '<input type="hidden" class="eftsecure_transaction_id" name="eftsecure_transaction_id" value="' + data.transaction_id + '"/>' ); 138 $form.submit(); 139 } 140 }); 141 142 } else if ('failure' === result.result) { 143 throw 'Result failure'; 144 } else { 145 throw 'Invalid response'; 146 } 147 } catch (err) { 148 // Reload page 149 if (true === result.reload) { 150 window.location.reload(); 151 return; 152 } 153 154 // Trigger update in case we need a fresh nonce 155 if (true === result.refresh) { 156 jQuery(document.body).trigger('update_checkout'); 157 } 158 159 // Add new errors 160 if (result.messages) { 161 window.wc_checkout_form.submit_error(result.messages); 162 } else { 163 window.wc_checkout_form.submit_error('<div class="woocommerce-error">' + wc_checkout_params.i18n_checkout_error + '</div>'); 164 } 116 if (window.eftPaymentKey != null) { 117 console.log('Initiating transaction existing transaction'); 118 eftSec.checkout.init({ 119 paymentKey: window.eftPaymentKey, 120 onLoad: function () { 121 wc_eftsecure_form.unblock(); 122 }, 123 onComplete: function (data) { 124 console.log('onComplete', data); 125 console.log('form', wc_eftsecure_form); 126 try { 127 eftSec.checkout.hideFrame(); 128 } 129 catch (e) { 130 console.log(e); 131 } 132 wc_eftsecure_form.eftsecure_submit = true; 133 var $form = wc_eftsecure_form.form; 134 if ($form.find('input.eftsecure_transaction_id').length > 0) { 135 $form.find('input.eftsecure_transaction_id').remove(); 136 } 137 $form.append('<input type="hidden" class="eftsecure_transaction_id" name="eftsecure_transaction_id" value="' + data.transaction_id + '"/>'); 138 $form.submit(); 165 139 } 166 }, 167 error: function(jqXHR, textStatus, errorThrown) { 168 wc_checkout_form.submit_error('<div class="woocommerce-error">' + errorThrown + '</div>'); 169 } 170 }); 140 }); 141 } 142 else { 143 jQuery.ajax({ 144 type: 'POST', 145 url: wc_checkout_params.checkout_url, 146 data: jQuery('form.checkout').serialize(), 147 dataType: 'json', 148 success: function (result) { 149 try { 150 if ('success' === result.result) { 151 window.eftPaymentKey = result.paymentKey; 152 console.log(window.eftPaymentKey); 153 console.log('Initiating transaction first time'); 154 eftSec.checkout.init({ 155 paymentKey: window.eftPaymentKey, 156 onLoad: function () { 157 wc_eftsecure_form.unblock(); 158 }, 159 onComplete: function (data) { 160 eftSec.checkout.hideFrame(); 161 wc_eftsecure_form.eftsecure_submit = true; 162 var $form = wc_eftsecure_form.form; 163 if ($form.find('input.eftsecure_transaction_id').length > 0) { 164 $form.find('input.eftsecure_transaction_id').remove(); 165 } 166 $form.append('<input type="hidden" class="eftsecure_transaction_id" name="eftsecure_transaction_id" value="' + data.transaction_id + '"/>'); 167 $form.submit(); 168 } 169 }); 170 171 } else if ('failure' === result.result) { 172 throw 'Result failure'; 173 } else { 174 throw 'Invalid response'; 175 } 176 } catch (err) { 177 // Reload page 178 if (true === result.reload) { 179 window.location.reload(); 180 return; 181 } 182 183 // Trigger update in case we need a fresh nonce 184 if (true === result.refresh) { 185 jQuery(document.body).trigger('update_checkout'); 186 } 187 188 // Add new errors 189 if (result.messages) { 190 window.wc_checkout_form.submit_error(result.messages); 191 } else { 192 window.wc_checkout_form.submit_error('<div class="woocommerce-error">' + wc_checkout_params.i18n_checkout_error + '</div>'); 193 } 194 } 195 }, 196 error: function (jqXHR, textStatus, errorThrown) { 197 wc_checkout_form.submit_error('<div class="woocommerce-error">' + errorThrown + '</div>'); 198 } 199 }); 200 } 171 201 172 202 wc_eftsecure_form.block(); -
woo-eftsecure-gateway/tags/1.0.5/changelog.txt
r2307714 r2309547 18 18 = 1.0.4 - 2020.05.16 = 19 19 * Woocommerce 3.X support 20 21 = 1.0.5 - 2020.05.21 = 22 * Checkout bug fixes -
woo-eftsecure-gateway/tags/1.0.5/includes/class-wc-gateway-eftsecure.php
r2307714 r2309547 332 332 add_post_meta( $this->get_order_id($order), '_transaction_id', $response->id, true ); 333 333 334 $order->add_order_note(sprintf( __( 'EFTsecure charge complete (Transaction ID: %s)', 'woocommerce-gateway- stripe' ), $response->id ));334 $order->add_order_note(sprintf( __( 'EFTsecure charge complete (Transaction ID: %s)', 'woocommerce-gateway-eftsecure' ), $response->id )); 335 335 336 336 if ( $order->has_status( array( 'pending', 'failed' ) ) ) { … … 383 383 384 384 WC_Eftsecure::log("Info: Begin processing IPN for payment for order $order_id for the amount of {$order->get_total()}"); 385 $order->add_order_note(sprintf(__('EFTsecure IPN received : %s', 'woocommerce-gateway- stripe'), (($response->successful) ? 'SUCCESS' : 'FAILED')));385 $order->add_order_note(sprintf(__('EFTsecure IPN received : %s', 'woocommerce-gateway-eftsecure'), (($response->successful) ? 'SUCCESS' : 'FAILED'))); 386 386 387 387 WC_Eftsecure::log("Processing response: " . print_r($response, true)); … … 408 408 409 409 $order->payment_complete(); 410 $order->add_order_note(sprintf(__('EFTsecure charge complete (Transaction ID: %s)', 'woocommerce-gateway- stripe'), $response->id));410 $order->add_order_note(sprintf(__('EFTsecure charge complete (Transaction ID: %s)', 'woocommerce-gateway-eftsecure'), $response->id)); 411 411 412 412 WC_Eftsecure::log("Successful payment: $response->id"); … … 416 416 $order->add_order_note(sprintf(__('EFTsecure Transaction Failed: (%s)', 'woocommerce-gateway-eftsecure'), $response->reason)); 417 417 } 418 } else { 419 $order->add_order_note(sprintf(__('Transaction updated .. ignoring IPN.', 'woocommerce-gateway-eftsecure'))); 418 420 } 419 421 -
woo-eftsecure-gateway/tags/1.0.5/readme.txt
r2307742 r2309547 1 1 === Woocommerce EFTsecure gateway === 2 2 Tags: eft,eftsecure,woocommerce 3 Tested up to: 5.4.13 Tested up to: 4.7.5 4 4 License: MIT 5 5 License URI: https://github.com/EFTsecure/woocommerce-gateway-eftsecure/blob/master/LICENSE … … 21 21 22 22 == Changelog == 23 = 1.0.5 - 2020.05.21 = 24 * Checkout bug fixes 25 23 26 = 1.0.4 - 2020.05.16 = 24 27 * Woocommerce 3.X support -
woo-eftsecure-gateway/tags/1.0.5/woocommerce-gateway-eftsecure.php
r2307714 r2309547 5 5 * Author: CallPay 6 6 * Author URI: http://www.eftsecure.co.za/ 7 * Version: 1.0. 47 * Version: 1.0.5 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. 4' );21 define( 'WC_EFTSECURE_VERSION', '1.0.5' ); 22 22 define( 'WC_EFTSECURE_MIN_WC_VER', '2.2.0' ); 23 23 define( 'WC_EFTSECURE_MAIN_FILE', __FILE__ ); -
woo-eftsecure-gateway/trunk/assets/js/eftsecure_checkout.js
r1691756 r2309547 1 1 jQuery( function( $ ) { 2 2 'use strict'; 3 4 window.eftPaymentKey = null; 3 5 4 6 window.wc_checkout_form = { … … 112 114 e.preventDefault(); 113 115 114 jQuery.ajax({ 115 type: 'POST', 116 url: wc_checkout_params.checkout_url, 117 data: jQuery('form.checkout').serialize(), 118 dataType: 'json', 119 success: function(result) { 120 try { 121 if ('success' === result.result) { 122 var $paymentKey = result.paymentKey; 123 console.log($paymentKey); 124 console.log('Initiating transaction'); 125 eftSec.checkout.init({ 126 paymentKey: $paymentKey, 127 onLoad: function() { 128 wc_eftsecure_form.unblock(); 129 }, 130 onComplete: function(data) { 131 eftSec.checkout.hideFrame(); 132 wc_eftsecure_form.eftsecure_submit = true; 133 var $form = wc_eftsecure_form.form; 134 if ($form.find( 'input.eftsecure_transaction_id' ).length > 0) { 135 $form.find('input.eftsecure_transaction_id').remove(); 136 } 137 $form.append( '<input type="hidden" class="eftsecure_transaction_id" name="eftsecure_transaction_id" value="' + data.transaction_id + '"/>' ); 138 $form.submit(); 139 } 140 }); 141 142 } else if ('failure' === result.result) { 143 throw 'Result failure'; 144 } else { 145 throw 'Invalid response'; 146 } 147 } catch (err) { 148 // Reload page 149 if (true === result.reload) { 150 window.location.reload(); 151 return; 152 } 153 154 // Trigger update in case we need a fresh nonce 155 if (true === result.refresh) { 156 jQuery(document.body).trigger('update_checkout'); 157 } 158 159 // Add new errors 160 if (result.messages) { 161 window.wc_checkout_form.submit_error(result.messages); 162 } else { 163 window.wc_checkout_form.submit_error('<div class="woocommerce-error">' + wc_checkout_params.i18n_checkout_error + '</div>'); 164 } 116 if (window.eftPaymentKey != null) { 117 console.log('Initiating transaction existing transaction'); 118 eftSec.checkout.init({ 119 paymentKey: window.eftPaymentKey, 120 onLoad: function () { 121 wc_eftsecure_form.unblock(); 122 }, 123 onComplete: function (data) { 124 console.log('onComplete', data); 125 console.log('form', wc_eftsecure_form); 126 try { 127 eftSec.checkout.hideFrame(); 128 } 129 catch (e) { 130 console.log(e); 131 } 132 wc_eftsecure_form.eftsecure_submit = true; 133 var $form = wc_eftsecure_form.form; 134 if ($form.find('input.eftsecure_transaction_id').length > 0) { 135 $form.find('input.eftsecure_transaction_id').remove(); 136 } 137 $form.append('<input type="hidden" class="eftsecure_transaction_id" name="eftsecure_transaction_id" value="' + data.transaction_id + '"/>'); 138 $form.submit(); 165 139 } 166 }, 167 error: function(jqXHR, textStatus, errorThrown) { 168 wc_checkout_form.submit_error('<div class="woocommerce-error">' + errorThrown + '</div>'); 169 } 170 }); 140 }); 141 } 142 else { 143 jQuery.ajax({ 144 type: 'POST', 145 url: wc_checkout_params.checkout_url, 146 data: jQuery('form.checkout').serialize(), 147 dataType: 'json', 148 success: function (result) { 149 try { 150 if ('success' === result.result) { 151 window.eftPaymentKey = result.paymentKey; 152 console.log(window.eftPaymentKey); 153 console.log('Initiating transaction first time'); 154 eftSec.checkout.init({ 155 paymentKey: window.eftPaymentKey, 156 onLoad: function () { 157 wc_eftsecure_form.unblock(); 158 }, 159 onComplete: function (data) { 160 eftSec.checkout.hideFrame(); 161 wc_eftsecure_form.eftsecure_submit = true; 162 var $form = wc_eftsecure_form.form; 163 if ($form.find('input.eftsecure_transaction_id').length > 0) { 164 $form.find('input.eftsecure_transaction_id').remove(); 165 } 166 $form.append('<input type="hidden" class="eftsecure_transaction_id" name="eftsecure_transaction_id" value="' + data.transaction_id + '"/>'); 167 $form.submit(); 168 } 169 }); 170 171 } else if ('failure' === result.result) { 172 throw 'Result failure'; 173 } else { 174 throw 'Invalid response'; 175 } 176 } catch (err) { 177 // Reload page 178 if (true === result.reload) { 179 window.location.reload(); 180 return; 181 } 182 183 // Trigger update in case we need a fresh nonce 184 if (true === result.refresh) { 185 jQuery(document.body).trigger('update_checkout'); 186 } 187 188 // Add new errors 189 if (result.messages) { 190 window.wc_checkout_form.submit_error(result.messages); 191 } else { 192 window.wc_checkout_form.submit_error('<div class="woocommerce-error">' + wc_checkout_params.i18n_checkout_error + '</div>'); 193 } 194 } 195 }, 196 error: function (jqXHR, textStatus, errorThrown) { 197 wc_checkout_form.submit_error('<div class="woocommerce-error">' + errorThrown + '</div>'); 198 } 199 }); 200 } 171 201 172 202 wc_eftsecure_form.block(); -
woo-eftsecure-gateway/trunk/changelog.txt
r2307714 r2309547 18 18 = 1.0.4 - 2020.05.16 = 19 19 * Woocommerce 3.X support 20 21 = 1.0.5 - 2020.05.21 = 22 * Checkout bug fixes -
woo-eftsecure-gateway/trunk/includes/class-wc-gateway-eftsecure.php
r2307714 r2309547 332 332 add_post_meta( $this->get_order_id($order), '_transaction_id', $response->id, true ); 333 333 334 $order->add_order_note(sprintf( __( 'EFTsecure charge complete (Transaction ID: %s)', 'woocommerce-gateway- stripe' ), $response->id ));334 $order->add_order_note(sprintf( __( 'EFTsecure charge complete (Transaction ID: %s)', 'woocommerce-gateway-eftsecure' ), $response->id )); 335 335 336 336 if ( $order->has_status( array( 'pending', 'failed' ) ) ) { … … 383 383 384 384 WC_Eftsecure::log("Info: Begin processing IPN for payment for order $order_id for the amount of {$order->get_total()}"); 385 $order->add_order_note(sprintf(__('EFTsecure IPN received : %s', 'woocommerce-gateway- stripe'), (($response->successful) ? 'SUCCESS' : 'FAILED')));385 $order->add_order_note(sprintf(__('EFTsecure IPN received : %s', 'woocommerce-gateway-eftsecure'), (($response->successful) ? 'SUCCESS' : 'FAILED'))); 386 386 387 387 WC_Eftsecure::log("Processing response: " . print_r($response, true)); … … 408 408 409 409 $order->payment_complete(); 410 $order->add_order_note(sprintf(__('EFTsecure charge complete (Transaction ID: %s)', 'woocommerce-gateway- stripe'), $response->id));410 $order->add_order_note(sprintf(__('EFTsecure charge complete (Transaction ID: %s)', 'woocommerce-gateway-eftsecure'), $response->id)); 411 411 412 412 WC_Eftsecure::log("Successful payment: $response->id"); … … 416 416 $order->add_order_note(sprintf(__('EFTsecure Transaction Failed: (%s)', 'woocommerce-gateway-eftsecure'), $response->reason)); 417 417 } 418 } else { 419 $order->add_order_note(sprintf(__('Transaction updated .. ignoring IPN.', 'woocommerce-gateway-eftsecure'))); 418 420 } 419 421 -
woo-eftsecure-gateway/trunk/readme.txt
r2307742 r2309547 1 1 === Woocommerce EFTsecure gateway === 2 2 Tags: eft,eftsecure,woocommerce 3 Tested up to: 5.4.13 Tested up to: 4.7.5 4 4 License: MIT 5 5 License URI: https://github.com/EFTsecure/woocommerce-gateway-eftsecure/blob/master/LICENSE … … 21 21 22 22 == Changelog == 23 = 1.0.5 - 2020.05.21 = 24 * Checkout bug fixes 25 23 26 = 1.0.4 - 2020.05.16 = 24 27 * Woocommerce 3.X support -
woo-eftsecure-gateway/trunk/woocommerce-gateway-eftsecure.php
r2307714 r2309547 5 5 * Author: CallPay 6 6 * Author URI: http://www.eftsecure.co.za/ 7 * Version: 1.0. 47 * Version: 1.0.5 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. 4' );21 define( 'WC_EFTSECURE_VERSION', '1.0.5' ); 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.