#bobby-invoice

1 messages · Page 1 of 1 (latest)

verbal nest
#

@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?

jaunty lava
#

Oh, that explains it. How can I get the postal code then?

verbal nest
#

ah, good question. You'd probably want to look at the customer instead, which might be more consistent

jaunty lava
#

The information isn't there. I checked.

verbal nest
#

so grab the customer field of the CheckoutSession then list their PaymentMethods

jaunty lava
#

Oh, I checked customer.billing_address.

verbal nest
#

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

jaunty lava
#

Oh, I see.

verbal nest
#

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

sweet oriole
#

Yep, we explored this some more after chatting with you yesterday @jaunty lava -- thanks for raising it here 🙂

jaunty lava
#

Oh sweet, thanks!

jaunty lava
#

Just confirming that it works, thank you very much!