Display error message for when error on hosted fields approve payment

This commit is contained in:
dinamiko 2022-02-28 10:06:05 +01:00
parent 292ba9de3c
commit 89392e43bd

View file

@ -216,8 +216,11 @@ class CreditCardRenderer {
this.spinner.unblock();
return contextConfig.onApprove(payload);
}).catch(err => {
console.error(err);
this.spinner.unblock();
this.errorHandler.clear();
if (err.details.length > 0) {
this.errorHandler.message(err.details.map(d => `${d.issue} ${d.description}`).join('<br/>'), true);
}
});
} else {
this.spinner.unblock();