我正在尝试整合条纹检查 . 为此,我正在遵循此文档:

https://stripe.com/docs/recipes/subscription-signup#creating-the-signup-form-using-checkout

所以我在表单中粘贴了 <script> 标签,如:

<form action="/create_subscription.php" method="POST">
  <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="pk_test_lrpNHu3jIKBoBo2ZLZ8dzzBh"
    data-image="images/marketplace.png"
    data-name="Emma's Farm CSA"
    data-description="Subscription for 1 weekly box"
    data-amount="2000"
    data-label="Sign Me Up!">
  </script>
</form>

该文档说,当用户点击“注册”按钮时,它应该打开一个弹出询问卡详细信息,但不是直接提交表单 .

我很确定Stripe密钥与此无关,但我仍然使用了正确的密钥 . 此外,控制台上没有任何Javascript错误 .

我几乎在互联网上搜索了一切,但仍然没有运气 .

PS:我在http而非https,不确定是否可能是问题 .

EDIT:

我认为问题是在HTTP而不是HTTPS上运行,如下所述:

https://stripe.com/docs/checkout#does-checkout-require-https

但是现在我不认为这可能是问题,因为它在HTTP上正常工作:

http://demo.ilovephp.net/stripe/stripe_pay_checkout_demo.php

EDIT:

我发现了这个问题:Laravel的默认app.js正在使用Stripe的checkout.js . 没有app.js它工作正常 .

https://laracasts.com/discuss/channels/laravel/issue-with-stripe-api-js-and-laravel-js?page=1

我仍然没有得到一个很好的解决方案 .

谢谢