简体   繁体   中英

Can I add Custom Fields to Stripe Checkout

I am wondering if I can add kinds of custom fields on my Stripe checkout form like this, This works I've tested it but not about any security things or compaitability issues.

<form action="testpayments.php" method="POST">
  <input type="text" placeholder="Product 1" name="p1">
  <input type="text" placeholder="Product 2" name="p2">
  <input type="text" placeholder="Name" name="fname">
  <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="KEYHERE"
    data-amount="999"
    data-name="Website name"
    data-description="Order Price"
    data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
    data-locale="auto"
    data-zip-code="true"
    data-currency="USD">
  </script>
</form>

This way once the Stripe script generates a Token for me, I will be able to post details such as what products were sold etc to my server and then process it from there.

Will this work without any issues or security holes? If not how should I post user details and sold product details to my own server.

Thank you

PS: This is going to be a PHP Based script in the backend

You should be able to add custom details through the metadata part of the charge API (or any other API for that matter).

In general, when you deal with payments, just make sure you don't send any card details to your server, only the token you get back from Stripe.js.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM