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

我正在尝试测试paypal v.zero与Braintree ruby​​ gem中提供的测试nonce的集成。 注意 – 遵循paypal集成指南 。 我可以通过手动完成结账流程(输入测试paypal信息,提交订单)生成支付nonce来运行成功的授权,但Braintree提供的测试nonce失败,错误结果不包括任何错误消息“处理器拒绝“。

测试代码:

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: #, customer_details: #, subscription_details: #, updated_at: 2016-04-15 02:55:14 UTC>> 

Braintree测试nonce不应该用于paypal集成方法吗? 如果是这样,有没有人知道另一种方法来生成paypal支付nonces用于测试目的(除了手动完成结账过程)? 提前致谢。

完全披露:我为Braintree工作。

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