javascript - Stripe Checkout https ://checkout. stripe.com/checkout.js 和 Elements https ://js. stripe.com/v3/之间的区别

标签 javascript stripe-payments

我正在使用 Stripe 支付与我的系统集成。 但是我不明白这两个库之间的区别。

似乎使用 javascript 生成表单并将 token 传递到我们的服务器端。

<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_6pRNASCoBOKtIshFeQd4XMUh"
data-amount="2000"
data-name="Stripe.com"
data-description="2 widgets"
data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
data-locale="auto"
data-zip-code="true">
</script>

这是与 .net 核心一起使用

<script src="//checkout.stripe.com/v2/checkout.js"
class="stripe-button"
      data-key="@Stripe.Value.PublishableKey"
      data-locale="auto"
      data-description="Sample Charge"
      data-amount="500">
</script>

没有 checkout.js,我们也使用

<script src="https://js.stripe.com/v3/"></script>
<div id="payment-request-button">
 <!-- A Stripe Element will be inserted here. -->
</div>

也就是说我也可以用这个2来用。 这个脚本中的两个,我可以处理 crate token 和自定义,那么这两个脚本的行为有什么不同。

非常感谢

最佳答案

没有区别。您应该使用 Stripe 的 Checkout documentation page 中列出的 URL : https://checkout.stripe.com/checkout.js

编辑:您可以选择是否使用 CheckoutElements收集和标记客户支付数据。 Checkout 是一种可立即使用的预制表单。如果您想设计自己的自定义付款表单,则应改用 Elements。

关于javascript - Stripe Checkout https ://checkout. stripe.com/checkout.js 和 Elements https ://js. stripe.com/v3/之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46827460/

相关文章:

javascript - 在网格中使用 rowTemplate 时如何使剑道网格可编辑?

laravel - 如何禁用 Stripe 支付中的卡?仅显示 Apple Pay、Google Pay

javascript - laravel,重定向后显示模式

javascript - 使用 jQuery 更改动态创建的输入字段的值

stripe-payments - strip 错误: "you can only make test charges right now"

stripe-payments - 以编程方式注册 stripe webhooks

javascript - 来自源 'undefined' 的脚本在 CSP 中意味着什么?

javascript - Stripe Custom Checkout - 将 JS 变量传递到 amount

javascript - 带有散列密码的 php 代码无法工作

javascript - 如何使用 Jquery 将 th 动态添加到现有的 th