Home » Php » javascript – Remove “email address” field from stripe checkout

javascript – Remove “email address” field from stripe checkout

Posted by: admin July 12, 2020 Leave a comment

Questions:

I am trying to setup stripe for monthly subscription payment. Go here to view documentation I am following: stripe.com/docs/recipes/subscription-signup
The problem i have to solve is the popup form contains “Email address” field but as per my application needs I already have users email address on my database. So I wanted to remove this “Email address” field from popup form. But as I have noticed the popup form is loading from stripe library https://checkout.stripe.com/checkout.js

<html>
<form action="create_subscription.php" method="POST">
  <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="pk_test_P7fmeBSVkA66nU22Sk6BYUOn"
    data-image="images/marketplace.png"
    data-name="Emma's Farm CSA"
    data-description="Subscription for 1 weekly box"
    data-amount="2000"
    data-label="Sign Me Up!">
  </script>
</form>
</html>

How can I remove email address from payment popup window? Any idea? Check picture to view popup windows which asking “email address”

How to&Answers:
<html>
<form action="create_subscription.php" method="POST">
  <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="pk_test_P7fmeBSVkA66nU22Sk6BYUOn"
    data-image="images/marketplace.png"
    data-name="Emma's Farm CSA"
    data-description="Subscription for 1 weekly box"
    data-amount="2000"
    data-label="Sign Me Up!"
    data-email="[email protected]">
  </script>
</form>
</html>

enter image description here