Skip to content

Releases: stripe/stripe-python

v8.0.0

25 Jan 17:28
Compare
Choose a tag to compare
  • #1206 stripe-python v8 release
    This release introduces StripeClient and a service-based call pattern. This new interface allows you to easily call Stripe APIs and has several benefits over the existing resource-based pattern:

    • No global config: you can simultaneously use multiple clients with different configuration options (such as API keys)
    • No static methods for easier mocking

    For full migration instructions, please refer to the v8 migration guide.

    "⚠️" symbol highlights breaking changes

    ⚠️ Changed

    • ⚠️ Request options like api_key, stripe_account, stripe_version, and idempotency_key can no longer be passed in positionally on resource methods. Please pass these in as keyword arguments.

    BEFORE

    stripe.Customer.create(
      "sk_test_123",  # api key
      "KG5LxwFBepaKHyUD",  # idempotency key
      "2022-11-15",  # stripe version
      "acct_123",  # stripe account
    )

    AFTER

    stripe.Customer.create(
      api_key="sk_test_123",
      idempotency_key="KG5LxwFBepaKHyUD",
      stripe_version="2022-11-15",
      stripe_account="acct_123",
    )
    • ⚠️ Methods that turn a response stream (Quote.pdf) now returns a single value of type StripeResponseStream instead of a tuple containing (StripeResponseStream, api_key).
    • ⚠️ Removed public access to APIRequestor. APIRequestor's main use is internal, and we don't have a good understanding of its external use cases. We had to make several breaking changes to its interface as part of this update, so rather than leaving it public we made it private. If you have a use case for APIRequestor, please open up a Github issue describing it. We'd rather you rely on something specifically designed for your use case than having to reach into the library's internals.

    ⚠️ Removed

    • ⚠️ Remove api_version from File.create parameters. Please use stripe_version instead.
    • ⚠️ Remove util.read_special_variable() utility method (importing directly from stripe.util is deprecated as of v7.8.0)
    • ⚠️ Remove StripeError.construct_error_object(). This method was intended for internal stripe-python use only.
    • ⚠️ Remove ListObject.empty_list(). This method was intended for internal stripe-python use only.
    • ⚠️ Remove SearchResultObject.empty_search_result(). This method was intended for internal stripe-python use only.
    • ⚠️ Remove StripeObject.ReprJSONEncoder. This class was intended for internal stripe-python use only.
    • ⚠️ Remove StripeObject.api_base. This property was defunct and returned None.

See the changelog for more details.

v7.14.0

25 Jan 17:10
Compare
Choose a tag to compare
  • #1199 Update generated code
    • Add support for annual_revenue and estimated_worker_count on Account.business_profile, Account.CreateParams.business_profile, and Account.UpdateParams.business_profile
    • Add support for new value registered_charity on enums Account.CreateParams.company.structure, Account.UpdateParams.company.structure, and Token.CreateParams.account.company.structure
    • Add support for collection_options on AccountLink.CreateParams
    • Add support for liability on Checkout.Session.automatic_tax, PaymentLink.automatic_tax, PaymentLink.CreateParams.automatic_tax, PaymentLink.UpdateParams.automatic_tax, Quote.automatic_tax, Quote.CreateParams.automatic_tax, Quote.UpdateParams.automatic_tax, SubscriptionSchedule.default_settings.automatic_tax, SubscriptionSchedule.phases[].automatic_tax, SubscriptionSchedule.CreateParams.default_settings.automatic_tax, SubscriptionSchedule.CreateParams.phases[].automatic_tax, SubscriptionSchedule.UpdateParams.default_settings.automatic_tax, SubscriptionSchedule.UpdateParams.phases[].automatic_tax, and checkout.Session.CreateParams.automatic_tax
    • Add support for issuer on Checkout.Session.invoice_creation.invoice_data, PaymentLink.invoice_creation.invoice_data, PaymentLink.CreateParams.invoice_creation.invoice_data, PaymentLink.UpdateParams.invoice_creation.invoice_data, Quote.invoice_settings, Quote.CreateParams.invoice_settings, Quote.UpdateParams.invoice_settings, SubscriptionSchedule.default_settings.invoice_settings, SubscriptionSchedule.phases[].invoice_settings, SubscriptionSchedule.CreateParams.default_settings.invoice_settings, SubscriptionSchedule.CreateParams.phases[].invoice_settings, SubscriptionSchedule.UpdateParams.default_settings.invoice_settings, SubscriptionSchedule.UpdateParams.phases[].invoice_settings, and checkout.Session.CreateParams.invoice_creation.invoice_data
    • Add support for invoice_settings on PaymentLink.subscription_data, PaymentLink.CreateParams.subscription_data, PaymentLink.UpdateParams.subscription_data, and checkout.Session.CreateParams.subscription_data
    • Add support for new value challenge on enums Invoice.CreateParams.payment_settings.payment_method_options.card.request_three_d_secure, Invoice.UpdateParams.payment_settings.payment_method_options.card.request_three_d_secure, Subscription.CreateParams.payment_settings.payment_method_options.card.request_three_d_secure, and Subscription.UpdateParams.payment_settings.payment_method_options.card.request_three_d_secure
    • Add support for promotion_code on Invoice.UpcomingLinesParams.discounts[], Invoice.UpcomingLinesParams.invoice_items[].discounts[], Invoice.UpcomingParams.discounts[], and Invoice.UpcomingParams.invoice_items[].discounts[]
    • Add support for account_type on PaymentMethod.UpdateParams.us_bank_account

