#yodagains

1 messages ยท Page 1 of 1 (latest)

restive locustBOT
ivory flicker
#

Hi ๐Ÿ‘‹

Can you give me the broader context of your question here?

white mountain
#

Yes! Here is a link to the original message (only a few scrolls up)

ivory flicker
#

Hi Stripe devs! I have a quick question regarding Stripe Elements, SetupIntent, and Shipping Address:
Consider a Stripe Elements group which is initialized with a SetupIntent client_secret and contains the following elements within:

  • LinkAuthenticationElement
  • PaymentElement
  • AddressElement w/ mode= 'shipping'

When calling stripe.confirmSetup with this group of elements, where will the shipping address be stored? Will it be stored against the Customer object for which the SetupIntent was created? Or will it be stored in the underlying PaymentMethod which results from the confirmation of the SetupIntent? We have looked all over the place and are not finding the shipping address stored anywhere upon SetupIntent confirmation. When we inspect the network request created by stripe.confirmSetup, it seems that the shipping address isn't being included in the request.
In the Address Element documentation (https://stripe.com/docs/elements/address-element?platform=web#shipping-mode), it says:

"When the Address Element is in shipping mode and used with the Payment Element in the same Elements group, Stripe automatically adds the shipping address details when confirming the SetupIntent"

With this same group of elements initialized with a PaymentIntent client_secret, the confirmation stores the shipping address under the PaymentIntent.shipping property.
Quoting here because I don't want to jump back and forth

#

Do you have an example Setup Intent I could take a look at?

white mountain
#

seti_1MBoJpQY88Lv8OWomUNHHxze

#

stripe account: acct_1LJ417QY88Lv8OWo

#

(sandbox api keys)

ivory flicker
#

Okay so it looks like this Setup Intent was confirmed with a Postal Code and Country but no other address details. Is that correct?

white mountain
#

Also, using Stripe JS:

"@stripe/react-stripe-js": "1.7.0",
"@stripe/stripe-js": "1.22.0",
#

That postal code and country came from the PaymentElement after deselecting "use the same shipping address for billing"

#

So that's the billing address that you see there

#

under setup_intent.payment_method.billing_details

ivory flicker
#

Yeah, I'm just trying to find somewhere the data would wind up living, or even that it is being passed to our API

white mountain
#

setup_intent.customer.shipping is null for that setup intent

#

So in my message I mentioned that I inspected the network request which Stripe JS made when calling stripe.confirmSetup

#

The request payload didn't include any of the data contained in the AddressElement

#

maybe that's on oversight in the stripe.confirmSetup function? Or maybe that's only available in a later Stripe.js NPM version?

ivory flicker
white mountain
#

thanks! I will give that a try

ivory flicker
#

Because I agree, this feels like the version of confirmSetup you are calling isn't passing the data to the API.

white mountain
#

It seems that 1.35 release is just updating StripeShippingAddressElementOptions to include some stuff related to phone numbers?

#

anyways, I will do some more digging. I wonder if you could ping whoever maintains the stripe.confirmSetup to see how it handles an adjacent AddresElement ? ๐Ÿ™‚

#

(I recall trying yesterday with latest stripe.js and had the same problem)

ivory flicker
#

Oh, do you have a test interface I can check out?

white mountain
#

yea np! I will send GH link.

#

(sorry, just testing again quickly)

ivory flicker
#

NP, my colleagues are testing this flow to try and reproduce. It works successfully with Payment Intent, now testing with Setup Intent

white mountain
#

Here is the network request from the stripe.confirmSetup

#

Here is a gh repo

#

just run the app, then put a setup intent client_secret in the text input, then it renders the payment element which

#

in my screenshot from the network request, you can see there is nothing related to shipping address included in the request payload

#

if I put a payment intent client secret in this same form, the stripe.confirmPayment network request includes the shipping address data and it stores the address in payment_intent.shipping

ivory flicker
#

Okay I've got some more testing information for you. We think it's an edge case. We will append the address to the payment_method_details if you click "Billing is same as shipping information". But otherwise we do not have a property in the SetupIntent to store this information

#

In the case you mention above you are using the Payment Intent which has a property explicitly designed to store this information

white mountain
#

could you store the shipping address in setup_intent.customer.address?

ivory flicker
#

But that does not exist on the Setup Intent itself. Storing it on the Customer could be an option but since the customer is an optional parameter that logic doesn't exist presently.

white mountain
#

hmmm that makes sense.

#

feels like setup_intent should have a shipping property?

ivory flicker
#

I am going to note this internally so we are aware of this case

white mountain
#

thanks for the confirmation that this isn't currently supported though, we will update our FE to pass along the shipping address in a separate request to our BE

#

seems like the setup_intent should have shipping property based on the stripe documentation tho

#

When the Address Element is in shipping mode and used with the Payment Element in the same Elements group, Stripe automatically adds the shipping address details when confirming the SetupIntent

#

anyways, im sure your product roadmap is already max capacity, so i won't cross my fingers ๐Ÿ˜†

ivory flicker
#

I agree. The question is whether we will change the docs or the Setup Intent ๐Ÿ˜…

white mountain
#

Thanks for your help! All good on our end now, just wanted to confirm that we will have to build a workaround.

ivory flicker
#

If you want to be kept updated on the progress you can write in to Support and we can keep you informed of any changes. (https://support.stripe.com). Mention my screen name in the email so I can grab it.

white mountain
#

how do i add a ticket? Lol from dashboard? this is only a search by the looks

#

it's okay though, i think we don't want to tightly couple our order confirmation endpoint to a stripe api resource anyways, since we are supporting more payment providers soon

ivory flicker
#

That's understandable