Open davecosec opened 4 years ago
@davecosec did you work this out?
yeah, ended up editing the JS code after setting the repo to path @billythekid which is not ideal at all. Had to unminify web-payments.js then in the onToken
function in the post("pay", {...
call back
if(data.status == "fail"){
e.complete('fail');
alert('Payment failed, please try another method');
}else {
e.complete(data.status), state.onComplete.js && eval("const cwp = { number: '" + data.number + "' };" + state.onComplete.js), state.onComplete.redirect && (window.location = state.onComplete.redirect.replace("{number}", data.number))
}
@davecosec yeah not ideal to have to fork the repo and edit it but great to know it is possible. Would be nice to be able to pass the path as a property in the twig call or something.
Thanks so much for taking the time to respond.
is there a way to set the redirect on payment failure?