See the changelog for more details.

v7.14.0b1

18 Jan 22:52
Compare
Choose a tag to compare
v7.14.0b1 Pre-release
Pre-release
  • #1197 Update generated code for beta
    Release specs are identical.
  • #1192 Update generated code for beta
    • Add support for new value nn on enum ConfirmationToken.PaymentMethodPreview.Ideal.bank
    • Add support for new value NNBANL2G on enum ConfirmationToken.PaymentMethodPreview.Ideal.bic
    • Change Invoice.AutomaticTax.liability, Invoice.issuer, and Subscription.AutomaticTax.liability to be required

See the changelog for more details.

v7.13.0

18 Jan 22:08
Compare
Choose a tag to compare
  • #1193 Update generated code
    • Add support for providing details about BankAccount, Card, and CardToken on Account.CreateExternalAccountParams.external_account and Account.CreateParams.external_account
    • Add support for new value nn on enums Charge.PaymentMethodDetails.Ideal.bank, PaymentIntent.ConfirmParamsPaymentMethodDataIdeal.bank, PaymentIntent.CreateParamsPaymenMethodDataIdeal.bank, PaymentIntent.UpdateParamsPaymentMethodDataIdeal.bank, PaymentMethod.Ideal.bank, PaymentMethod.CreateParamsIdeal.bank, SetupAttempt.PaymentMethodDetails.Ideal.bank, SetupIntent.ConfirmParamsPaymenMethodDataIdeal.bank, SetupIntent.CreateParamsPaymenMethodDataIdeal.bank, and SetupIntent.UpdateParamsPaymenMethodDataIdeal.bank
    • Add support for new value NNBANL2G on enums Charge.PaymentMethodDetails.Ideal.bic, PaymentMethod.Ideal.bic, and SetupAttempt.PaymentMethodDetails.Ideal.bic
    • Change CustomerSession.Components.buy_button and CustomerSession.Components.pricing_table to be required
    • Add support for issuer on Invoice.CreateParams, Invoice.UpcomingLinesParams, Invoice.UpcomingParams, Invoice.UpdateParams, and Invoice
    • Add support for liability on Invoice.automatic_tax, Invoice.CreateParams.automatic_tax, Invoice.UpcomingLinesParams.automatic_tax, Invoice.UpcomingParams.automatic_tax, Invoice.UpdateParams.automatic_tax, Subscription.automatic_tax, Subscription.CreateParams.automatic_tax, and Subscription.UpdateParams.automatic_tax
    • Add support for on_behalf_of on Invoice.UpcomingLinesParams and Invoice.UpcomingParams
    • Add support for pin on issuing.Card.CreateParams
    • Add support for revocation_reason on Mandate.PaymentMethodDetails.bacs_debit
    • Add support for customer_balance on PaymentMethodConfiguration.CreateParams, PaymentMethodConfiguration.UpdateParams, and PaymentMethodConfiguration
    • Add support for invoice_settings on Subscription.CreateParams and Subscription.UpdateParams

See the changelog for more details.

v7.13.0b1

12 Jan 18:59
Compare
Choose a tag to compare
v7.13.0b1 Pre-release
Pre-release
  • #1189 Update generated code for beta
  • #1191 Beta: report raw_request usage
  • #1165 Beta: raw_request_async with HTTPX

See the changelog for more details.

v7.12.0

12 Jan 18:13
Compare
Choose a tag to compare
  • #1188 Update generated code
    • Add support for new resource CustomerSession
    • Add support for create method on resource CustomerSession
    • Remove support for values obligation_inbound, obligation_payout_failure, obligation_payout, and obligation_reversal_outbound from enum BalanceTransaction.type
    • Add support for new values eps and p24 on enums Invoice.payment_settings.payment_method_types[], InvoiceCreateParams.payment_settings.payment_method_types[], InvoiceUpdateParams.payment_settings.payment_method_types[], Subscription.payment_settings.payment_method_types[], SubscriptionCreateParams.payment_settings.payment_method_types[], and SubscriptionUpdateParams.payment_settings.payment_method_types[]
    • Remove support for value obligation from enum Reporting.ReportRunCreateParams.parameters.reporting_category
    • Add support for billing_cycle_anchor_config on SubscriptionCreateParams and Subscription

