#matiullahpro
1 messages · Page 1 of 1 (latest)
Hello! Can you be more specific?
when user pay, I want to keep his card details on stripe for later use.
Then you should set payment_intent_data.setup_future_usage: off_session
I use it. its not working
'payment_intent_data' => ['metadata' => $data['metadata'], 'setup_future_usage'=>'off_session']
i applied it but its not working.
when i applied it. did not work. also remove other payment methods.
are you there?
Yup I'm here
I need you to be really specific - what do you see not working? Do you not see the payment method getting attached to the customer? Do you just not see it being prefilled?
yes
all other payment method removed after adding this line. card form was not prefilled.
only card method showing with blank fields.
Gotcha, so it's the prefilling that's not working like you expect
Based on you're code it doesn't look like you're passing a customer ID, just a customer email
We only prefill if you pass in an existing customer ID
its working but other methods are not showing anymore.
You'd want to click "change" in the UI to show the other payment method types again
its showing just last card details when i click on change method, still other payment method are not showing.
can you share the Checkout Session id?
what other payment method types are you expecting?
you'll need to turn on the payment method types you want to see in https://dashboard.stripe.com/test/settings/payment_methods
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
let me send you screentshot with and without setup_future_usage
kindly check screentshot with and without setup_future_usage
i'll need the checkout session id for both of those screenshots. I can't use the screenshot alone for troubleshooting
OK
cs_test_a16U8MckaJKC7nqriAuqzZUPJDxuuWocOsqiDvlcNWlAKpx3O3OwEW75Ym with setup_future_usage
cs_test_a16U8MckaJKC7nqriAuqzZUPJDxuuWocOsqiDvlcNWlAKpx3O3OwEW75Ym without setup_future_usage
taking a look at the original Checkout Session id that has setup_future_usage. Not every payment method supports saving it for future usage. When you use Automatic Payment Methods, we determine which payment methods are supported based on a variety of factors e.g. currency, setup for future usage, etc
EPS, Giropay, bancontact, and a variety of the other payment methods don't support setup for future usage as off-session
how can i enable other option alongwith this?
do you mean you want to support saving payment methods for future usage (if supported) otherwise, just offer it as a one-time payment option?
yes
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_method_options - pass in the setup_future_usage for each of the payment methods here. You can easily see which payment method supports future usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can you describe in more detail what you mean by a method through which user save multiple cards?
like I have a visa card, and also i have mastercard and few others. is there any way to store all of them for later use. let suppose i have to pay funds online. i just click on mastercard, next time visa card etc. so i don't have to fill form every time.