#dorian
1 messages · Page 1 of 1 (latest)
Hi there, no the ID won't be changed. But I don't don't quite understand what you are trying to do, can you elaborate?
Im following these instructions: https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=checkout#retrieve-setup-intent
Was recommended by a fellow moderator on here
Having our custmers setup a payment method that we will charge on a monthly basis for a varying amount that will be calcualted by our app
I am going to save the setup_intent ID when they do they setup, but won't charge them until a later date
So was wondering if the setup_intent ID will still be valid at that time
Does that make sense @carmine citrus ?
You should use the payment_method of the SetupIntent to charge your customer, not the SetupIntent itself.
And neither SetupIntent ID nor PaymentMethod ID would change.
Right ok. I havent gotten that far yet. But I need the setup_intent ID to retrieve the payment_method ID, correct?
Thats what those insturctions say
PaymentMethod ID wont change even if they change their payment method?
Yes, you can retrieve the SetupIntent and get the PaymentMethod, but you should save the PaymentMethod ID instead of the SetupIntent ID
OK
How would your user change the PaymentMethod? are you talking about another PaymentMethod collected with a different SetupIntent?
Through the Customer Portal
Which we are exposing in our app
Using their stripe customer ID
OK then it'll be a new PaymentMethod with a different ID, and this PaymentMethod has no relationship with the earlier SetupIntent.
Ah ok. So when I go to charge them, I need to somehow find out what their current PaymentMethod is?
There's no "current payment method", you specify which payment method you want use when creating a charge.
Mmmm ok I dont understand. I will test it all out and come back with any quesitons. Thanks.
https://stripe.com/docs/api/payment_methods/customer_list#list_customer_payment_methods you can use this API to retrieve the payment methods that are attached to a customer.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
OK thanks
Our charging process will happen in the backend without any customer interaction. If I find they have multiple payment methods, would I just have to arbitrarily pick one? There is a concept of a "default" payment method that a customer can set, isnt there?
There's no default payment method for one-off charges. However, there's a invoice_settings.default_payment_method , and that's for invoices and subscription (https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method).
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
For one-off charges, you can decide which payment_method to use, or you ask your customer to pick one and save it as the default payment_method in your own DB.
Yup, that's the invoice_settings.default_payment_method that I mentioned earlier.
When you create a one-off off-session charge, you always need to specify the payment_method ID when creating a PaymentIntent.
Happy to help
How do I save this whole thread offline?
I don't know if there's an option to export thread from discord.