restart when onApprove fails

This commit is contained in:
David Remer 2020-07-16 12:16:06 +03:00
parent 077d97d8f7
commit ec680a7191
2 changed files with 2 additions and 2 deletions

View file

@ -11,7 +11,7 @@ const onApprove = (context, errorHandler) => {
}).then((data)=>{
if (!data.success) {
errorHandler.message(data.data);
throw new Error(data.data);
return actions.restart();
}
location.href = context.config.redirect;
});

View file

@ -11,7 +11,7 @@ const onApprove = (context) => {
}).then((data)=>{
if (!data.success) {
errorHandler.message(data.data);
throw new Error(data.data);
return actions.restart();
}
document.querySelector('#place_order').click()
});