mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
phpcs
This commit is contained in:
parent
fda949fac8
commit
dd0f12a29f
7 changed files with 17 additions and 17 deletions
|
@ -30,7 +30,7 @@ class CartActionHandler {
|
|||
|
||||
return {
|
||||
createOrder,
|
||||
onApprove: onApprove(this),
|
||||
onApprove: onApprove(this, this.errorHandler),
|
||||
onError: (error) => {
|
||||
this.errorHandler.message(error);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ class CheckoutActionHandler {
|
|||
}
|
||||
return {
|
||||
createOrder,
|
||||
onApprove:onApprove(this),
|
||||
onApprove:onApprove(this, this.errorHandler),
|
||||
onError: (error) => {
|
||||
this.errorHandler.message(error);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class SingleProductActionHandler {
|
|||
|
||||
return {
|
||||
createOrder: this.createOrder(),
|
||||
onApprove: onApprove(this),
|
||||
onApprove: onApprove(this, this.errorHandler),
|
||||
onError: (error) => {
|
||||
this.errorHandler.message(error);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const onApprove = (context) => {
|
||||
const onApprove = (context, errorHandler) => {
|
||||
return (data, actions) => {
|
||||
return fetch(context.config.ajax.approve_order.endpoint, {
|
||||
method: 'POST',
|
||||
|
@ -10,7 +10,8 @@ const onApprove = (context) => {
|
|||
return res.json();
|
||||
}).then((data)=>{
|
||||
if (!data.success) {
|
||||
throw Error(data.data);
|
||||
errorHandler.message(data.data);
|
||||
throw new Error(data.data);
|
||||
}
|
||||
location.href = context.config.redirect;
|
||||
});
|
||||
|
|
|
@ -10,7 +10,8 @@ const onApprove = (context) => {
|
|||
return res.json();
|
||||
}).then((data)=>{
|
||||
if (!data.success) {
|
||||
throw Error(data.data);
|
||||
errorHandler.message(data.data);
|
||||
throw new Error(data.data);
|
||||
}
|
||||
document.querySelector('#place_order').click()
|
||||
});
|
||||
|
|
|
@ -47,15 +47,6 @@ class CreditCardRenderer {
|
|||
contingencies: ['3D_SECURE']
|
||||
}).then((payload) => {
|
||||
payload.orderID = payload.orderId;
|
||||
console.log(payload);
|
||||
|
||||
if (payload.liabilityShift === 'POSSIBLE') {
|
||||
return contextConfig.onApprove(payload);
|
||||
}
|
||||
if (payload.liabilityShift) {
|
||||
return contextConfig.onApprove(payload);
|
||||
}
|
||||
|
||||
return contextConfig.onApprove(payload);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue