I notice you’re specifying a Payment Method while creating a Setup Intent. This is perfectly valid if you want to re-authenticate or re-verify a pre-existing Payment Method for future off-session usage. However, the goal when redisplaying previously saved Payment Methods is usually to make a Payment with said Payment Methods. If that is the case here I would suggest using a Payment Intent instead.
In either case, you’ll need to create a Customer Session[0] in addition to the Payment/Setup Intent and pass both the Intent’s client secret and the Customer Session client secret to the Payment Element. [1] This is alluded to in the documentation you cited where it talks about configuring the Customer Session for allow_redisplay="unspecified"
. [2] A Customer Session is needed regardless, even if you only want to show Payment Methods with allow_redisplay=”always”
. This admittedly could have been stated more clearly but is outlined in further detail elsewhere in the documentation. I’d recommend following the code example in my first citation for more clarity. [1]
If the Payment Element still isn’t populating with saved card information after providing a Customer Session client secret, I’d advise double checking what value has been set for allow_redisplay
on the Payment Method. You mentioned that it was set to true
but the available options are always
, unspecified
, and limited
.[3] You’ll want to make sure this value aligns with what is set in the Customer Sessions payment_method_allow_redisplay_filters
array. [4]
To review:
Consider your use of Setup Intents and determine if a Payment Intent would make more sense for your current use case.
Make sure you are passing a Customer Session client secret to the Payment Element.
Ensure the Payment Methods allow_redisplay
value is among the values listed in the Customer Sessions payment_method_allow_redisplay_filters
array.
Please let me know if there are any points I can help clarify.
[0]https://docs.stripe.com/api/customer_sessions
[1]https://docs.stripe.com/payments/save-during-payment#enable-saving-the-payment-method-in-the-payment-element
[2]https://docs.stripe.com/payments/save-customer-payment-methods#display-existing-saved-payment-methods
[3]https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay