Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brave-mammals-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/ui': patch
---

Fix the payment method form getting stuck in a loading state after a failed card setup. Non-validation errors such as 3DS authentication failures are now displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,14 @@ const AddPaymentMethodForm = ({ children }: PropsWithChildren) => {

const { data, error } = await submitPaymentElement();
if (error) {
return; // just return, since stripe will handle the error
card.setIdle();
// Validation errors are already rendered inline by Stripe's PaymentElement.
// Non-validation errors (e.g. 3DS authentication failure) are not surfaced by
// Stripe's UI, so we display them ourselves.
if (error.error.type !== 'validation_error') {
card.setError(error.error.message);
}
return;
}
try {
await onSuccess(data);
Expand Down
Loading