#bobbyz-checkout-customer

1 messages · Page 1 of 1 (latest)

hollow linden
#

@boreal glacier do you have an example I can look at?

boreal glacier
#

In Stripe checkout, the customer has to input postal code and country (to pay with credit card).

#

A successful session creates a customer object.

#

How can i make the object contain the postal code and country?

#

It already contains the Full Name.

hollow linden
#

Can you give me an example Session to look at?

boreal glacier
#

Here's the customer object.

#

{
id: ‘xxxx’,
object: 'customer',
address: null,
balance: 0,
created: xxxx,
currency: 'usd',
default_source: null,
delinquent: false,
description: null,
discount: null,
email: ‘xxxx,
invoice_prefix: ‘xxxx,
invoice_settings: { custom_fields: null, default_payment_method: null, footer: null },
livemode: false,
metadata: {},
name: 'bz',
next_invoice_sequence: 2,
phone: null,
preferred_locales: [],
shipping: null,
tax_exempt: 'none'
}

#

You want the session object?

#

It's got a lot of sensitive information. Is that what you want tho?

hollow linden
#

Sorry I should have been a little bit clearer. I was asking for a clear example of a Session id, cs_test_123456

#

I'm asking because on my end I see the postal code and country on the Customer object after completing the Session

boreal glacier
#

cs_test_b1oBdxCQobAxZ2UmqJXFkyxvs22bDc5UNudEKZJ14HJwFrWbDn6Q8zbTBW

#

In Stripe dashboard, in the customer objects created by the successful checkout sessions, I also don't see postal code, country

#

All I need is the postal code and country that the customer inputs into Stripe Checkout.

#

It appears the information is on the "payment" but not on the customer...

hollow linden
#

ah yeah I think it's because you're in subscription mode

#

let me test this

boreal glacier
#

What is this and how do i get it with the API? This has the postal code and country.

#

Payment is not an object in the Stripe API.

icy shard
#

@boreal glacier A Payment Intent is associated with each invoice in the subscription, that's where you'll find the "payments" like the above

boreal glacier
#

Okay. I have the subscription object. How do I go from that to postal code and country?

icy shard
#

let me quickly create a test myself using the same params so we're looking at the same thing

#

when you do this, the billing information is associated with the payment method used for the payment

#

so if you have the subscription id, for example, you could inspect that by retrieving the subscription and using expansion to get at those billing details: https://stripe.com/docs/api/expanding_objects
expand[]=latest_invoice.payment_intent.payment_method

boreal glacier
#

Okay. I'll try that out. And the info is just in billing_details?

icy shard
#

correct

#

but with the customer_update approach, you'd have the billing address info saved as the customer[address]

boreal glacier
#

Thanks, it works.

icy shard
#

Great, thanks for highlighting this. I'm going to file this as feedback internally so we can try to improve this experience for you.