#aubreywodonga

1 messages · Page 1 of 1 (latest)

idle bisonBOT
feral trout
#

Hi there

#

In terms of storing in your database I would recommend using Webhooks as otherwise you might not ingest the data since the customer could lose network connection between the time they initiate the SetupIntent confirmation and when it succeeds.

In terms of immediate showing of the added PaymentMethod, you want to pass the PaymentMethod to your backend and retrieve it and pass that information back to the frontend.

edgy geyser
#

Ah, I forgot completely about webhooks that might be triggered on adding a new payment method, thank you!

On your second point that's essentially what I am trying to do, but my issue was that I wasn't sure where I could access the paymentMethod since as I understand it wouldn't exists until the successful addition+redirect.

I'll look into the webhooks now and come back if I have any issues, thanks again!

feral trout
#

Yep that's right, so upon the redirect that is when you fetch your backend.

#

The SetupIntent ID will be appended to the redirect URL as a query param

edgy geyser
#

Oh man, I was looking for exactly that and somehow completely missed the payment_intent key on the setup intent object! 😅 Thanks!