doulifang5554 2018-05-14 12:15
浏览 45
已采纳

向条带表单添加输入

I'm trying to customize the stripe checkout form but I have no idea of how to add an input. I would like to add "phone number" and "name" to create a charge AND a customer. Do you have any idea of how I can do this?

<form action="paiement.php" method="POST">
  <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-zip-code="true" 

    data-key="pk_test_uYSRAdQpdYgrGLiyrkNA3EjA"
    data-amount="999"
    data-name="Demo Site"
    data-description="Example charge"
    data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
    data-locale="auto"
    data-currency="eur"
    >
  </script>
</form>

This is the code that I'm supposed to customize.

  • 写回答

1条回答 默认 最新

  • doudui1850 2018-05-14 12:23
    关注

    You wont be able to implement those custom fields with the Stripe checkout method. According to the docs here: https://stripe.com/docs/checkout - there are no optional or mandatory fields you can add.

    You'll need to use https://stripe.com/docs/stripe-js in order to implement a custom form, process the payments on a backend, and handle the customer / charges via Stripe API. This can be done by standard HTML with your choice of backend language to process the charges and customers.

    To learn how to create charges: https://stripe.com/docs/api#charges

    To learn how to create customers: https://stripe.com/docs/api#customers

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有人能看一下我宿舍管理系统的报修功能该怎么改啊?链表那里总是越界
  • ¥15 cs loadimage运行不了,easyx也下了,没有用
  • ¥15 r包runway详细安装教程
  • ¥15 Html中读取Json文件中数据并制作表格
  • ¥15 谁有RH342练习环境
  • ¥15 STM32F407 DMA中断问题
  • ¥15 uniapp连接阿里云无法发布消息和订阅
  • ¥25 麦当劳点餐系统代码纠错
  • ¥15 轮班监督委员会问题。
  • ¥20 关于变压器的具体案例分析