【问题标题】:How can I use Behat to make a Stripe purchase with the simple form?如何使用 Behat 通过简单的表格进行 Stripe 购买?
【发布时间】:2015-09-06 06:55:43
【问题描述】:

我正在使用这个表格:

<form action="" method="POST">
    <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="YOUR PUBLIC KEY"
    data-amount="2000"
    data-name="Demo Site"
    data-description="2 widgets ($20.00)"
    data-image="/128x128.png"
    data-locale="auto">
 </script>

来自https://stripe.com/docs/tutorials/checkout

我已经考虑过制作自定义表单,但我不喜欢这种选择。所以我的问题是,有没有一种方法可以让我使用 Behat 和该表单进行 Stripe 购买?

【问题讨论】:

  • umpirsky 是对的,IMO 你应该按照他的任何建议嘲笑它。

标签: php forms laravel behat


【解决方案1】:

您可以使用 TuTu 或类似工具模拟条带服务,并在测试环境中使用 Behat。

另一种方法是创建与此服务对话的虚拟类,该类会覆盖在生产模式下执行此操作的服务,并在测试环境中使用它。

您也可以在测试环境中跳过付款。

【讨论】:

    猜你喜欢
    • 2017-02-06
    • 1970-01-01
    • 1970-01-01
    • 2020-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多