#Zhi-shipping-address

1 messages · Page 1 of 1 (latest)

whole kraken
#

Hi there! Can you elaborate? What have you tried so far?

dreamy drum
#

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)

whole kraken
#

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?

dreamy drum
#

when I use elements.create('shippingAddress'), it gave me error

whole kraken
#

I don't see a shippingAddress field on elements.create. Can you link me to the section of the docs that specifies this?

dreamy drum
#

const test = elements.create('shippingAddress')

whole kraken
#

Okay, and what does the shippingAddress object contain? How is it being created?

dreamy drum
#

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?

whole kraken
#

Let me circle back in a few minutes

whole kraken
#

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?

dreamy drum
#

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)

whole kraken
#

Where is that screenshot coming from? Can you link the docs?

dreamy drum
#

scroll down, kind of in the middle of the page

whole kraken
#

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

dreamy drum
#

we are using Payment Element, yes. We can't use Checkout for now

whole kraken
#

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)