Cannot create subscription using Braintree Payment Nonce

懵懂的女人 提交于 2019-12-23 09:11:38

问题


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);

回答1:


I work at Braintree. I'd suggest you reach out to our support team if you have more questions.

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

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.



来源:https://stackoverflow.com/questions/24977463/cannot-create-subscription-using-braintree-payment-nonce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!