Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ jobs:
permissions:
contents: read
steps:
- uses: extractions/setup-just@v2
- uses: actions/checkout@v3
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python 3
uses: actions/setup-python@v4
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
- name: check examples w/ mypy (against python@3.13)
Expand All @@ -55,11 +57,13 @@ jobs:
permissions:
contents: read
steps:
- uses: extractions/setup-just@v2
- uses: actions/checkout@v3
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Python 3
uses: actions/setup-python@v4
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"

Expand All @@ -68,7 +72,7 @@ jobs:
just build

- name: "Upload Artifact"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dist
path: dist/
Expand Down Expand Up @@ -101,10 +105,12 @@ jobs:
# use any modern-ish version
python_version: "3.14"
steps:
- uses: extractions/setup-just@v2
- uses: actions/checkout@v3
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python_version }}
- uses: stripe/openapi/actions/stripe-mock@master
Expand All @@ -128,12 +134,15 @@ jobs:
id-token: write
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
# v8 errors on an artifact digest mismatch; v4 only warned. A mismatch
# means the artifact `test` gated on isn't the one reaching PyPI, so
# failing is right — set `digest-mismatch: warn` if it ever misfires.
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist
- name: Publish packages to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
packages-dir: dist/
- uses: stripe/openapi/actions/notify-release@master
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on: [push, pull_request]
name: Workflow security

permissions: {}

