#Zhi-shipping-address
1 messages · Page 1 of 1 (latest)
when creating payment element and selecting Afterpay, it showed address fields, but those are for billing address instead of shipping address.
In the stripe js source code, there is one method to element.create('shippingAddress'), but it is a beta one which doesn't work.
in your document, the address fields (form) are clearly stated as shipping address, I wonder how this was configured
we don't have multiple page checkout. Instead, we have only one step (page) to do the checkout. So we will ask customer to fill up the shipping address (assuming billing address and shipping address are the same)
but it is a beta one which doesn't work.
It doesn't work?
Is it broken? Or have you simply had trouble using it in a specific region?
when I use elements.create('shippingAddress'), it gave me error
I don't see a shippingAddress field on elements.create. Can you link me to the section of the docs that specifies this?
Are you talking about this? https://stripe.com/docs/js/appendix/shipping_address
Okay, and what does the shippingAddress object contain? How is it being created?
not sure this is the right reference
your documentation has the thing we want to follow
any way to configure the afterpay form to like this?
Let me circle back in a few minutes
I think it should have a shipping address by default when you select AfterPay in the Payment Element modal. Have you set this up already? If so, are you seeing something different?
if we add the shipping addresses when creating the paymentIntent, it works. We can rely on the payment element to collect the billing address.
But we don't have a step to collect shipping address upfront.
We would like customer to enter their shipping address like what your document shows to reduce steps.
Or can you guide us to copy billing address to shipping addrress when confirmPayment method was called. When calling confirmPayment method, we have to pass in elements object. Is it possible to do something to this object before we pass it to the confirmPaymengt method (to add shipping address)
Where is that screenshot coming from? Can you link the docs?
scroll down, kind of in the middle of the page
Ah, I see. So that uses Checkout. I think you might be able to get the same type of functionality from the Payment Element, but I'm not sure
Let me inquire internally
we are using Payment Element, yes. We can't use Checkout for now
Ah, okay. So you won't be able to create something that does the exact same thing as Checkout, if you're using the Payment Element. You could either (a) use the confirmAffirmPayment() in your flow to collect and confirm all the information in a single step (https://stripe.com/docs/js/payment_intents/confirm_affirm_payment#stripe_confirm_affirm_payment-data-shipping-address), or. (b) use the Payment Request button and pass in a shippingOptions and set requestShipping to true (https://stripe.com/docs/js/payment_request/create#stripe_payment_request-options-requestShipping)