We are using braintree's dropin UI to help save time in having to create custom payment entry pages. What is hard to understand is why you can only add new payment method and not remove. I understand being able to add, but if there was a problem with a given payment method (later on). It is there forever because the customer cannot remove a payment method. I guess the only way to remove a payment method, is for us write a custom UI (thus defeating the purpose of using the dropin UI to begin with). Is there no way for a customer to remove a payment method using the dropin UI?
-
1I work at Braintree. The drop-in UI is meant to handle the basic use cases only. You have a few choices: do a custom UI, handle payment method removal out of band (don't have it in the UI and do it manually if someone emails support asking you to), or don't allow saved payment methods to be deleted. If you have more questions, you can always [reach out to our support team](https://support.braintreepayments.com/). – agf Jan 13 '15 at 21:42
-
24Seems like Add and Delete are pretty basic use cases. Add is there. If there was a delete one could accomplish an update (by deleting then adding). So basically if your customer makes an mistake (say on his or her expiration date) or the card expires by using the dropin, your customer is basically stuck with said payment method forever. Unless you write a custom implementation, calling the API server side, which defeats the purpose of the whole "dropin" concept. maybe https://www.braintreepayments.com/features/drop-in should be updated to state, "there is no way to remove a payment method". – MacWise Jan 14 '15 at 00:46
-
I have already reached out to support they were unable to help in this matter. – MacWise Jan 14 '15 at 00:47
-
1It's certainly true that with this you can end up with payment methods in the list you don't want any more, but you can't add one that's broken -- a verification is run against the card before it's added to the list. – agf Jan 14 '15 at 17:51
-
3I don't think the "over limit", or "call the bank" verifications are ran before it is added for a customer. I know "data entry" validations are done against the card, such as invalid number. But I am testing against the sand box simulating creating error payments. And the payment method will stay in the dropin UI, for "over the limit", "stolen", "call the bank". – MacWise Jan 15 '15 at 15:07
-
2Also, now that it supports easy adding of PayPal accounts... We're seeing a lot of signs of people letting a friend add their PayPal account as a payment method: they're remarkably trusting (but this is "real" people we're talking about here), and they're setting themselves up for a fall. – jrg Feb 25 '15 at 11:53
-
2Couldn't agree more. Users should have the option of deleting a payment method. – Ryan.lay May 29 '15 at 16:08
-
4Also, even updating the expiry date of a card can't be done - and it won't let a user add the same card with a new date. We're just starting to hit that now, with real users, but we are working on migrating away from the Drop-in UI because of issues like this. – jrg Jul 15 '15 at 10:31
2 Answers
Braintree's DropIn UI doesn't allow users to remove or update saved payment method. But there's a way to do that. For example, if you have a customer profile page where they can manage their settings, you can simply add a menu that shows all the payment methods associated with the customer.
To do this, you can simply use some Braintree functions which are explained here: https://developers.braintreepayments.com/guides/payment-methods/php
The idea is to get all the payment method associated with the customer using something like:
$customer = Braintree_Customer::find('a_customer_id');
$customer->paymentMethods // array of Braintree_PaymentMethod instances
It will return an object for all the payment methods. Then you can check the response of that object from the same page by clicking the specific payment method type here (credit card, paypal...)
Once you have these values, you can display them in a table for example, and add a simply button or whatever you want to delete that payment method. To do this, you can use the following function passing the TOKEN as an argument
$result = Braintree_PaymentMethod::delete('the_token');
/*(token is a value of the object that comes from $customer->paymentMethods*/
Finally, you can check the response controlling the value of $result (true or false)
Hope this helps.

- 610
- 1
- 7
- 16
The ability to delete vaulted payment methods using the Braintree drop-in UI has been added around August 7, 2018 and is available in braintree-web-drop-in 1.12.0+. This feature is now listed in their documentation:
Name: vaultManager
Type: boolean
Attributes: optional
Default: false
Description:
Whether or not to allow a customer to delete saved payment methods when used with a client token with a customer id. Note: Deleting a payment method from Drop-in will permanently delete the payment method, so this option is not recomended for merchants using Braintree's recurring billing system. This feature is not supported in Internet Explorer 9.
To enable the "Vault Manager" (the ability to delete vaulted payment methods), set vaultManager: true
when creating the drop-in:
braintree.dropin.create({
authorization: 'CLIENT_AUTHORIZATION',
vaultManager: true,
/* your other braintree options */
})

- 986
- 17
- 24