Closed sharifyounes closed 5 years ago
I looked through the other server side sdks, and most of them do implement checks around the id existing, so we do that here too. Thanks for the report.
Feel free to open a PR if you'd like, otherwise, we'll add it to our backlog.
I believe this is fixed now. Closing.
Oh wait, it has not. Re-opening.
Opened a PR internally for this, once it gets merged in and released, I'll close this issue.
This is fixed in 3.55.0
When I do
subscription.find(user.subscription_id)
, I get this error ifuser.subscription_id==None
. I can of course change my code to:so no real issue here :)
The "offending" code is here: https://github.com/braintree/braintree_python/blob/master/braintree/subscription_gateway.py#L38
And there's possibly a similar issue here (though it might be wise not to
repr(nonce)
, I'm not sure): https://github.com/braintree/braintree_python/blob/master/braintree/credit_card_gateway.py#L58Suggesting those should be, respectively,
raise NotFoundError("subscription with id " + repr(subscription_id) + " not found")
raise NotFoundError("payment method with nonce " + repr(nonce) + " locked, consumed or not found")
Tests:
For
test_subscription.py
:For
test_credit_card.py
: