Search code examples
phphttp-status-code-404braintreenonce

Braintree Subscription Payment Method Update Using Nonce From DropIn UI - 404 Not Found Error


Currently have a site utilizing PHP + JS SDK (via Drop-In UI), implementing the ability to update payment method for an existing subscription.

According to the current PHP SDK Docs, one of the fields that can be updated for a subscription is paymentMethodToken, which can be passed

by token or payment method nonce

However, after making this call (confirming I have a valid subscription ID), a Braintree_Exception_NotFound() error is thrown. Per Payment Method Documentation, this exception is thrown when a payment method cannot be located.

This suggests to me that the API does not allow for using nonce when updating subscription payment method. Am I missing something, or is the documentation just not up-to-date?

P.S. I've reviewed this and this (along w/ a few other unanswered), neither of which quite hit the mark.


Solution

  • I work at Braintree. The docs currently aren't clear on this point; I'll make sure they're corrected. Thanks for helping us find the problem. If you have more questions, feel free to reach out to our support team.

    You need to pass the nonce as paymentMethodNonce not as paymentMethodToken.