#supreeth_code
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/1370464340867547218
đ 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.
- supreeth_code, 6 days ago, 3 messages
You can find the payment methods available and their enablement in your Dashboard: https://dashboard.stripe.com/test/settings/payment_methods > Click on the Default payment configuration
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Redirect based payment methods will require customer to complete the additional action
Is your customer in session to complete the additional action?
Customer will not be in session, we send the setupintent secret to the UI and the UI uses stripe SDK to take payment method details
How do you take the payment method details when the customer is not in session to fill up those information?
sorry, what I meant is we use stripe SDK to take payment method, and it is initially authorized to 0$ as it is a setup intent.
We get a webhook callback from stripe, and then the backend code goes and creates the paymentintent to authorize a hold
Is there any reason why you use the Setup Intent to collect the payment method details first, then charge to the customer later? If both steps happen at the same time, you can use Payment Intent with authorising a hold to collect and save the payment method details in a single step: https://docs.stripe.com/payments/save-during-payment
can this be done from the UI ?
ah, I see instead of pass the setup intent secret to the UI, I create a paymentIntent and send that secret ?
so that UI can complete on-session payment including redirects ?
Yes, that's right!
In this case, this will also take care of redirect based payment methods while customer is in session, save payment method and charge the payment using one Payment Intent
yeah makes sense
I had a follow up question
how does this work if we want to charge the payment method of the customer again for the future invoices ?
If you use Invoice API to create an invoice, the saved payment method (pm_123) can be set in default_payment_method field: https://docs.stripe.com/api/invoices/create?api-version=2025-04-30.basil#create_invoice-default_payment_method
If you use Payment Intent API for one-time payment, the saved payment method can be set in payment_method field as explained in: https://docs.stripe.com/payments/save-during-payment#charge-saved-payment-method
does this work for redirect based payment methods as well ?
doesnt it need to be redirected and authorized again ?
This will work for redirect based payment method that support saving it for future usage. In most of the time, customer will not be prompted to perform additional action since Stripe will inform the issuer that the customer is not present when setting off_session: true. However, there will still be rare case that the issuer may want to additional authentication. Your system should bring the customer back to perform additional action.
Are you referring to Payment Intent or Invoice API?
both I guess
Do I need to set for the initial Payment Intent I create ?
To get payment method added
off_session is to tell Stripe and issuer whether the customer is present. Since the customer is present during the initial payment flow, you shouldn't set this unless customer is not around.
For Payment Intent API, off_session can be found in: https://docs.stripe.com/api/payment_intents/create?api-version=2025-04-30.preview#create_payment_intent-off_session
For Invoice API, off_session is not supported.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ohh
if we create invoices and want to charge the customer, then how do we go about that ?
using redirect-based cards
hey there, just stepping in for river as they need to step away -- catching up
Are you referring to the first payment, with details collected via payment element?
no worries, thanks for stepping in!
I am talking about invoices that we will generate later to be charged to the stored payment method of the customer
do we need to set anything specific in that ?
considering that there will be redirect-based cards
If you already collected the payment details and a mandate for off-session usage, you can use the saved payment method to pay the invoice.
ok
You can either have this set to happen automatically by configuring the customer invoice_setting.default_payment_method and using collection_method=charge_automatically on the Invoices, or you can manually provide the payment_method to /pay the Invoice:
https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method
https://docs.stripe.com/api/invoices/pay#pay_invoice-payment_method
then to clarify:
- When I create PaymentIntent for the first time, I set
offsession: trueand send the secret to the UI, UI sends the payment method to stripe. And PaymentMethod gets added. - When I need to charge customer using invoices in the future, I just set the
default_payment_methodfor the customer to this payment method.
Does this look correct ?
I set offsession: true
Not quite -- you likely want to setsetup_future_usage: 'off_session'
Assuming you're collecting the payment details for the first time with a standalone payment intent
yes