#dhruvs_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1293921196177490023
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
No you can't use the same button click handler as you would for Payment Element
You have to use Express Checkout's custom handlers here expressCheckoutElement.on('confirm', ...
Got it!
I was wondering if the express element could use the same confirmation logic as payment element.
I mean it can re-use the same confirmPayment() code, yes. But it needs its own handler
Got it!
Another QQ: in my payment element form I have a custom field which collects the users Full Name - is there a way I can make this field required?
No you can't force requirement of that via Payment Element. Payment Element is designed to collect the minimum necessary billing details based on the selected payment method type. So if you want to always collect name then you should use your own input and then set fields.billingDetails.name: 'never' when you create your Payment Element (https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-name) so you don't collect name twice. You then pass this name to confirmPayment() via confirmParams.payment_method_data.billing_details.name: https://docs.stripe.com/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details