本文介绍了无法使用Braintree Payment Nonce创建订阅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Braintree Payment Nonce创建定期订阅请求。以下代码是我必须创建订阅的代码。我使用的是从客户处收到的Payment Nonce。但是订阅请求失败,并显示一条消息付款方式随机数无效。

I am using a Braintree Payment Nonce to create a recurring subscription request. The below code is what I have to create a subscription. I'm using Payment Nonce which is received from Client. But the subscription request fails with a message "Payment method nonce is invalid."

任何帮助/指针将不胜感激。

Any help/pointers would be much appreciated.

SubscriptionRequest request = new SubscriptionRequest()
                .paymentMethodNonce(customer.getPaymentNonce())
                .planId(customer.getPlan().getBraintreePlanId());
Result<Subscription> result = getGateway().subscription().create(request);


推荐答案

不幸的是,目前未记录付款方式随机数无效 验证错误;

Unfortunately the "Payment method nonce is invalid" validation error is currently undocumented; that should be fixed soon.

此错误意味着无法找到现时,因为它不存在,被锁定,已被使用,未指向拱顶在您的示例中, customer.getPaymentNonce()可能未返回有效的付款方式随机数。确保它是使用客户ID创建并已存储的,并且您不会尝试多次使用同一现时变量。

This error means that the nonce couldn't be found, due it not existing, being locked, being already used, not pointing to a vaulted card, etc. In your example, customer.getPaymentNonce() likely isn't returning a valid payment method nonce. Make sure it was created with a customer ID and vaulted, and that you're not trying to use the same nonce more than once.

这篇关于无法使用Braintree Payment Nonce创建订阅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 05:05