#icurrytheteam

1 messages · Page 1 of 1 (latest)

eager zealotBOT
dry jungle
#

Hi there!

mellow nexus
#

If a user has no saved payment methods, and they want to add a default payment method, how would they do that then?

dry jungle
#

Step 1: create a new PaymentMethod a SetupIntent and attach it on the customer
Step 2: set the customer.invoice_settings.default_payment_method with the new payment method

mellow nexus
#

How will I get the payment method id?

dry jungle
mellow nexus
#

Let me check, sorry. I didn't see it the first time.

dry jungle
#

No worries.

mellow nexus
#

So will it be an id of a payment method object, right?

dry jungle
#

The whole point of a SetupIntent is that it will create a PaymentMethod.

#

Correct

mellow nexus
#

For some reason, I keep thinking that it shows the id of a source

#

Aren't payment method id's in the form of "pm_123456789" and not "card_123456789"?

dry jungle
#

Yes PaymentMethods are pm_xxx. But I think if you need a PaymentMethod ID and provide a card_xxx it should also work.

mellow nexus
#

May I have a second to test it out?

dry jungle
#

Sure

mellow nexus
#

I'm asking this because my subscription flow has to account for two cases.

  1. The user has entered a default payment method and the subscription will automatically bill the default payment method.
  2. There are no saved payment methods and the user will have to enter their payment details during the purchase of the subscription.
dry jungle
mellow nexus
#

Right, so this helps cover the case when users don't have any paymentmethods attached for they can enter their payment details and it'll automatically be saved as their default method.

dry jungle
#

Yes

#

Let me know if that solves your issue or if you have other questions.

mellow nexus
#

May I ask another question?

dry jungle
#

Sure!

mellow nexus
#

This is a totally unrelated question, but my api key just stopped working while testing. It was working literally a couple minutes ago. Any ideas?

dry jungle
#

What do you mean by "stopped working"? What's the error message you see?

mellow nexus
#

It's working now, oh

#

Ok so when I created the SetupIntent, I see that my payment_method field is set to null in the response.

coral prairie
#

👋 taking over for my colleague. Let me catch up.

mellow nexus
#

Sure

#

Any questions you might have for me? I can better explain my situation if you'd like.

coral prairie
#

sorry I'm just reading through

coral prairie
mellow nexus
#

This is what I expected, hence why I am not understanding what soma said.

#

If I want to extract the payment method id from the setupintent, then would that only be possible after the payment method is created?

#

Hmm, sorry if this looks bad but unfortunately I have to run. Should anything come up, I'll ask again later.