paypal v.zero测试nonce失败,没有错误消息

时间:2016-04-15 18:54:39

标签: ruby testing paypal braintree

我正在尝试测试paypal v.zero与Braintree ruby​​ gem中提供的测试nonce的集成。注意 - 遵循paypal integration guide。我可以通过手动完成结账流程(输入测试paypal信息,提交订单)生成支付nonce来运行成功的授权,但测试nonces 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测试nonce不适用于paypal集成方法吗?如果是这样,是否有人知道另一种方法来生成paypal支付nonces用于测试目的(除了手动完成结账过程)?提前谢谢。

1 个答案:

答案 0 :(得分:2)

完全披露:我为Braintree工作。

您正确 - 您提到的测试用品是与Braintree直接集成的。由于您正在与PayPal集成,因此我建议您在探索测试实施的其他方法时坚持使用PayPal开发人员文档。