简体   繁体   English

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

[英]Difference between Stripe Checkout https://checkout.stripe.com/checkout.js and Elements https://js.stripe.com/v3/

I am using stripe payment to integrate with my system.我正在使用条带支付与我的系统集成。 But i did not understand a difference between this 2 library.但我不明白这两个库之间的区别。

It's seem use javascript to generate the form and pass the token to our server side.似乎使用 javascript 生成表单并将令牌传递给我们的服务器端。

<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>

And this is using with .net core这是与 .net core 一起使用的

<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>

With out checkout.js, we also use没有 checkout.js,我们也使用

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

That mean i can also use this 2 to use.这意味着我也可以使用这个 2 来使用。 And two of this script , i can handle crate token and custom, so what is the difference behavior of this 2 scripts.而这个脚本中的两个,我可以处理板条箱令牌和自定义,那么这两个脚本的不同行为是什么。

Thank you very much非常感谢

There is no difference.没有区别。 You should use the URL listed on Stripe's Checkout documentation page : https://checkout.stripe.com/checkout.js .您应该使用 Stripe 的Checkout 文档页面上列出的 URL: https://checkout.stripe.com/checkout.js : https://checkout.stripe.com/checkout.js

EDIT: It's up to you to choose whether to use Checkout or Elements to collect and tokenize customer payment data.编辑:您可以选择是使用Checkout还是Elements来收集和标记客户付款数据。 Checkout is a pre-built form that is usable immediately.结帐是一种可立即使用的预先构建的表单。 If you want to design your own custom payment form, you should use Elements instead.如果您想设计自己的自定义付款表单,则应改用 Elements。

From official documentation来自官方文档

The simplest way for you to securely collect and tokenize card information is with Checkout .安全收集和标记卡信息的最简单方法是使用Checkout

Stripe.js and Elements: If you'd prefer to have complete control over the look and feel of your payment form, you can make use of Stripe.js and Elements , our pre-built UI components. Stripe.js 和 Elements:如果您希望完全控制付款表单的外观,您可以使用我们预先构建的 UI 组件Stripe.js 和 Elements Refer to our Elements quickstart to learn more.请参阅我们的Elements 快速入门以了解更多信息。

I believe there is a difference StripeCheckout does not support the Cards API (from what I can see) StripeElements does support the older CardsAPI https://stripe.com/docs/payments/accept-a-payment-charges https://github.com/stripe-samples/card-payment-charges-api/ https://github.com/stripe-samples/accept-a-card-payment我相信有区别 StripeCheckout 不支持 Cards API(从我所见) StripeElements 确实支持较旧的 CardsAPI https://stripe.com/docs/payments/accept-a-payment-charges https://github .com/stripe-samples/card-payment-charges-api/ https://github.com/stripe-samples/accept-a-card-payment

Also, it is not clear to me how using StripeCheckout one could make use of the older Orders data model .此外,我不清楚如何使用 StripeCheckout 来利用旧的 Orders 数据模型 However, StripeCheckout says that it works with receipt generation, shipping calculations, tax calculations etc.然而,StripeCheckout 表示它适用于收据生成、运输计算、税收计算等。

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

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