#birdy247
1 messages ยท Page 1 of 1 (latest)
Hi
We are using the address element in shipping mode in conjunction with the paymentElement
I have noticed that the address is always coming through in the billing address, and not the shipping address
Hello ๐
can you share any examples where you're seeing this occur?
Request IDs would help
https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
pi_3NPnz3F9NVx519I12HvPRBW5
Ahh
I think I know what this is
Our flow is as follows
- We create a customer/setupIntent on our platform
- We clone the customer and create the payment_intents on the backend (paying multiple stripe accounts)
- We then confirm the paymentIntents on the frontend
SO in short, the address is attached to a paymentElement which is confirming a setup intent
Correct.
Apologies for the delay
too many developers asking questions today
๐
I bet!
Does ^that unblock you? Any other queries I can help with?
Not really
Can we attach the addressElement to each paymentIntent we confirm?
using confirmCardPayment
Hang on, let me clarify.
The address is attached to the PaymentMethod created by the SetupIntent
When you clone the PaymentMethod to the connected account, the address is cloned along with it
Shipping address is stored on the customer object
https://stripe.com/docs/api/customers/object#customer_object-shipping
AFAIK It would be cloned to the connected account when you clone the customer
We dont clone the customer (sorry got that wrong)
We clone the payment method
And then create the paymentIntent using the cloned paymentMethod
So I think the shipping address is being captured in the addressElement, but we then store this on our customer. Then clone the payment method to the connected account, so the shipping address is lost
Any thoughts
Can we use the addressElement when confirming the paymentIntent with the cloned paymentMethod?
Oftentimes with cloning, the customer info needs to be manually copied down by making a customer update call on the connected account's customer object
Oh or you can supply that info when creating the customer object if you already have it on the platform account
Good catch, yes that should be a place that you can pass those details
Can we retrieve this from the address element?
.getValue().value.address ?
That kind of thing?
Our docs only seem to show getValue() is that not returning a valid object when you run it in your code?
The shipping information on this PaymentIntent can only be set with a publishable key when also providing a payment method. Please try again with a payment method or use your secret key.
So looks like we cant just set it on the frontend
Can you show me your code that you used there? I am surprised that it said you don't also have a PaymentMethod if you are using the card element
Its quite complex
We create the payment intent on the backend with the cloned payment method
I more meant the specific call that you get that error from
I don't think the cloning before affects that error message
const {paymentIntent, error} = await stripeConnectedAccount[element.next_action](element.secret, {
shipping: {
name: this.jwtData ? (this.jwtData.first_name + ' ' + this.jwtData.last_name) : '',
address: this.address
}
});
element.next_action = confirmCardPayment
I think you also need to pass card: cardElement, to use the card details from the card element
The method confirmCardPayment does not work with the Payment Element. We'll need to use confirmPayment. Looking in to how to pass this data
Hmm. This has been working fine to date
In that case, can you try passing card: paymentElement (where paymentElement is the name of the variable for the payment element in your code)
Basically, as the error message says, you need to provide a payment method when making that call. To provide that payment method, you need to either pass in an actual PaymentMethod ID to data.payment_method or you need to pass in an element that collects card details to the confirm call tha tyou are making
but the paymentElement was used to create the setup intent on our platform
so if we use the card:paymentElement method
Wont that be the paymentMethod on our account, not theirs?
I passed in the cloned payment method and it worked
Shipping address is present
Great to hear that that worked! I think the PaymentElement suggestion came from me being unclear on what was happening on your page.