braintree / braintree_python

Braintree Python library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
241 stars 155 forks source link

Cannot Update CreditCard as default payment method to FALSE #123

Closed TheAshwanik closed 3 years ago

TheAshwanik commented 3 years ago

General information

Issue description

i am able to update a credit card as default payment method for the selected customer using this code.

result = braintree.CreditCard.update(token,{
         "options": {
                       "make_default": True,
         },
})

But I am not able to make same card as non_default . This does not work:

result = braintree.CreditCard.update(token,{
         "options": {
                       "make_default": False,
         },
})

I have some assumption , just wanted to check. Is it not working because there must be one creditCard set as default? and by make it false, it does not allow me?

Does it mean - make_default can only make some payment method as True and not False?

TheAshwanik commented 3 years ago

And It does not work with the update PaymentMethod also.

result = braintree.PaymentMethod.update( token, {
        "options": {
                  "make_default": False
               }
    })
hollabaq86 commented 3 years ago

👋 @TheAshwanik, thanks for reaching out. You are correct - make_default: false has no effect, the same as if you were not including that parameter at all in your calls.

At least one payment method must be the default- if you want to make sure a payment method is not the default, you have to make a different payment method the default (i.e. pass make_default: true on a different one).

If you have additional questions about this parameter, please contact Support.

TheAshwanik commented 3 years ago

Thanks.. it would help if the documentation is updated to mention that true is only accepted value. Thanks for the great work.

crookedneighbor commented 3 years ago

At the bottom of every docs page is a "Send Feedback" button, so if you think the documentation needs improving, that's the best way to get in contact with our documentation team. https://developers.braintreepayments.com/reference/request/payment-method/update/#feedback-link