#George Farhat
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Unfortunately, I can't reopen but happy to help here. What's your question?
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?
Gotcha. The issuer country lives on the PaymentMethod object. So for a card, You'd want to retrieve the PaymentMethod (pm_xxx) object and look into PaymentMethod.card.country field
https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-country
What webhook event are you listening to?
Is this only available if a customer chooses to save the details for a future payment?
To be honest I thought i could use "payment_method.attached", but i know realised that this is only when a method is attached to a customer
I believe the PaymentMethod object is generated even if you don't store it. You can look at the PaymentIntent object's payment_method parameter
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
payment_intent.succeeded is the one you should be listening to
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
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
Gotcha. NP! I'll try to look up docs and see if I can find any
thank you!
btw the payment_method in payment intent is string | Stripe.PaymentMethod | null
Right, the parameter is expandable
https://stripe.com/docs/api/expanding_objects
ok i see
is there any way i can expand something in the payment intent to get the country of the card?
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
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?
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
if you find anything how can we get in touch?
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