#wsteelix - set default payment method

1 messages ยท Page 1 of 1 (latest)

simple epoch
#

Hello, happy to help. What have you been trying so far? And what issues have you run in to with it?

wise basalt
#

Hi, thanks for super quick response!

#

my current flow is : create Customer -> create SetupIntent -> get client_secret (with payment_method_options: ['card', 'ideal']) -> render PaymentElement -> call stripe.confirmSetup with the element -> on redirect from a successful authorization, call stripe.retrieveSetupIntent with setup_intent_client_secret from the url query params -> create Subscription with the payment_method attached in the retrieved setupIntent in the previous step -> try to set the payment method with the same id above as default for future charge

#

and the last step always fail because it seems that the payment_method returned together with the retrieved setupIntent is different from the payment method that was earlier attached to the Customer object ๐Ÿค”

#

this is an example Customer: cus_LxwWWIs4bCL3yI

#

hope it was not too confusing ๐Ÿ˜… i'll be happy to explain further if there's anything unclear ๐Ÿ™‡โ€โ™‚๏ธ

simple epoch
#

Thank you for the clarification. Would you be able to try the last step again and send me the request ID from that call (req_123) so that I can look at the specific error that you are getting?

wise basalt
#

Hi, this was the request id: req_zlyHuscXoZnfR7

simple epoch
#

Thanks!

#

If you make that call and attach the payment method and customer that you just tried this with, the error should go away when you try again

wise basalt
#

the thing is that we already pass the customer ID to the call to create SetupIntent

#

for example if you can have a look at this Customer events and logs: cus_LxwWWIs4bCL3yI

#

there's a successful payment_method.attached event

#

the weird thing was that on this payment_method.attached event evt_1LG0eELiXZrLhRYlioy6U88j, the id of the payment method was: pm_1LG0eELiXZrLhRYl8t21uJC3

#

but then on the next setup_intent.succeeded event evt_1LG0eELiXZrLhRYlXrBOIl35, it contains a completely different payment_method id: pm_1LG0dqLiXZrLhRYlAcHUYH9u

#

so I was wondering why and how this happens

simple epoch
#

Interesting. I thought that that was not in our logs when I checked it. Thank you for the new IDs, will check in to them in a moment

wise basalt
#

sure. thanks! and please take your time ๐Ÿ‘

simple epoch
#

Thanks for the IDs and the patience. I am still unsure why this setup intent is behaving like this. I will reach out to my colleagues who may know more on this and will get back to you with what we can find

wise basalt
#

sure thing. Thanks a lot! I have the same feeling also. because our setup has worked so well with cards so far. We're now planning to implement SEPA bank redirect, and has stumbled on this weird issue ๐Ÿ˜

#

btw, should i expect your colleagues respond anytime soon? I'm already over time, and if not then I can close the laptop and get back at this tomorrow ๐Ÿค”

simple epoch
#

Apologies for the delay. Don't want to make you stay later, would you mind writing in a quick email to support@stripe.com mentioning these events and that you spoke to Pompey on Discord, and then DM-ing me your email?

#

I can pick up the ticket right away and we can have an answer there before you get back tomorrow

#

Otherwise it shouldn't be too long but again I don't want to make you stay past when you should

wise basalt
#

sure thing! I will shoot an email that way right away

simple epoch
#

Thanks! Apologies this took a bit already

wise basalt
#

no worries, I can see that you're handling multiple requests at once ๐Ÿ‘

simple epoch
#

Thanks for the email, grabbing it now

wise basalt
#

ah... supposed to dm you the email address, sorry ๐Ÿ˜…

simple epoch
#

No worries, happens all the time! We are mostly worried about bots crawling for people to spam but I don't think they are that on top of our threads

wise basalt
#

alrighty! thanks a lot!

simple epoch
#

Perfect. I can see your email and assigned myself. Have a good rest of your day!