Anthony
Anthony

Reputation: 117

JavaScript: how to use Braintree paymentMethod nonce bu

I am using Braintree v3 for a client implementation. I am using the dropin UI. I am trying to create a new vaulted card. I have an api from the backend team I’m working with to update payment method. It takes a user token in the Header and if successful, the response is a payment method nonce.

I’m just not sure what to do with this paymentMethod nonce or where to actually call the api.

Upvotes: 0

Views: 570

Answers (1)

turaco
turaco

Reputation: 86

Disclaimer: I work for Braintree. If you need a more detailed answer, please don't hesitate to reach out to Braintree Support

The flow should be as follows:

  • the server generates client token and sends it to the client
  • the client obtains customer payment method and then a payment_method_nonce and sends it to your server
  • the server receives the nonce
  • a transaction is created using the nonce

The Drop-in will display a customer's saved payment methods and automatically add any newly-entered payment methods to their Vault record if you pass a customer_id when generating a client token.

Here is the documentation on how to vault an updated payment method.

Upvotes: 1

Related Questions