Changeset 2708315
- Timestamp:
- 04/12/2022 03:47:10 AM (4 years ago)
- Location:
- pay-advantage/trunk
- Files:
-
- 3 edited
-
payadvantage.php (modified) (2 diffs)
-
public/js/common.js (modified) (1 diff)
-
public/js/credit-card-payment-wc.js (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pay-advantage/trunk/payadvantage.php
r2707743 r2708315 16 16 * Plugin URI: https://www.payadvantage.com.au/ 17 17 * Description: This plugin adds a payment gateway to Woo Commerce as well as a widget for credit card and BPay payments. 18 * Version: 3.1. 118 * Version: 3.1.2 19 19 * Author: Pay Advantage 20 20 * Author URI: https://www.payadvantage.com.au/ … … 30 30 * Current plugin version. 31 31 */ 32 define( 'PayAdvantagePluginVersion', '3.1. 1' );32 define( 'PayAdvantagePluginVersion', '3.1.2' ); 33 33 34 34 include( plugin_dir_path( __FILE__ ) . '/includes/payadvantage-files.php' ); -
pay-advantage/trunk/public/js/common.js
r2693371 r2708315 91 91 console.log(response); 92 92 reject(new Error(response.Messages.join(' '))); 93 } else { 94 resolve(response); 93 95 } 94 resolve(response);95 96 }, 96 97 error: function (response) { -
pay-advantage/trunk/public/js/credit-card-payment-wc.js
r2707743 r2708315 22 22 var $orderId = null; 23 23 var $paidNonce = null; 24 var isPaid = false;25 var isCancelled = false;26 24 27 25 /** … … 243 241 $orderId = result.orderId; 244 242 $paidNonce = result.paidNonce; 245 isPaid = false;246 isCancelled = false;247 243 payAdvantage.initialiseCreditCardCapture(); 244 payAdvantage.creditCardCapture.addEventListener('closing', creditCardDialogClosedHandler); 245 payAdvantage.creditCardCapture.addEventListener('cancel', creditCardCancelHandler ); 246 payAdvantage.creditCardCapture.addEventListener('paid', creditCardPaidHandler); 248 247 return payAdvantage.creditCardCapture.show(result.iframeUrl, result.payment, result.cardHolder); 249 248 }) 250 249 .then(function (result) { 251 payAdvantage.creditCardCapture.addEventListener('closing', creditCardDialogClosedHandler);252 payAdvantage.creditCardCapture.addEventListener('paid', creditCardPaidHandler);253 250 wc_stopProcessing(); 254 251 }) … … 271 268 */ 272 269 function creditCardDialogClosedHandler( event ) { 273 if (!isPaid && !isCancelled) { 274 event.preventDefault(); 275 creditCardCancelHandler(event); 276 return; 277 } 278 279 payAdvantage.creditCardCapture.removeEventListener( 'closing', creditCardDialogClosedHandler ); 280 payAdvantage.creditCardCapture.removeEventListener( 'paid', creditCardPaidHandler ); 270 payAdvantage.creditCardCapture.removeEventListener('closing', creditCardDialogClosedHandler ); 271 payAdvantage.creditCardCapture.removeEventListener('cancel', creditCardCancelHandler ); 272 payAdvantage.creditCardCapture.removeEventListener('paid', creditCardPaidHandler ); 281 273 282 274 if ($redirectOnCloseUrl) { … … 365 357 function creditCardPaidHandler(eventArgs) { 366 358 payAdvantage.creditCardCapture.setUserProcessing(true); 367 isPaid = true;368 359 payAdvantage.common.postAjax('pay_advantage_wc_mark_order_as_paid', 369 360 { … … 391 382 function creditCardCancelHandler(eventArgs) { 392 383 payAdvantage.creditCardCapture.setUserProcessing(true); 393 payAdvantage.common.postAjax('pay_advantage_wc_mark_order_as_cancelled',384 eventArgs.promise = payAdvantage.common.postAjax('pay_advantage_wc_mark_order_as_cancelled', 394 385 { 395 386 'orderid': $orderId, … … 398 389 .then(function (response) { 399 390 payAdvantage.creditCardCapture.setUserProcessing(false); 400 isCancelled = true;401 $redirectOnCloseUrl = response.redirect;402 payAdvantage.creditCardCapture.close();403 391 }) 404 392 .catch(function (error) { … … 406 394 payAdvantage.creditCardCapture.setUserProcessing(false); 407 395 payAdvantage.creditCardCapture.setError('There was an unexpected error updating the order to paid. Please contact the administrator of this site to update your order. ' + error.message); 408 $redirectOnCloseUrl = null;409 396 }); 410 397 }
Note: See TracChangeset
for help on using the changeset viewer.