File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
packages/template-retail-react-app/app/pages/checkout/partials Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -522,16 +522,6 @@ const SFPaymentsSheet = forwardRef((props, ref) => {
522522 ( ) => transformPaymentMethodReferences ( customer , paymentConfig ) ,
523523 [ customer , paymentConfig ]
524524 )
525- // Stable key so we only re-init when SPM list actually changes.
526- const savedPaymentMethodsKey = useMemo (
527- ( ) =>
528- ( savedPaymentMethods ?? [ ] )
529- . map ( ( pm ) => pm ?. gatewayTokenId )
530- . filter ( Boolean )
531- . sort ( )
532- . join ( ',' ) ,
533- [ savedPaymentMethods ]
534- )
535525
536526 useEffect ( ( ) => {
537527 // Mount SFP only when all required data and DOM are ready; otherwise skip or wait for a later run.
@@ -599,14 +589,15 @@ const SFPaymentsSheet = forwardRef((props, ref) => {
599589 checkoutComponent . current ?. destroy ( )
600590 checkoutComponent . current = null
601591 }
592+ // Omit savedPaymentMethodsKey: init once with current SPM; re-initing when SPM list changes
593+ // causes Stripe/Adyen to complain.
602594 } , [
603595 isCustomerDataLoading ,
604596 sfp ,
605597 metadata ,
606598 containerElementRef . current ,
607599 paymentConfig ,
608- cardCaptureAutomatic ,
609- savedPaymentMethodsKey
600+ cardCaptureAutomatic
610601 ] )
611602
612603 useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments