#Script
1 messages · Page 1 of 1 (latest)
What docs are you following?
the "Add custom fields" requires that I create a checkout session while the "Custom payment flow"
Hmmm, I think you may be mixed up. The "Custom payment flow" workflow does not use Checkout at all. You would want to select "Prebuilt checkout page" at the top of the quickstart docs instead to use Checkout
oh
so its not currently supported to add custom fields to the custom payment flow?
No. The fields you can add with the Payment Element via the custom payment flow are listed here: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields
Nice
so I just use it with the createPaymentMethod correct?
I'm not sure where you're getting that method. It's not in the quickstart guide
I don't think I directed you there. You should follow the quickstart guide closely unless you're trying to do something specific
my bad.
I took a look at the link you sent and still cant find how to implement it into my code
i'm guessing its one of these endpoints
No, it's during this step when you create the Payment Element: https://stripe.com/docs/payments/quickstart#payment-element-html
But you don't really have to change anything from the quickstart guide. Those fields are automatically collected if they are required
oh this
can I manually set the email input?
I tried doing that using the onChange event but it didnt
What I'm trying to do is use the logged-in user's email and fill it in automatically into the payment email input field
Yup, you set up the default value via the same creation step as above: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-defaultValues
awesome
it works now
lastly is it possible to disable the input? I dont want customers making the mistake of removing the email and using another one
Not that I know of, no
I think you make the whole element read only, but I'm not sure if that will only apply to email: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-readOnly
I would test that parameter above and see if it does what you're looking for
it only applied to credit card details 😪
Oof, well there you have it
i'll probably just show an alert notifying them not to
Thanks for your help two-shoes
Sure thing!