#stonecold
1 messages · Page 1 of 1 (latest)
Hi there!
I'm not sure I understand. You want to create a Checkout Session where the card is pre-filled?
Yes but customer's choice card
What do you mean by "customer's choice card"?
I mean if customer have 3 cards and customer want to pay with 2nd card
This is explained here https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
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.
So you cannot decide which card will be prefilled (it's the last one used). And it only works if the card has an email/name/address saved.
But is there any way to achive this?
With Checkout Session no. But if you already have a card saved for the customer, you don't need to use Checkout Session. You could directly create a PaymentIntent to charge the card you want.
But how user see payment page without creating session checkout?
That's completely up to you to design yourslef. Like for example:
- You display all the payment method that the customer has saved, so the customer can select the one they want to use
- Once they select one, create the PaymentIntent with the correct payment method, and confirm the PaymentIntent on the frontend with https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-attached
Okay