-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.51.0 -> 2.3.3 Upgrade] TypeError: quote_from_bytes() expected bytes #597
Comments
@NicolaGenesin result_charge = stripe.Charge.capture(charge.id) |
@ob-stripe thank you for quick response, I confirm you this works. Wondering why you dropped support for stripe.Charge.capture(charge) (working for 1.51.0) |
Prior to version 2.24.0, charge = stripe.Charge.retrieve("ch_123")
charge.capture() Due to the way instance methods work in Python (instance methods are really functions that accept the instance variable as their first argument), this syntax also worked: charge = stripe.Charge.retrieve("ch_123")
stripe.Charge.capture(charge) We are moving away from using instance methods and are now recommending the use of class methods instead. In version 2.24.0, we added support for calling instance methods like Python does not normally support declaring instance methods and class methods with the same name (because it would require declaring two functions with the same name). We worked around this limitation with a somewhat hacky solution (#543) that let us support both these syntaxes: charge = stripe.Charge.capture("ch_123") # class method
charge = stripe.Charge.retrieve("ch_123")
charge.capture() # instance method but it unfortunately broke support for the syntax you're using. That wasn't an intended consequence, but calling an instance method as Hope that helped! I'm leaving the issue open for now, as we might be able to restore the previous behavior, or at least provide a clearer error message. |
@ob-stripe that's helpful. Thank you for your explanation (now it makes sense to me as well) |
We just released stripe-python 2.33.2 which should restore support for the syntax you were using ( |
Python Version: 3.6
Issue after updating from stripe==1.51.0 to stripe==2.3.3
We're using the Charge APIs, separating Auth from Capture:
1) charge = stripe.Charge.create({..., capture=False}) works fine with both versions
... some time later ...
2) charge = stripe.Charge.retrieve(payment_id) works fine and returns the same exact object for both versions. This is an example using apple pay in test mode:
3) result_charge = stripe.Charge.capture(charge) fails for stripe==2.3.3 with the following error
The text was updated successfully, but these errors were encountered: