#anh3608
1 messages · Page 1 of 1 (latest)
Hello! If you want to collect additional billing details you can use your own form and pass them in when you call stripe.confirmPayment: https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details
Thanks, let me try again. I had that setup earlier without LINK. Just realized I had {billingDetails: "never"} when I implement LINK. Maybe that why confirmPayment didn't update billing.
yes, I can use my own form to collect billing info to pass to stripe.confirmPayment after remove {billingDetails: "never"} from payment element.
now I have another question, with the {billingDetails:"never"} removed, payment element now show the checkbox "billing same as shipping" and ask for country/zipcode if it's unchecked. Is it possible to hide it since my own form already ask for the same info?
Can you show me a screenshot of what you're seeing?
right now customer will have to select billing country and zipcode twice: one on Stripe element form, and second time on my own billing form
Are you using beta functionality in the Payment Element?
you mean this?
betas: ["shipping_address_element_beta_1"]
Ah, yeah, that explains it. The functionality you're using is a non-public beta, so we can't help with that part here. You would need to ask for help from the person who gave you access to the beta.
that is on your Faster checkout with Link documentation page. I thought it's public
Can you link me to that page?
Ah, my fault, I didn't realize that was public.
no problem
I'm not sure I completely understand the behavior you want here. The Payment Element is designed to collect billing information, but it looks like you have a separate billing address section on your own form. You want to collect billing information using your own form because the Payment Element doesn't collect all of the information you want, correct?
yes
But you also want to collect a shipping address with the Stripe Shipping Address Element?
yes
Why do you want to use Stripe to only collect one address but not the other? I don't think the integration was designed for that scenario.
no, i'm ok with Stripe collect billing address but it doesn't collect everything
From the docs:
Display the
shippingAddressElement before thepaymentElement. ThepaymentElement dynamically detects address data collected by theshippingAddressElement, hiding unnecessary fields when possible, and collecting additional billing address details as necessary.
Why do you want to collect "everything" when it comes to the billing address?
because my shopping cart system currently require both billing and shipping address
i would have to rewrite everything if I don't have billing address
without billing address, i would have to rewrite all the pages that display billing address for customer (invoice, order details,....)
So, to clarify, if you set billingDetails to never with the Payment Element and you try to supply billingDetails when you call stripe.confirmPayment, what happens?
it doesn't pass to confirmPayment
What do you mean?
Not sure I understand?
That documentation indicates that you can pass billing_details in when you disable collection of billing details in the Payment Element, which is what you're doing.
If you collect billing details inside the Payment Element those details will override what you pass in here, but that's not what you're doing.
Can you clarify further what you mean by "doesn't pass to confirmPayment" means?
by doing that, payment form doesn't collect billing info. I passed billing info via stripeConfirmPayment but nothing went through.
give me a sec. Let me run my code again to confirm
Can you give me the Payment Method ID (pm_) created after you test?
Or the Payment Intent ID (pi_)?
hmm..my bad. its working now. This is the one i just test pi_3LilBBFjgDuKhVRV0dPb5WVf
this is the one that billing details are all null pi_3LiLNQFjgDuKhVRV18crkkT4
Yep, that second one didn't include billing details in the confirmation request for some reason: https://dashboard.stripe.com/test/logs/req_G5yhEpemHYBJ5z
Maybe a typo or something?
That newer one did though: https://dashboard.stripe.com/test/logs/req_Jt4IrxT3vge8Ie
yes, let me test again to make sure
ok, look like billing details doesn't get update via stripe.confirmPayment if it's the new customer
pi_3Lim0GFjgDuKhVRV0mBP77Gx
yes, new LINK customer
Oh, interesting.
If I place the order again under the same account, then billing details got update
same code
my server side returned billing details via ajax/json and I passed it to stripe.confirmPayment
pi_3Lim5dFjgDuKhVRV0F4tz3oU
same LINK customer as the one above, this time billing details is filled
You're sure the expected billing_details are being passed to stripe.confirmPayment in both of these scenarios?
yes
let me console log both scencarios. give me a sec
yes, billing_details are passed correctly for both cases
I'm investigating internally, give me a few minutes...
It looks like this is actually expected behavior, but I'm trying to figure out why it's expected. In the meantime, to make sure I understand your use case, your goal is to have the billing details populated on the resulting Payment Method, correct?
If i don't select "Save your info for secure 1-click checkout" then billing details is updated
yes, my codes is currently use the billing details returned from stripe webhook event to update some of the fields in my database.
it's odd that the behavior is not consistent. i think it should
I agree, the inconsistency is unexpected. I'm continuing to investigate further internally.
In the meantime, one possible workaround is to update the Payment Method with the billing details after confirmation: https://stripe.com/docs/api/payment_methods/update#update_payment_method-billing_details
However, that probably doesn't help much with your webhook scenario.
can you keep me posted what you find? Should this be escalated to Stripe engineer?
Yep! I'm a Stripe engineer, so that part is already done. 🙂
@pine hound You around?
I just stepped out.
I just wanted to let you know that I'm unlikely to have more information for you about this today, but it also looks like this behavior is unlikely to change in the near future. Will the workaround I suggest above work? Or can you adapt it for your use case?
Ok. Let me figure out a workaround. Thanks for looking into it
Sorry I don't have better news, and sorry for the inconsistent experience here! I'll push internally to improve this.