mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
make sure restart action exists
This commit is contained in:
parent
ec199d2bfc
commit
514619ed8d
1 changed files with 4 additions and 1 deletions
|
@ -11,7 +11,10 @@ const onApprove = (context, errorHandler) => {
|
|||
}).then((data)=>{
|
||||
if (!data.success) {
|
||||
errorHandler.message(data.data);
|
||||
return actions.restart();
|
||||
if (typeof actions.restart !== 'undefined') {
|
||||
return actions.restart();
|
||||
}
|
||||
throw new Error(data.data);
|
||||
}
|
||||
document.querySelector('#place_order').click()
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue