【发布时间】:2015-07-06 21:05:50
【问题描述】:
我正在尝试弄清楚如何使用 Braintree 进行测试,但我遇到了感觉像是带宽错误的情况。
response = ::Braintree::Customer.create(payment_method_nonce: Braintree::Test::Nonce::Transactable)
token = response.customer.credit_card.first.token
#so far so good
response = ::Braintree::Transaction.sale(payment_method_token: token, amount: "1.00")
#still good
response = ::Braintree::Transaction.sale(payment_method_token: token, amount: "1.00")
#response is failure
# => Braintree::ErrorResult ... status: "gateway_rejected"
所有这些都没有停顿地发生。
如果我稍等片刻,然后再次运行销售线,它就会再次起作用..
这当然会给测试脚本带来问题。我可以模拟出与 BT 的实际连接,但我对此有点担心。我应该是吗?
【问题讨论】:
标签: ruby integration-testing payment braintree