braintree / braintree_python

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

default parameter is not part of the PaymentMethodNonce object #127

Closed anu-kailash closed 3 years ago

anu-kailash commented 3 years ago

General information

Issue description

https://developers.braintreepayments.com/reference/response/payment-method-nonce/python#default The documentation describes a boolean parameter named 'default' which is not present in the nonce object returned by this SDK. I have also raised this with Braintree Support in case this is a documentation/API issue.

>>> nonce = gateway.payment_method_nonce.find('fake-valid-debit-nonce')
>>> nonce.default
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'PaymentMethodNonce' object has no attribute 'default'
>>> nonce['default']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'PaymentMethodNonce' object is not subscriptable
>>> 
hollabaq86 commented 3 years ago

👋 @anu-kailash thanks for reaching out. The payment method nonce needs to represent a payment method that's stored in your Vault, default isn't returned for payment method nonces representing single-use payment methods.

We can make our reference documentation more clear about this. I'll leave this issue open until those get updated.

hollabaq86 commented 3 years ago

Docs are updated! Closing this issue