hck12685
hck12685

Reputation: 43

Braintree - 3DS and adding new default payment method for customer with an active subscription

I want to allow the customer to update their payment details used for a subscription, for example their card may expire or they may wish to use a new card.

If they have an active subscription I don't want to take a new payment from them yet obviously, so in this case is it sufficient to use Payment Method: Create to add the new payment method passing it the 3DS enriched nonce?

I know the amount which they will be charged so I can pass this amount to the 3DS challenge.

  1. Will this payment method then be safe in terms of 3DS for any future charges for this subscription assuming the amount being charged goes no higher than the amount passed to the 3DS challenge?

  2. Do I need to use Subscription: Update in any way or does setting the new payment method as default (using the makeDefault parameter when creating the payment method) guarantee that it will be used for the next payment on the subscription?

Upvotes: 1

Views: 218

Answers (1)

hck12685
hck12685

Reputation: 43

Answering my own question after figuring this out.

Using Subscription.Update is necessary, and you should pass it the 3DS enriched nonce.

It is not necessary to use Payment Method: Create, typically the recommend flow for updating a subscription would be:

  1. Vault the new payment method (without 3DS)
  2. Create a nonce from the newly Vaulted token
  3. Run verifyCard on the nonce, to get a 3DS nonce
  4. Run a Subscription.update() with the 3DS nonce (which references the Vaulted token)

For what it's worth I managed to still use the Dropin UI, for steps 1-2 then I used verifyCard in my code to initialise the 3DS challenge.

Upvotes: 2

Related Questions