Closed IgorNoskov closed 5 months ago
The billing details collected by the Payment Element will be on the Payment Method attached to the Payment Intent after the payment is confirmed.
https://docs.stripe.com/api/payment_methods/object#payment_method_object-billing_details
The billing details collected by the Payment Element will be on the Payment Method attached to the Payment Intent after the payment is confirmed.
https://docs.stripe.com/api/payment_methods/object#payment_method_object-billing_details
@bredmond-stripe, thank you for your answer, I've checked stripe.confirmPayment
and stripe.retrievePaymentIntent
methods return Payment Intent but without attached Payment Method, I see only payment method string id there.
Documentation says:
I didn't find a way to get Payment Method object.
You can use expansion to have the payment_method
returned as the object instead of the string ID: https://docs.stripe.com/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-expand
stripe.confirmPayment({
elements,
confirmParams: {
expand: ['payment_method'],
return_url: 'https://example.com',
},
})
expand: ['payment_method'],
@brendanm-stripe, thank you so much! It works!
What happened?
I use AddressElement with shipping mode and PaymentElement. In such case there is Billing is same as shipping information checkbox. When I uncheck it, two fields appear, country and postal code. But there is no way to get the billing address.
On AddressElement change it returns this object:
On PaymentElement change it returns this object:
Environment
No response
Reproduction
No response