#girlgonoph
1 messages · Page 1 of 1 (latest)
I'm not sure if there is. Let me check
sure
Doesn't look like it. You can either add the values as default values: https://stripe.com/docs/js/elements_object/update_payment_element#payment_element_update-options-defaultValues
Or you can use Stripe Link, which would auto-fill customer details once they login: https://stripe.com/docs/payments/link/add-link-elements-integration#:~:text=Link authenticates customer accounts using,customer to authenticate to Link
I used stripe link but it does not send me the otp(was facing issues there) and the default value does not have fields like card number,expiry date etc.
how can I resolve this issue?
Hmmm, let me dig a bit and get back to you.
sure
So, if you have a Customer already created with a Payment Method attached, you can pass that in when the Element is first created via this parameter: https://stripe.com/docs/js/elements_object/create#stripe_elements-options-customerOptions
can you elaborate a bit more, as to where exactly?
Can you paste the code you're using to present the Payment Element? Hard to point to where if I don't know what your integration is doing
This line passes in options to the Payment Element. You would want to put the Customer ID in that object. Specifically under customerOptions{ customer: someCustomerID}
nope, it does not populate the fields. I tried it
Are you getting a browser console error?
no errors on the console side
the customer id is : cus_OztDbsxsvS5owP
the code changes for now are :
const options = {
layout: {
type: 'tabs',
defaultCollapsed: false,
},
customerOptions: { customer: 'cus_OztDbsxsvS5owP' },
};
And when you open the inspector in the browser and refresh the page, nothing is showing up? No warnings or errors?
yep no warnings for now
That's... odd. Is this a public URL I can visit to see the behavior live? Or is it just local?
Also, in case this is important, did you restart the server after making changes to the code?
yes I did
its on the local
And do you know for sure that the layout is being updated? Like, if you change layout: { type: 'tabs' } to layout: {type: 'accordion'}, do you see a difference in the UI when you refresh the page?
Ah, okay. My apologies. I guess this was part of a gated feature I was testing on my account, so it's not available. Apologies for the wild goode chase. The original answer stands:
You can either add the values as default values: https://stripe.com/docs/js/elements_object/update_payment_element#payment_element_update-options-defaultValues
Or you can use Stripe Link, which would auto-fill customer details once they login: https://stripe.com/docs/payments/link/add-link-elements-integration#:~:text=Link authenticates customer accounts using,customer to authenticate to Link
but I dont know why the link feature is not working on my domain even when my domain is verified on the dashboard
it does not send the otp required
How are you triggering the OTP for Link right now? Are you logging into link.com or are you entering your email into the form for your local Payment Element?
I am entering the email into the form from my domain
Is this something you're trying in test mode while building the integration, or are you having issues with the OTP for a real account? In test mode, no real OTP is sent, you can just enter 000000.
okay got it