#dorian

1 messages · Page 1 of 1 (latest)

bitter shuttleBOT
carmine citrus
#

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?

spare cosmos
#

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 ?

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.

spare cosmos
#

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?

carmine citrus
#

Yes, you can retrieve the SetupIntent and get the PaymentMethod, but you should save the PaymentMethod ID instead of the SetupIntent ID

spare cosmos
#

OK

carmine citrus
#

How would your user change the PaymentMethod? are you talking about another PaymentMethod collected with a different SetupIntent?

spare cosmos
#

Through the Customer Portal

#

Which we are exposing in our app

#

Using their stripe customer ID

carmine citrus
#

OK then it'll be a new PaymentMethod with a different ID, and this PaymentMethod has no relationship with the earlier SetupIntent.

spare cosmos
#

Ah ok. So when I go to charge them, I need to somehow find out what their current PaymentMethod is?

carmine citrus
#

There's no "current payment method", you specify which payment method you want use when creating a charge.

spare cosmos
#

Mmmm ok I dont understand. I will test it all out and come back with any quesitons. Thanks.

carmine citrus
spare cosmos
#

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?

carmine citrus
#

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.

spare cosmos
#

Im seeing this 'set as default' option in the customer portal:

#

Make default

carmine citrus
#

Yup, that's the invoice_settings.default_payment_method that I mentioned earlier.

spare cosmos
#

Understood

#

OK thanks

carmine citrus
#

When you create a one-off off-session charge, you always need to specify the payment_method ID when creating a PaymentIntent.

spare cosmos
#

OK gotcha

#

Thank you very helpful

carmine citrus
#

Happy to help

spare cosmos
#

How do I save this whole thread offline?

carmine citrus
#

I don't know if there's an option to export thread from discord.