I have a signup form with First Name, Last Name, Email and Phone, and then a Pay with Card Stripe Checkout button. Once the user fills out the form, Stripe Checkout asks for Email Address. How can I get the user entered email address in the form to auto fill the email address field in Stripe Checkout.
Here's my current code:
.field
= f.label :"Email:"
= f.text_field :email
%br
.actions
%script.stripe-button{ src: "https://checkout.stripe.com/checkout.js",
data: {email: "thisemail@carriesover.com", amount: @level.price*100, description: @level.name, key: Rails.application.secrets.stripe_publishable_key}}
If I hardcode the email address in the Stripe Checkout script, it works. Can I use jQuery to pass it over? If so, how?
email
parameter ofhandler.open()
- koopajah@registration = Registration.new registration_params.merge(email: stripe_params["stripeEmail"])
Not sure where stripe_params[] comes from. - Trey Copelandtoken()
callback and at that point you have to post the token id and the user email yourself to your server - koopajah