#hamid-checkout-creation

1 messages ยท Page 1 of 1 (latest)

wise condor
#

๐Ÿ‘‹ 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
    )```
hidden bronze
#

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%

wise condor
#

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

hidden bronze
#

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?

wise condor
#

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
#

sure no issue

#

i am here ๐Ÿ™‚

#

take your time, thanks for the help

dark willow
#

@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.

wise condor
#

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

hidden bronze
#

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

wise condor
#

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.

dark willow
#

I'm sorry @wise condor. I didn't notice he was in setup mode. you're correct

hidden bronze
#

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

wise condor
#

you can save the cards for later use but you can't pre-populate it while in the process of saving

hidden bronze
#

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?

wise condor
#

sorry, I don't understand your question. Can you try to rephrase it?

hidden bronze
#

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

wise condor
hidden bronze
#

thanks

#

last question

#

how i can email this whole thread to my email

#

to show this to my client

wise condor
#

To be honest, I have no idea. I'm not a pro-discord user.
You may want to google it.