#kevinh_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1410211647364268032
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- kevinh_api, 15 minutes ago, 26 messages
- kevinh_api, 2 days ago, 27 messages
I use
$checkout_session = \Stripe\Checkout\Session::create(
And I know there is a button for the customer to save the payment method for me and themselves
My question is, can I force them to click the button to save the payment method or they won't be able to pay?
In the Checkout Session, set a restriction so that if the customer does not save their payment method, they cannot complete the payment.
You can't. What you can do instead is use setup_future_usage which will save the card regardless of whether they check a box (there isn't even a box on the page)
This only works in subscription mode right?
oh?!
Let's me try it now. Wait for me
they still need to click the button right?
That's Link, which is completely different concept
Sorry I assumed you were referring to this feature: https://docs.stripe.com/payments/checkout/save-during-payment?payment-ui=stripe-hosted#save-payment-methods-to-prefill-them-in-checkout
You can't require them to check that, no
What is it you're trying to do exactly?
Suppose I want to implement a two-step payment flow:
-
The customer pays the first time.
-
Stripe remembers the customer’s payment method.
-
At a future point in time, I can automatically charge them again.
How can I achieve this?
I want to handle this entirely within a Checkout Session.
I hope I can save the method without their click the button
This is the guide you want then. Ignore the checkbox on the page, that is enabled by Link which allows the customer to save the card to be used anywhere on Stripe network (other merchants, etc)
If you want to force the card saving for your re-use then use setup_future_usage. You'll get a reusable PM object you can use for future payments
I will try ti now. wait for me thank you
how do I do this
The link directly above
☝️
after I test pay, I saw this under a customer info in the stripe dashbaord.
Does this mean I can use this method to charge the customer in the future?
Yep, should work if you use the pm_xxx ID: https://docs.stripe.com/payments/save-during-payment#charge-saved-payment-method
this is great. Thank you!
No problem, glad I could help!