Redirect to continuation when error happens

This commit is contained in:
Narek Zakarian 2024-07-18 20:15:39 +04:00
parent c3d46d89af
commit 15250e5a83
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -20,10 +20,7 @@ const onApprove = ( context, errorHandler ) => {
} )
.then( ( data ) => {
if ( ! data.success ) {
errorHandler.genericError();
return actions.restart().catch( ( err ) => {
errorHandler.genericError();
} );
location.href = context.config.redirect;
}
const orderReceivedUrl = data.data?.order_received_url;