File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed
packages/clerk-js/src/ui/components/PaymentSources Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @clerk/clerk-js ' : patch
3
+ ---
4
+
5
+ Fix Stripe Elements error handling
Original file line number Diff line number Diff line change @@ -246,18 +246,18 @@ const AddPaymentSourceForm = ({ children }: PropsWithChildren) => {
246
246
card . setLoading ( ) ;
247
247
card . setError ( undefined ) ;
248
248
249
- try {
250
- const { setupIntent, error } = await stripe . confirmSetup ( {
251
- elements,
252
- confirmParams : {
253
- return_url : '' , // TODO(@COMMERCE): need to figure this out
254
- } ,
255
- redirect : 'if_required' ,
256
- } ) ;
257
- if ( error ) {
258
- return ; // just return, since stripe will handle the error
259
- }
249
+ const { setupIntent, error } = await stripe . confirmSetup ( {
250
+ elements,
251
+ confirmParams : {
252
+ return_url : '' , // TODO(@COMMERCE): need to figure this out
253
+ } ,
254
+ redirect : 'if_required' ,
255
+ } ) ;
256
+ if ( error ) {
257
+ return ; // just return, since stripe will handle the error
258
+ }
260
259
260
+ try {
261
261
await onSuccess ( { stripeSetupIntent : setupIntent } ) ;
262
262
} catch ( error ) {
263
263
void handleError ( error , [ ] , card . setError ) ;
You can’t perform that action at this time.
0 commit comments