#Mr Stinky Pants
1 messages ยท Page 1 of 1 (latest)
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
Do you have a Customer ID I can look at?
so i got the subsciption and was trying to expand default payment mthod there
cus_Ml7vsxfmt2iUwJ
Ah, okay. You may not be setting the default payment method on the subscription then.
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");
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
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?
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
ok it should work now cheers
and just to check this is the only way to get the address?
Yes, or (to be more specific) this is the only way to get the address from a Payment Method using a Subscriptions
no i mean using the payment elements
As far as I know the address can only be gotten from a subsequent retrieve API call in this case
sorry i mean at the time of payment
the only way to get it from the customer in UI?
๐ 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?
yes
got it. the alternative to using the (beta) address element is to collect the customer's address yourself. you'd create your own input fields and display these before or alongside the payment element. then, when confirming the PaymentIntent, you'd pass these along as billing_details - https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details