Skip to content

Commit b7be456

Browse files
pbennett1-godaddywcole1-godaddy
authored andcommitted
fix: only show init error when brick fails to initialize, not on card validation errors
1 parent 9f0a846 commit b7be456

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • packages/react/src/components/checkout/payment/checkout-buttons/mercadopago

packages/react/src/components/checkout/payment/checkout-buttons/mercadopago/mercadopago.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,12 @@ export function MercadoPagoCheckoutButton() {
159159
}
160160
},
161161
onError: () => {
162-
setError(t.errors.failedToInitializePayment);
163-
setIsBrickReady(false);
162+
// Only treat as initialization failure if the brick never became ready.
163+
// Card validation errors are handled by the brick's own UI.
164+
if (!brickController) {
165+
setError(t.errors.failedToInitializePayment);
166+
setIsBrickReady(false);
167+
}
164168
},
165169
},
166170
});

0 commit comments

Comments
 (0)