#ahsan575
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ahsan575, 1 hour ago, 35 messages
Not sure, do you have any examples of where you're seeing this?
i have a webhook listening for checkout.session.completed events and yesterday, a customer paid after filling in all details, but i received following (relevant code only):
"customer_details": { "address": { "city": null, "country": "GB", "line1": null, "line2": null, "postal_code": "XXX XXX", "state": null }, "email": "xxx@xxxx.com", "name": "xx xxx", "phone": "+44xxxxxxxxx", "tax_exempt": "none", "tax_ids": [ ] }
But i can see the address in payments in stripe dashboard
It might be useful for you to know that i do not see the address in customers section in (stripe dashboard) for the customer in question. Just the postcode like in the object above
My precise question would be, how do I overcome it? Do i need to listen to some other event or do I need to make a request to stripe after payment confirmation to get the address?
My guess, before looking, is that these details are required for tax calculation
the other full address you see might be associated with the payment method as a billing address
You said it does this in some cases, not others, so two IDs showing the two patterns you see would be ideal
So i can help figure out why you see a difference
Problematic event: evt_1OGhqDEf0s7M4UhFaHHWu0wx
Working event: evt_1OGfpoEf0s7M4UhFM8koG6cH
Well that makes sense to me. But just have a look and we can conclude the issue then
and just in case you might be curios regarding use case of address, it is stored in private db for personal record and fulfillment/order delivery workflow if that makes sense
its not really for tax purposes
Ok, so this is the other way around. Those customer_details mirror the payment method billing_details.
You can find the full shipping address for both payments on the payment intent within shipping:
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-shipping
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Eg: pi_3OGfpmEf0s7M4UhF1fmjHoY2
and
pi_3OGhq9Ef0s7M4UhF0dNjCXoK
im actually using stripe checkout and not payment intent. So is there any way I can keep the underlying code same but extend it some way?
You can retrieve those PIs directly via the API, or retrieve the checkout sesison and use expansion to expand the associated payment_intent: https://stripe.com/docs/expand
Yes, but checkout uses payment intents
You don't need to change how you use checkout, you need to change how to access the shipping address after the session is completed
So can i achieve the required functionality by epxanding it to payment_intent.payment_method
You don't need the payment method unless you want the billing address
You get shipping from the payment intent.
You can either retrieve that payment intent or retrieve the session with payment_intent expanded
alrighty, that look cool. Really appreciate your help, cant get to the point answers to support queries these days, nice to see logical answers.
have a good rest of the day
hang on, might be an easier answer
sure, shoot
similar to customer_details helper mirroring the PM billing address, the checkout event already has the PI shipping details mirrored in shipping_details
Sorry I missed that at first, was too focused on those customer details ๐
So you don't need to request anything, just inspect shipping_details instead of customer_details
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.