#Mr Stinky Pants

1 messages ยท Page 1 of 1 (latest)

visual crownBOT
jade minnow
#

Is this what you're looking for? https://stripe.com/docs/api/customers/object?event_types-payment_intent.payment_failed#customer_object-default_source

You can expand that object to get the card object, which contains all the card's address details: https://stripe.com/docs/expand

Learn how to reduce the number of requests you make to the Stripe API by expanding objects in responses.

cursive nova
#

well mine is blank on there

#

i guess because im using subscription

jade minnow
#

Do you have a Customer ID I can look at?

cursive nova
#

so i got the subsciption and was trying to expand default payment mthod there

#

cus_Ml7vsxfmt2iUwJ

jade minnow
#

Ah, okay. You may not be setting the default payment method on the subscription then.

cursive nova
#

well i was just following the docs

#

i think it does have an id for it

#

but i thought i would get it in the same call

#

oh wait a min

#

i think i was putting it in customer options

#

can you expand subscription.defaultpaymentmethod ?

#

i guess i need to expand twice

#

customerGetOptions.AddExpand("subscriptions");

jade minnow
#

Ahhh, okay. It looks like it does have a default payment method, as you mentioned. You cannot expand that one, but you can make a separate retrieve API call to get the Payment Method using the ID you get from the Subscription instead

cursive nova
#

oh right

#

unless theres a better way to get address on to customer automatically

#

i was using this address elements

#

its only adding the address to the card

#

is that possible?

jade minnow
#

Ah, unfortunately we don't handle Beta products, so I wouldn't know, but this seems like a reasonable way to go about it as far as I can tell

cursive nova
#

ok it should work now cheers

#

and just to check this is the only way to get the address?

jade minnow
#

Yes, or (to be more specific) this is the only way to get the address from a Payment Method using a Subscriptions

cursive nova
#

no i mean using the payment elements

jade minnow
#

As far as I know the address can only be gotten from a subsequent retrieve API call in this case

cursive nova
#

sorry i mean at the time of payment

#

the only way to get it from the customer in UI?

copper wraith
#

๐Ÿ‘‹ i'm stepping in as two-shoes needs to step away

#

to be clear, are you asking if using the address element is the only way to obtain a customer's address?

cursive nova
#

yes

copper wraith
cursive nova
#

yes i was doing that

#

but it is nice to set up the fields based on country as the address element does

#

the only problem with it is it doesnt always get the full address as you would like