#George Farhat

1 messages ยท Page 1 of 1 (latest)

sonic windBOT
foggy blade
#

Hello ๐Ÿ‘‹
Unfortunately, I can't reopen but happy to help here. What's your question?

summer briar
#

thank you

#

so we are currently implementing an integration with 2 strip accounts to accept card payments (manually entered & via google/apple pay) in the following way:
1- ask the customer which region their card was issued (EU, UK, International)
2-based on their answer, we initiate Card Element with the correct stripe account (EU account for EU, UK account for other)
3-server creates payment intent using the correct account and send client secret
4-Customer entered details (attached payment details to intent)

We want to use stripe's webhook to trigger when the customer confirms their details. The webhook for that trigger contains the payment intent, and we are wondering how to do we get the card's issuing country after the payment details have been confirmed?

foggy blade
#

What webhook event are you listening to?

summer briar
summer briar
foggy blade
summer briar
#

i see

#

so which event is triggered when we Confirm payment on client side?

foggy blade
#

payment_intent.succeeded is the one you should be listening to

summer briar
#

i see

#

will this trigger even if my capture_method is manual?

foggy blade
#

ah good question, I don't think it will be generated until the PaymentIntent has been captured. It should generate a diff event though.

Do you have an example PaymentIntent ID by any chance? I can look and provide more info on what event would be generated for manual capture

summer briar
#

unfortunately i am "blind-coding" atm so trying to set things up

#

I will be testing soon

#

with a test account

#

and can start looking into it

foggy blade
#

Gotcha. NP! I'll try to look up docs and see if I can find any

summer briar
#

thank you!

#

btw the payment_method in payment intent is string | Stripe.PaymentMethod | null

foggy blade
summer briar
#

ok i see

#

is there any way i can expand something in the payment intent to get the country of the card?

foggy blade
#

You can't expand a field on the webhook events by default unfortunately. You'll have to make a separate request with the expand parameter

summer briar
#

yes yes

#

if i get the payment intent

#

as in if i make a request to get the payment intent after a trigger, could I expand something to get the card country in the response?

foggy blade
#

You can expand the PaymentMethod parameter itself once the PaymentIntent has been confirmed. That should get you the complete PaymentMethod object rather than just a string pm_xxx

summer briar
#

ok i guess i have to just try it then

#

thanks again for your help!

summer briar
foggy blade
#

NP! ๐Ÿ™‚ Happy to help
Feel free to let us know if you have any follow ups

Yup I will drop the link here once I find something

summer briar
#

thank you!

#

will do! ๐Ÿ™‚