-
Notifications
You must be signed in to change notification settings - Fork 441
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
Unify request sending and result parsing logic #832
Unify request sending and result parsing logic #832
Conversation
…ng_and_result_parsing_logic
…ng_and_result_parsing_logic # Conflicts: # stripe/api_resources/account.py # stripe/api_resources/apps/secret.py # stripe/api_resources/charge.py # stripe/api_resources/checkout/session.py # stripe/api_resources/credit_note.py # stripe/api_resources/customer.py # stripe/api_resources/dispute.py # stripe/api_resources/financial_connections/account.py # stripe/api_resources/identity/verification_session.py # stripe/api_resources/invoice.py # stripe/api_resources/issuing/authorization.py # stripe/api_resources/issuing/card.py # stripe/api_resources/issuing/dispute.py # stripe/api_resources/order.py # stripe/api_resources/payment_intent.py # stripe/api_resources/payment_link.py # stripe/api_resources/payment_method.py # stripe/api_resources/payout.py # stripe/api_resources/quote.py # stripe/api_resources/refund.py # stripe/api_resources/review.py # stripe/api_resources/setup_intent.py # stripe/api_resources/subscription_schedule.py # stripe/api_resources/terminal/reader.py # stripe/api_resources/test_helpers/test_clock.py # stripe/api_resources/topup.py # stripe/api_resources/transfer.py # stripe/api_resources/treasury/financial_account.py # stripe/api_resources/treasury/inbound_transfer.py # stripe/api_resources/treasury/outbound_payment.py # stripe/api_resources/treasury/outbound_transfer.py # stripe/api_resources/treasury/received_credit.py # stripe/api_resources/treasury/received_debit.py # tests/test_generated_examples.py
r? @dcr-stripe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall! Just one comment!
method_, | ||
url_, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Why the _ suffix here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah just saw https://github.com/stripe/stripe-python/pull/832/files#diff-4656b48a9a21bc574de7c8bfb7e0aaa00241eb172da79110b30d6615685b64f3R101-R102 - can we carry over that comment here + in api_resource so we don't accidentally remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Removed some outdated tests for APIs that were removed from the next major. r? @dcr-stripe |
…ng_and_result_parsing_logic # Conflicts: # stripe/api_resources/checkout/session.py # stripe/api_resources/credit_note.py # stripe/api_resources/invoice.py # stripe/api_resources/source.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
4.0.2 - 2022-08-03 * Fix issue where auto_paging_iter failed on nested list objects. 4.0.1 - 2022-08-02 * Fix incorrect handling of additional request parameters * Fixes issue where using special parameter like `api_key`, `idempotency_key`, `stripe_version`, `stripe_account`, `headers` can cause a `Received unknown parameter error`. 4.0.0 - 2022-08-02 Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the SDK, read more detailed description at https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v4. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-08-01. "⚠️ " symbol highlights breaking changes. * API Updates * Next major release changes * API Updates. Add Price.create tests. * API Updates. Use auto-generation for credit_note and invoice methods.⚠️ Removed - Removed deprecated `AlipayAccount`, `BitcoinReceiver`, `BitcoinTransaction`, `IssuerFraudRecord`, `Recipient`, `RecipientTransfer`, and `ThreeDSecure` classes. - Removed deprecated `Charge.update_dispute` and `Charge.close_dispute` methods that were using legacy REST API endpoint. Prefer [Dispute.modify](https://stripe.com/docs/api/disputes/update?lang=python) and [Dispute.close](https://stripe.com/docs/api/disputes/close?lang=python) - Removed deprecated `Card.details` method and `CardDetails` resource. The REST API endpoint is not longer supported. - Removed the deprecated `Source.source_transactions` method. Prefer `SubscriptionItem.list_source_transactions` - Removed the deprecated `SubscriptionItem.usage_record_summaries` method. Prefer `SubscriptionItem.list_usage_record_summaries` - Removed the deprecated `Charge.refund` method. Prefer [Refund.create](https://stripe.com/docs/api/refunds/create)⚠️ Changed - To be consistent with other resource methods, `ApplicationFee.refund` returns an instance of `ApplicationFee` and doesn't mutate the instance of `ApplicationFee`. - To be consistent with other resource methods, the `Customer.delete_discount` no longer resets the `discount` property to `None` and returns the deleted discount instead. If you were relying on this behavior, reset the discount property manually: - The `LineItem` resource now inherits from `StripeObject` as it has no methods of it's own. - To be consistent with other resource methods, the `Subscription.delete_discount` returns an instance of deleted discount and doesn't mutate the instance of `Subscription`. - Update the CA certificate bundle. - Request sending logic unified across standard and custom methods (stripe/stripe-python#832)
Unify request sending logic into a single method and call it from all the places we make requests from.