#vaibhav-checkout
1 messages · Page 1 of 1 (latest)
👋 Happy to help
Currently, Checkout Session doesn't show all the saved cards.
ID of an existing Customer, if one exists. In payment mode, the customer’s most recent card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page. In subscription mode, the customer’s default payment method will be used if it’s a card, and otherwise the most recent card will be used. A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer’s card details. [0]
[0] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
If you would like to display all saved methods, it's recommended to build your own UI and retrieve the saved payment methods of a customer: https://stripe.com/docs/api/payment_methods/customer
For new payment method collection, I'd suggest using Payment Element: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
Also I want to use hold flow, can I use hold flow using Prebuilt checkout page flow.
Could you explain what hold flow is and its use case?
I want to hold some amount and after sometime based on some conditions I can release or capture the payment.
payment_intent_data.capture_method can be set to manual to hold the fund: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-capture_method
Then use capture or cancel the fund on PaymentIntent:
Is Custom payment flow (https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements) show all the saved cards?
It doesn't show all saved cards. Displaying all saved cards will be built with your own UI
Then how we get the all saved cards for a customer and for deleting also we have to handle it on our own UI?
in that case we have to take the card details on our own UI for new card?
- To get customer's saved payment methods, Customer's PaymentMethod Retrieval API should be used: https://stripe.com/docs/api/payment_methods/customer
- To removed customer's saved payment method, it'll be detaching PaymentMethod API: https://stripe.com/docs/api/payment_methods/detach
And yes, you'll can take new card details with Payment Element (pre-built UI by Stripe): https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
if we want to pay using saved cards then it will happen on Payment Element (pre-built UI by Stripe) or we have to handle it at our end and make a call to our backend API which is internally calling Stripe methods at backend?
If a saved card is used, then it'll be handled by making a call to your backend to create a PaymentIntent with payment methods attached: https://stripe.com/docs/payments/save-during-payment?platform=web#charge-saved-payment-method