我正在尝试使用 Braintree ruby gem 中提供的测试随机数来测试 paypal v.zero 集成。注意 - 在 paypal integration guide 之后.我能够使用通过手动完成结帐过程(输入测试 Paypal 信息,提交订单)生成的付款随机数运行成功的授权,但测试随机数 provided by Braintree失败并且错误结果不包含除“处理器拒绝”之外的任何错误消息。
测试代码:
braintree_gateway = Braintree::Gateway.new(
access_token: Figaro.env.BRAINTREE_ACCESS_TOKEN
)
result = braintree_gateway.transaction.sale(
amount: "10.00",
payment_method_nonce: Braintree::Test::Nonce::PayPalOneTimePayment
)
结果:
#<Braintree::ErrorResult params:{...}
errors:<>
transaction: #<Braintree::Transaction id: "ddz5mc", type: "sale", amount: "10.0", status: "processor_declined", created_at: 2016-04-15 02:55:13 UTC, credit_card_details: #<token: nil, bin: nil, last_4: nil, card_type: nil, expiration_date: "/", cardholder_name: nil, customer_location: nil, prepaid: "Unknown", healthcare: "Unknown", durbin_regulated: "Unknown", debit: "Unknown", commercial: "Unknown", payroll: "Unknown", country_of_issuance: "Unknown", issuing_bank: "Unknown", image_url: "https://assets.braintreegateway.com/payment_method_logo/unknown.png?environment=sandbox">, customer_details: #<id: nil, first_name: nil, last_name: nil, email: nil, company: nil, website: nil, phone: nil, fax: nil>, subscription_details: #<Braintree::Transaction::SubscriptionDetails:0x007f98ef8958c0 @billing_period_end_date=nil, @billing_period_start_date=nil>, updated_at: 2016-04-15 02:55:14 UTC>>
难道 Braintree 测试随机数不应该用于 paypal 集成方法吗?如果是这样,是否有人知道为测试目的生成 Paypal 支付随机数的替代方法(除了手动完成结帐过程)?提前致谢。
最佳答案
全面披露:我为 Braintree 工作。
你是对的——你提到的测试随机数是为了与 Braintree 直接集成。由于您要与 PayPal 集成,我建议您在探索其他方法来测试您的实现时坚持使用 PayPal 开发人员文档。
关于ruby - paypal v.zero 测试 nonce 失败,没有错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36654865/