Skip to content

Commit

Permalink
Add error handling for submit
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjopa committed Oct 4, 2023
1 parent 7564b3f commit 14f6d98
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion advanced-integration/beta/client/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ if (cardField.isEligible()) {
document
.getElementById("multi-card-field-button")
.addEventListener("click", () => {
cardField.submit();
cardField.submit().catch((error) => {
resultMessage(
`Sorry, your transaction could not be processed...<br><br>${error}`,
);
});
});
} else {
// Hides card fields if the merchant isn't eligible
Expand Down

0 comments on commit 14f6d98

Please sign in to comment.