最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Difference between Stripe Checkout https:checkout.stripe.comcheckout.js and Elements https:js.stripe.comv3 - Stack

programmeradmin7浏览0评论

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.

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

And this is using with core

<script src="//checkout.stripe/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

<script src="/"></script>
<div id="payment-request-button">
 <!-- A Stripe Element will be inserted here. -->
</div>

That mean i can also use this 2 to use. 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

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.

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

And this is using with core

<script src="//checkout.stripe./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

<script src="https://js.stripe./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. 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

Share Improve this question edited May 18, 2020 at 14:38 mikemaccana 123k110 gold badges427 silver badges531 bronze badges asked Oct 19, 2017 at 10:06 Cong HSCong HS 1452 silver badges9 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 13

There is no difference. You should use the URL listed on Stripe's Checkout documentation page: https://checkout.stripe./checkout.js.

EDIT: It's up to you to choose whether to use Checkout or Elements to collect and tokenize customer payment data. 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.

From official documentation

The simplest way for you to securely collect and tokenize card information is with Checkout.

Stripe.js and Elements: If you’d prefer to have plete control over the look and feel of your payment form, you can make use of Stripe.js and Elements, our pre-built UI ponents. Refer to our Elements quickstart to learn more.

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./docs/payments/accept-a-payment-charges https://github./stripe-samples/card-payment-charges-api/ https://github./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. However, StripeCheckout says that it works with receipt generation, shipping calculations, tax calculations etc.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论