#rockbly
1 messages · Page 1 of 1 (latest)
Express Checkout
Are you setting emailRequired: true (https://stripe.com/docs/elements/express-checkout-element/accept-a-payment#handle-click-event) ?
Would that go in the elements.create('expressCheckout', { ... }) ?
I don't have an onClick - I have: expressCheckoutElement.on('confirm', handlePayment);
Yeah you would also create a click handler
Like expressCheckoutElement.on('click', (event) => { const options = { emailRequired: true, phoneNumberRequired: true }; event.resolve(options); });
There is an example in the doc above
Oh, OK - so it's just a new event handler. Kind of odd that it's not configured during initialization.
Yeah I think the idea is it gives you more flexibility if it is onClick
I will try this, thank you for the help!
Sure!
I am also using the Payment Element for a card fallback, is there a similar option to require an email? Right now I have manually added that field into my form.
No you can't force email for Payment Element
If you want to force collection then your own field is the correct route
And you can pass to the payment_method_data on confirmPayment()
Yup, that is working. Thank you again
👍