#commento

1 messages · Page 1 of 1 (latest)

rapid charmBOT
true sigil
#

Hi there!

#

Why do you use CreatePaymentMethod? You should only use SetupIntent whih will create and attach the Payment Method for you.

severe pulsar
#

ok I thought that adding a payment method as a parameter to a setupIntent will reuse the same payment method, not create a new one

#

Also, the payment method created is not set as a default, is it an issue for invoicing?

true sigil
severe pulsar
#

ok but if I have only to use it for future off-session invoices, does it make sense to do a setupIntent?

true sigil
#

If you want the user to enter their payment details every time there's a new invoice: don't use SetupIntent
If you want the invoice to be paid automatically: use a SetupIntent and set the payment method as the default

severe pulsar
#

ok thanks

#

sorry last question: how do I retrieve the payment method id of the payment method created with the setup intent? it is not present in the response

severe pulsar
#

for example: seti_1NSwl2Fkdr5S24UDShDbdXNh

#

it has payment method passed as a parameter and it is also in the response: pm_1NSwl1Fkdr5S24UD0uZ87x0o

#

but the created payment method is: pm_1NSwl4Fkdr5S24UDr7Srk3n7

#

do you have an answer about that?

true sigil
#
  • In seti_1NSwl2Fkdr5S24UDShDbdXNh you are trying to attach pm_1NSwl1Fkdr5S24UD0uZ87x0o to cus_OFReJ1OAwjXG8G
  • But if I look at pm_1NSwl1Fkdr5S24UD0uZ87x0o, I see it was created by a SetupIntent: https://dashboard.stripe.com/test/logs/req_Q5hiYG7l9LXj5X
    So you are making two SetupIntents in a row? That doesn't make sense.
#

Use a single SetupIntent to create and attach the payment method.

severe pulsar
#

no that one (pm_1NSwl1Fkdr5S24UD0uZ87x0o) was created with a stripe.CreatePaymentMethod

#

I am super sure about that

#

I thought it was possible to use an existing payment_method to do a setupIntent and I had a confirmation because it was returning the same payment_method but I guess this is not possible

#

sorry to bother you a lot

#

thanks for the support

true sigil
#

No worries, let me double check.

#

But then my question is the same: why are you doing this? You could directly create and attach the payment method using just one SetupIntent.

severe pulsar
#

yes you are right I will change the flow

true sigil
severe pulsar
#

this is really the last question: if I have a customer with an already registered payment method that is a default (to be precise it was attached using the sources api) should I do a setupIntent or just skip that part for an already registered customer?

craggy osprey
#

if the payment method is already authenticated you can use it and if you had some error during the payment, you may need to use SetupIntent in order to re-collect the PaymentMehtod.