#bobby-invoice
1 messages · Page 1 of 1 (latest)
@jaunty lava it can happen is the invoice amount is $0
like a trial period or a coupon was used
do you have an example of one where you see null?
Oh, that explains it. How can I get the postal code then?
ah, good question. You'd probably want to look at the customer instead, which might be more consistent
The information isn't there. I checked.
so grab the customer field of the CheckoutSession then list their PaymentMethods
Oh, I checked customer.billing_address.
yeah the thing is the address we collect is not the Customer's address
it's the address of their payment method
I know it's confusing
Oh, I see.
but basically https://stripe.com/docs/api/payment_methods/customer_list with the customer should work
or looking at the payment_method_details of the payment, if there was one, as discussed yesterday
but yeah if you sometimes have $0 initial payments too then it does get more complicated unfortunately since there's not payment to look at so you have to look at the customer's payment method directly instead. This part of the API isn't terribly ergonomic
oh actually @sweet oriole tells me this was a bug, and we are supposed to set the customer.address to the address collected as well
apparently it's been fixed yesterday after the thread you had though, so I think just reading customer.address on a fresh attempt should work, you don't have to go looking into the PaymentMethod or payment_method_details
Yep, we explored this some more after chatting with you yesterday @jaunty lava -- thanks for raising it here 🙂
Oh sweet, thanks!
Just confirming that it works, thank you very much!