Anthony
Anthony

Reputation: 117

Braintree client side paymentMethod purchase

I'm looking at the setup integration example:

braintree.dropin.create({
  authorization: 'CLIENT_AUTHORIZATION',
  container: '#dropin-container'
}, function (createErr, instance) {
  button.addEventListener('click', function () {
    instance.requestPaymentMethod(function (requestPaymentMethodErr, payload) {
      // Submit payload.nonce to your server
    });
  });
});

Would this be the same code to submit payment info to the server to update an existing subscription to a different plan or is that the method used only for new subscriptions? Is it the same call to Braintree and my server is the one responsible for what it does with it?

Upvotes: 0

Views: 44

Answers (1)

Dayne Beck
Dayne Beck

Reputation: 1

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

You can absolutely use the Drop-In UI to make a call to the API that will create or update a subscription.

That said, you will also have to build out logic on your server side to communicate with our API that you want to update a subscription. The documentation on Subscription.update() gives a detailed explanation on how to update your subscriptions using Braintree's SDKs.

Upvotes: 0

Related Questions