简体   繁体   English

我可以将自定义字段添加到Stripe Checkout吗

[英]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. 我想知道是否可以在这样的Stripe结帐表单上添加各种自定义字段,但我已经对其进行了测试,但是未涉及任何安全性或可兼容性问题。

<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. 这样,一旦Stripe脚本为我生成了令牌,我就可以将详细信息(例如销售的产品等)发布到我的服务器上,然后从那里进行处理。

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 PS:这将是后端的基于PHP的脚本

You should be able to add custom details through the metadata part of the charge API (or any other API for that matter). 您应该能够通过计费API(或与此相关的任何其他API)的元数据部分添加自定义详细信息。

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. 通常,在处理付款时,只需确保不将任何卡详细信息发送到服务器,仅发送从Stripe.js取回的令牌即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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