jobs:
zizmor:
name: zizmor
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2
with:
advanced-security: false
annotations: true
min-severity: high
version: 1.29.0
8 changes: 8 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Actions under the stripe namespace are unpinned on purpose.
# This is deliberately scoped to that namespace so that other actions
# still require a full commit hash.
rules:
unpinned-uses:
config:
policies:
"stripe/openapi/*": ref-pin
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,41 @@ This release changes the pinned API version to 2026-08-26.preview.
* Add support for new value `blik_recurring_payments` on enum `EventsV2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.updated_capability`
* [#1880](https://github.com/stripe/stripe-python/pull/1880) Add non-verified manged handlers

## 15.6.0 - 2026-08-26
This release changes the pinned API version to 2026-08-26.dahlia.

* [#1881](https://github.com/stripe/stripe-python/pull/1881) Add new `EventNotificationHandler` class for better thin event management

- We've been putting a lot of time into rethinking the event handling experience in the SDKs. This new class is the culmination [of that effort](https://stripe.dev/blog/event-notification-handlers-thin-events).
- They're designed for a tight coupling with both `StripeClient` and the fully-typed nature of [thin events](https://docs.stripe.com/event-destinations#thin-events). This delivers painless event destination upgrades, in-editor checks for common mistakes, and better code modularity.
- Now that we've released [thin event notifications for v1 objects](https://docs.stripe.com/changelog#2026-08-26.dahlia), these new handlers are our recommended path for all integrations using thin event notifications.
- See more detailed docs here: https://docs.stripe.com/webhooks/event-notification-handlers
- As part of this work, we've widened some of the types our webhook-related methods take so they play more nicely with the types commonly returned by popular web frameworks ([#1888](https://github.com/stripe/stripe-python/pull/1888))

* [#1876](https://github.com/stripe/stripe-python/pull/1876) Update generated code
* Add support for new resource `billing.FeedbackOption`
* Add support for `create`, `deactivate`, `list`, `modify`, and `retrieve` methods on resource `billing.FeedbackOption`
* Add support for `payment_method_settings` on `AccountSession.Component` and `AccountSessionCreateParamsComponent`
* Add support for `feedback_options` on `BillingPortal.Configuration.Feature.SubscriptionCancel.CancellationReason`, `billing_portal.ConfigurationCreateParamsFeatureSubscriptionCancelCancellationReason`, and `billing_portal.ConfigurationModifyParamsFeatureSubscriptionCancelCancellationReason`
* Add support for new value `customer_update` on enums `BillingPortal.Session.Flow.type` and `billing_portal.SessionCreateParamsFlowDatum.type`
* Add support for `customer_update` on `BillingPortal.Session.Flow`
* Add support for `funding_source_group` on `Charge.PaymentMethodDetail.Card.Wallet.Link` and `Charge.PaymentMethodDetail.Link`
* Add support for `funding_types_blocked` on `Checkout.Session.PaymentMethodOption.Card.Restriction` and `checkout.SessionCreateParamsPaymentMethodOptionCardRestriction`
* Add support for `metadata` on `ConfirmationToken`
* Add support for `active_entitlements` and `customer_portal` on `CustomerSession.Component` and `CustomerSessionCreateParamsComponent`
* Add support for `country` on `FinancialConnections.Session.Filter`
* Add support for `frozen_fields` on `InvoiceItem`
* Add support for `billie` on `Invoice.PaymentSetting.PaymentMethodOption`, `InvoiceCreateParamsPaymentSettingPaymentMethodOption`, `InvoiceModifyParamsPaymentSettingPaymentMethodOption`, `Subscription.PaymentSetting.PaymentMethodOption`, `SubscriptionCreateParamsPaymentSettingPaymentMethodOption`, and `SubscriptionModifyParamsPaymentSettingPaymentMethodOption`
* Add support for new value `billie` on enums `Invoice.PaymentSetting.payment_method_types`, `InvoiceCreateParamsPaymentSetting.payment_method_types`, `InvoiceModifyParamsPaymentSetting.payment_method_types`, `Subscription.PaymentSetting.payment_method_types`, `SubscriptionCreateParamsPaymentSetting.payment_method_types`, and `SubscriptionModifyParamsPaymentSetting.payment_method_types`
* ⚠️ Remove support for `cryptogram` on `PaymentAttemptRecord.PaymentMethodDetail.Card.ThreeDSecure` and `PaymentRecord.PaymentMethodDetail.Card.ThreeDSecure`
* Add support for new value `touch_n_go` on enums `PaymentIntent.allowed_payment_method_types`, `PaymentIntentConfirmParams.allowed_payment_method_types`, `PaymentIntentCreateParams.allowed_payment_method_types`, `PaymentIntentModifyParams.allowed_payment_method_types`, `SetupIntent.allowed_payment_method_types`, `SetupIntentConfirmParams.allowed_payment_method_types`, `SetupIntentCreateParams.allowed_payment_method_types`, and `SetupIntentModifyParams.allowed_payment_method_types`
* Change `PaymentIntent.allowed_payment_method_types` and `SetupIntent.allowed_payment_method_types` to be required
* Add support for `application_fee_amount`, `application_fee_percent`, `on_behalf_of`, and `transfer_data` on `PaymentLinkModifyParams`
* Add support for `feedback_option` on `Subscription.CancellationDetail`, `SubscriptionCancelParamsCancellationDetail`, and `SubscriptionModifyParamsCancellationDetail`
* Add support for `igic` on `Tax.Registration.CountryOption.At`, `Tax.Registration.CountryOption.Be`, `Tax.Registration.CountryOption.Bg`, `Tax.Registration.CountryOption.Cy`, `Tax.Registration.CountryOption.Cz`, `Tax.Registration.CountryOption.De`, `Tax.Registration.CountryOption.Dk`, `Tax.Registration.CountryOption.E`, `Tax.Registration.CountryOption.Ee`, `Tax.Registration.CountryOption.Fi`, `Tax.Registration.CountryOption.Fr`, `Tax.Registration.CountryOption.Gr`, `Tax.Registration.CountryOption.Hr`, `Tax.Registration.CountryOption.Hu`, `Tax.Registration.CountryOption.Ie`, `Tax.Registration.CountryOption.It`, `Tax.Registration.CountryOption.Lt`, `Tax.Registration.CountryOption.Lu`, `Tax.Registration.CountryOption.Lv`, `Tax.Registration.CountryOption.Mt`, `Tax.Registration.CountryOption.Nl`, `Tax.Registration.CountryOption.Pl`, `Tax.Registration.CountryOption.Pt`, `Tax.Registration.CountryOption.Ro`, `Tax.Registration.CountryOption.Se`, `Tax.Registration.CountryOption.Si`, `Tax.Registration.CountryOption.Sk`, `tax.RegistrationCreateParamsCountryOptionAt`, `tax.RegistrationCreateParamsCountryOptionBe`, `tax.RegistrationCreateParamsCountryOptionBg`, `tax.RegistrationCreateParamsCountryOptionCy`, `tax.RegistrationCreateParamsCountryOptionCz`, `tax.RegistrationCreateParamsCountryOptionDe`, `tax.RegistrationCreateParamsCountryOptionDk`, `tax.RegistrationCreateParamsCountryOptionE`, `tax.RegistrationCreateParamsCountryOptionEe`, `tax.RegistrationCreateParamsCountryOptionFi`, `tax.RegistrationCreateParamsCountryOptionFr`, `tax.RegistrationCreateParamsCountryOptionGr`, `tax.RegistrationCreateParamsCountryOptionHr`, `tax.RegistrationCreateParamsCountryOptionHu`, `tax.RegistrationCreateParamsCountryOptionIe`, `tax.RegistrationCreateParamsCountryOptionIt`, `tax.RegistrationCreateParamsCountryOptionLt`, `tax.RegistrationCreateParamsCountryOptionLu`, `tax.RegistrationCreateParamsCountryOptionLv`, `tax.RegistrationCreateParamsCountryOptionMt`, `tax.RegistrationCreateParamsCountryOptionNl`, `tax.RegistrationCreateParamsCountryOptionPl`, `tax.RegistrationCreateParamsCountryOptionPt`, `tax.RegistrationCreateParamsCountryOptionRo`, `tax.RegistrationCreateParamsCountryOptionSe`, `tax.RegistrationCreateParamsCountryOptionSi`, and `tax.RegistrationCreateParamsCountryOptionSk`
* Add support for new value `2026-08-26.dahlia` on enum `WebhookEndpointCreateParams.api_version`
* Add support for error codes `authentication_failure`, `capability_not_active`, `expired_payment_method`, `incorrect_postal_code`, `invalid_canceled_subscription_fields`, and `payment_method_restricted` on `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `SetupAttempt.SetupError`, `SetupIntent.LastSetupError`, `StripeError`, and `Terminal.Reader.Action.ApiError`

## 15.6.0a2 - 2026-08-19
* [#1875](https://github.com/stripe/stripe-python/pull/1875) Update generated code for private-preview
* Add support for new resources `PaymentPlan` and `billing.FeedbackOption`
Expand Down
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
baff58c9d515cdd5f5c3231d101989d588788c6f
a048e64d0832201fc86c45de6f10db62ee780bef
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2442
v2458
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,17 @@ sends by default. If you are overriding `stripe.api_version` / `stripe_version`
[webhook endpoint](https://stripe.com/docs/webhooks#api-versions) tied to an older version,
be aware that the data you see at runtime may not match the types.

### Open and Closed Enums

Many of Stripe API enums are open, meaning Stripe may add new values even on older API versions.
To reflect this, open enum fields are typed as `Union[Literal[...], str]` rather than a plain `Literal[...]`.
This ensures the field has the correct type for both values known at SDK release time and other values that may be added later.

A small number of enums are closed, meaning Stripe guarantees no new values will be added without an API version change.

Refer to the [API Reference](https://docs.stripe.com) for the latest set of allowed values.


### Public Preview SDKs

Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `bX` suffix like `12.2.0b2`.
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ typecheck: install-test-deps install-dev-deps

# ⭐ format all code
format: install-dev-deps
ruff format . --quiet
ruff format . > /dev/null

# verify formatting, but don't modify files
format-check: install-dev-deps
ruff format . --check --quiet
ruff format . --check > /dev/null

# remove venv & build artifacts
clean:
Expand Down
6 changes: 6 additions & 0 deletions stripe/_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,12 @@ class Capabilities(StripeObject):
"""
The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges.
"""
sequra_payments: Optional[
Union[Literal["active", "inactive", "pending"], str]
]
"""
The status of the SeQura capability of the account, or whether the account can directly process SeQura payments.
"""
shopeepay_payments: Optional[
Union[Literal["active", "inactive", "pending"], str]
]
Expand Down
18 changes: 18 additions & 0 deletions stripe/_account_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@ class Features(StripeObject):
features: Features
_inner_class_types = {"features": Features}

class CapitalFinancingManualPayment(StripeObject):
class Features(StripeObject):
pass

enabled: bool
"""
Whether the embedded component is enabled.
"""
features: Features
_inner_class_types = {"features": Features}

class CapitalFinancingPromotion(StripeObject):
class Features(StripeObject):
pass
Expand Down Expand Up @@ -692,6 +703,12 @@ class Features(StripeObject):
"""
capital_financing: Optional[CapitalFinancing]
capital_financing_application: Optional[CapitalFinancingApplication]
capital_financing_manual_payment: Optional[
CapitalFinancingManualPayment
]
"""
Configuration for the [Capital financing manual payment](https://docs.stripe.com/connect/supported-embedded-components/capital-financing-manual-payment/) embedded component.
"""
capital_financing_promotion: Optional[CapitalFinancingPromotion]
check_scanning: Optional[CheckScanning]
"""
Expand Down Expand Up @@ -758,6 +775,7 @@ class Features(StripeObject):
"bills": Bills,
"capital_financing": CapitalFinancing,
"capital_financing_application": CapitalFinancingApplication,
"capital_financing_manual_payment": CapitalFinancingManualPayment,
"capital_financing_promotion": CapitalFinancingPromotion,
"check_scanning": CheckScanning,
"disputes_list": DisputesList,
Expand Down
2 changes: 2 additions & 0 deletions stripe/_api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
log_debug,
log_info,
dashboard_link,
validate_path,
_convert_to_stripe_object,
get_api_mode,
)
Expand Down Expand Up @@ -658,6 +659,7 @@ def _args_for_request_with_retries(
"questions."
)

validate_path(url)
abs_url = "%s%s" % (
self._options.base_addresses.get(base_address),
url,
Expand Down
6 changes: 6 additions & 0 deletions stripe/_billing_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
CreditBalanceTransactionService,
)
from stripe.billing._credit_grant_service import CreditGrantService
from stripe.billing._feedback_option_service import FeedbackOptionService
from stripe.billing._meter_event_adjustment_service import (
MeterEventAdjustmentService,
)
Expand All @@ -35,6 +36,10 @@
"stripe.billing._credit_grant_service",
"CreditGrantService",
],
"feedback_options": [
"stripe.billing._feedback_option_service",
"FeedbackOptionService",
],
"meters": ["stripe.billing._meter_service", "MeterService"],
"meter_events": [
"stripe.billing._meter_event_service",
Expand All @@ -53,6 +58,7 @@ class BillingService(StripeService):
credit_balance_summary: "CreditBalanceSummaryService"
credit_balance_transactions: "CreditBalanceTransactionService"
credit_grants: "CreditGrantService"
feedback_options: "FeedbackOptionService"
meters: "MeterService"
meter_events: "MeterEventService"
meter_event_adjustments: "MeterEventAdjustmentService"
Expand Down
9 changes: 8 additions & 1 deletion stripe/_charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,6 @@ class ThreeDSecure(StripeObject):
Literal[
"attempt_acknowledged",
"authenticated",
"data_share_only",
"exempted",
"failed",
"not_supported",
Expand Down Expand Up @@ -2299,6 +2298,12 @@ class SepaDebit(StripeObject):
Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://docs.stripe.com/api/mandates/retrieve).
"""

class Sequra(StripeObject):
transaction_id: Optional[str]
"""
The SeQura transaction ID associated with this payment.
"""

class Shopeepay(StripeObject):
pass

Expand Down Expand Up @@ -2512,6 +2517,7 @@ class Zip(StripeObject):
scalapay: Optional[Scalapay]
sepa_credit_transfer: Optional[SepaCreditTransfer]
sepa_debit: Optional[SepaDebit]
sequra: Optional[Sequra]
shopeepay: Optional[Shopeepay]
sofort: Optional[Sofort]
stripe_account: Optional[StripeAccount]
Expand Down Expand Up @@ -2589,6 +2595,7 @@ class Zip(StripeObject):
"scalapay": Scalapay,
"sepa_credit_transfer": SepaCreditTransfer,
"sepa_debit": SepaDebit,
"sequra": Sequra,
"shopeepay": Shopeepay,
"sofort": Sofort,
"stripe_account": StripeAccount,
Expand Down
Loading