See the changelog for more details.

v7.12.0b1

04 Jan 20:40
Compare
Choose a tag to compare
v7.12.0b1 Pre-release
Pre-release
  • #1187 Update generated code for beta
    • Updated stable APIs to the latest version

See the changelog for more details.

v7.11.0

04 Jan 19:55
Compare
Choose a tag to compare
  • #1186 Update generated code
    • Add support for retrieve on resource tax.Registration
    • Change type from Optional[PaymentDetails] to PaymentDetails of payment_details on field AccountSession.Components
    • Change type from Optional[Payments] to Payments of payments on field AccountSession.Components
    • Change type from Optional[Payouts] to Payouts of payouts on field AccountSession.Components
    • Change type from Optional[Features] to Features of features on fields AccountSession.Components.PaymentDetails, AccountSession.Components.Payments, and AccountSession.Components.Payouts
    • Change type from Optional[InvoiceSettings] to InvoiceSettings of invoice_settings on field SubscriptionSchedule.DefaultSettings

See the changelog for more details.

v7.11.0b1

22 Dec 16:43
Compare
Choose a tag to compare
v7.11.0b1 Pre-release
Pre-release
  • #1177 Update generated code for beta

See the changelog for more details.

v7.10.0

22 Dec 15:58
Compare
Choose a tag to compare
  • #1176 Update generated code

    • Add support for new resource FinancialConnections.Transaction
    • Add support for list and retrieve methods on resource Transaction
    • Add support for subscribe and unsubscribe methods on resource FinancialConnections.Account
    • Add support for features on AccountSessionCreateParams.components.payouts
    • Add support for edit_payout_schedule, instant_payouts, and standard_payouts on AccountSession.components.payouts.features
    • Change type of Checkout.Session.payment_method_options.us_bank_account.financial_connections.prefetch[], Checkout.SessionCreateParams.payment_method_options.us_bank_account.financial_connections.prefetch[], Invoice.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[], InvoiceCreateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[], InvoiceUpdateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[], PaymentIntent.payment_method_options.us_bank_account.financial_connections.prefetch[], PaymentIntentConfirmParams.payment_method_options.us_bank_account.financial_connections.prefetch[], PaymentIntentCreateParams.payment_method_options.us_bank_account.financial_connections.prefetch[], PaymentIntentUpdateParams.payment_method_options.us_bank_account.financial_connections.prefetch[], SetupIntent.payment_method_options.us_bank_account.financial_connections.prefetch[], SetupIntentConfirmParams.payment_method_options.us_bank_account.financial_connections.prefetch[], SetupIntentCreateParams.payment_method_options.us_bank_account.financial_connections.prefetch[], SetupIntentUpdateParams.payment_method_options.us_bank_account.financial_connections.prefetch[], Subscription.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[], SubscriptionCreateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[], and SubscriptionUpdateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[] from literal('balances') to enum('balances'|'transactions')
    • Add support for new value financial_connections.account.refreshed_transactions on enum Event.type
    • Add support for new value transactions on enum FinancialConnections.AccountRefreshParams.features[]
    • Add support for subscriptions and transaction_refresh on FinancialConnections.Account
    • Add support for next_refresh_available_at on FinancialConnections.Account.balance_refresh
    • Add support for new value transactions on enums FinancialConnections.Session.prefetch[] and FinancialConnections.SessionCreateParams.prefetch[]
    • Add support for new value unknown on enums Issuing.Authorization.verification_data.authentication_exemption.type and Issuing.AuthorizationCreateParams.testHelpers.verification_data.authentication_exemption.type
    • Add support for new value challenge on enums PaymentIntent.payment_method_options.card.request_three_d_secure, PaymentIntentConfirmParams.payment_method_options.card.request_three_d_secure, PaymentIntentCreateParams.payment_method_options.card.request_three_d_secure, PaymentIntentUpdateParams.payment_method_options.card.request_three_d_secure, SetupIntent.payment_method_options.card.request_three_d_secure, SetupIntentConfirmParams.payment_method_options.card.request_three_d_secure, SetupIntentCreateParams.payment_method_options.card.request_three_d_secure, and SetupIntentUpdateParams.payment_method_options.card.request_three_d_secure
    • Add support for revolut_pay on PaymentMethodConfigurationCreateParams, PaymentMethodConfigurationUpdateParams, and PaymentMethodConfiguration
    • Change type of Quote.invoice_settings from InvoiceSettingQuoteSetting | null to InvoiceSettingQuoteSetting
    • Add support for destination_details on Refund
    • Add support for new value financial_connections.account.refreshed_transactions on enums WebhookEndpointCreateParams.enabled_events[] and WebhookEndpointUpdateParams.enabled_events[]
  • #1185 Update generated code

  • #1184 Remove api_base from RequestOptions type

  • #1178 Support accessing reserved word resource properties via attribute

See the changelog for more details.