#hamid-checkout-creation
1 messages ยท Page 1 of 1 (latest)
๐ moving your code here, what's your question?
payment_method_types: %w[card],
mode: 'setup',
customer: retrieve_stripe_customer_id,
billing_address_collection: 'required',
success_url: root_url + "success?session_id={CHECKOUT_SESSION_ID}&forward_to=#{@forward_to}",
cancel_url: new_checkout_url
)```
Thanks for responding
I need to know a parameter so that when user directed to stripe checkout page, his last used card should be auto populated
I remember there is some parameter
for that, not sure 100%
I believe you'd need pass the customer ID, however the catch is that the customer would need atleast one successful payment in order for checkout to prepopulate the payment method.
also, I don't know if we pre-populate in setup mode
I know that we do in payment mode
see in above code
I am passing customer ID as well
your this point is valid that atlease one payment should be successfull, but i believe payment was successfull, therefore my client asked that card is not saving
can you confirm about mode thing? please?
I'd need a little more time to test it on my end since I'm juggling between a few threads at the moment
@hidden bronze When the original card was processed, was it saved to customers Stripe account? I can confirm this works properly when just passing in the Customer value as long as the customer has a valid Card payment method on their Stripe account.
In a setup mode, we don't prefil the payment method as the idea is that you're saving a new payment method for a later use
but I need payment method for late use
as well as
saved CC
how i can achieve?
@dark willow any ideaa?
because we charge customer later on
hold on, I'm confused.
you want to save customer payment details for later use by pre-filling the payment method? That doesn't make any sense.
If you're thinking about setup_future_usage then that only works with payment intents in payment mode
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage
I'm sorry @wise condor. I didn't notice he was in setup mode. you're correct
So that imeans if ill use payment mode setup(which is payments for future)
I can not save CCs
and if ill use payment mode payment
you can save the cards for later use but you can't pre-populate it while in the process of saving
then cc will be populated automatically and no need to pass any
parameter
yea we are saving payment intents to charge later
so we can not prepopulated as per payment mode?
sorry, I don't understand your question. Can you try to rephrase it?
sure
while creating checkout session
we are passing
mode: 'setup',
because we need to charge customer later on
and you are saying for above mode
you don't allow cc to pre-populate
For mode: 'payment',
cc can be pre-populated
I hope this clears
and you are saying for above mode
you don't allow cc to pre-populate
that's correct
For mode: 'payment',
cc can be pre-populated
yes
there's more information about that here
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout#handling-existing-customers
thanks
last question
how i can email this whole thread to my email
to show this to my client
To be honest, I have no idea. I'm not a pro-discord user.
You may want to google it.