简体   繁体   English

带选项的条带自定义结帐

[英]Stripe Custom Checkout With Options

How can you add a size option to Stripe Custom Checkout? 如何为“条纹自定义结帐”添加大小选项? As of right now I have this for using the custom checkout with a script tag. 截至目前,我已经将其与脚本标签一起使用自定义结帐功能。

<?php
require('config.php');


?>
  <form action="charge.php" method="post">
      <script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
        data-key="<?php echo $stripe['publishable_key']?>"
        data-amount="3500"
        data-locale="auto"
        data-company="Company Name"
        data-billingAddress="true"
        data-email="true">
      </script>
  </form>

You cannot. 你不能。

This is because Stripe embeds the checkout inside an iframe element. 这是因为Stripe将结帐嵌入到iframe元素中。 It does this so that you cannot access the card details from your own js context. 这样做是为了使您无法从自己的js上下文访问卡的详细信息。 This keeps you PCI compliant without having to deal with any of that stuff. 这样可以使您符合PCI标准,而不必处理任何此类问题。

If you want a more customizable experience either tokenize the cards yourself without using their checkout. 如果您想获得更可定制的体验,请自己对卡进行标记,而无需使用结帐。 Or use the new Elements API to create a hybrid that will give you a lot more style control, with less setup and many nice to have features. 或使用新的Elements API创建一个混合体,该混合体将为您提供更多的样式控制,更少的设置和许多不错的功能。

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

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