Skip to content

Commit faf1f96

Browse files
Merge pull request #1819 from stripe/latest-codegen-beta
Update generated code for beta
2 parents a423e33 + 2c10dc5 commit faf1f96

179 files changed

Lines changed: 3391 additions & 3684 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,15 @@ List out the key changes made in this PR, e.g.
99

1010
### See Also
1111
<!-- Include any links or additional information that help explain this change. -->
12+
13+
## Changelog
14+
<!-- Heads up! This section should include entries for any user-facing changes.
15+
Either fill it out or remove it if there are no entries to report.
16+
17+
List changes that affect end users, e.g.
18+
- Fixes crash when calling `foo.bar()` with null argument
19+
- Adds support for new `baz` parameter on `PaymentIntent` creation
20+
21+
List breaking changes first with a ⚠️ prefix, e.g.
22+
- ⚠️ Removes deprecated `legacy_method` function
23+
-->

.github/workflows/ci.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
- name: Set up Python 3
3333
uses: actions/setup-python@v4
3434
with:
35-
python-version: "3.10"
36-
- name: check examples w/ mypy (against python@3.10)
35+
python-version: "3.13"
36+
- name: check examples w/ mypy (against python@3.13)
3737
run: just typecheck-examples
3838
# skip deps on all these since mypy installed everything
3939
- name: check linting
@@ -42,13 +42,11 @@ jobs:
4242
run: just --no-deps format-check
4343
# pyright depends on node, which it handles and installs for itself as needed
4444
# we _could_ run setup-node to make it available for it if we're having reliability problems
45-
- name: check types (all Python versions)
46-
run: |
47-
set -eox
48-
49-
for minor in {6..12}; do
50-
just --no-deps typecheck $minor
51-
done
45+
- name: check types
46+
# only check against a modern version- unit tests will catch syntax errors on older versions
47+
# this isn't user facing, this is just checking that our code is internally consistent
48+
# e.g. a bug here wouldn't cause user CI to fail since the issue is internal to our codebase
49+
run: just --no-deps typecheck
5250

5351
build:
5452
name: Build
@@ -75,10 +73,7 @@ jobs:
7573
path: dist/
7674

7775
test:
78-
# Specific ubuntu version to support python 3.7 testing
79-
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 for list of supported versions
80-
# move to ubuntu-latest when we drop 3.7
81-
runs-on: ubuntu-22.04
76+
runs-on: "ubuntu-24.04"
8277
permissions:
8378
contents: read
8479
strategy:

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,64 @@ This release changes the pinned API version to 2026-05-27.private.
2323
* Add support for new value `chaps` on enum `v2.FinancialAddressCreditSimulationCreditParams.network`
2424
* Add support for error codes `payment_method_microdeposit_processing_error` and `siret_invalid` on `QuotePreviewInvoice.LastFinalizationError`
2525

26+
## 15.2.1 - 2026-06-12
27+
* [#1825](https://github.com/stripe/stripe-python/pull/1825) Add "source" field to user-agent header
28+
29+
## 15.2.0 - 2026-05-27
30+
This release changes the pinned API version to 2026-05-27.dahlia.
31+
32+
* [#1816](https://github.com/stripe/stripe-python/pull/1816) Update generated code
33+
* Add support for new resource `v2.commerce.ProductCatalogImport`
34+
* Add support for `create` and `retrieve` methods on resource `v2.commerce.ProductCatalogImport`
35+
* Add support for `bizum_payments` and `scalapay_payments` on `Account.Capability`, `AccountCreateParamsCapability`, and `AccountModifyParamsCapability`
36+
* Add support for `automatic_transfer_rules_by_currency` on `BalanceSettings.Payment.Payout` and `BalanceSettingsModifyParamsPaymentPayout`
37+
* Add support for `start_of_day` on `BalanceSettings.Payment.SettlementTiming` and `BalanceSettingsModifyParamsPaymentSettlementTiming`
38+
* Add support for `description` on `ChargeCreateParamsTransferDatum`, `PaymentIntent.TransferDatum`, `PaymentIntentCreateParamsTransferDatum`, and `PaymentIntentModifyParamsTransferDatum`
39+
* Add support for `bizum` on `Charge.PaymentMethodDetail`, `ConfirmationToken.PaymentMethodPreview`, `ConfirmationTokenCreateParamsPaymentMethodDatum`, `PaymentAttemptRecord.PaymentMethodDetail`, `PaymentIntent.PaymentMethodOption`, `PaymentIntentConfirmParamsPaymentMethodDatum`, `PaymentIntentConfirmParamsPaymentMethodOption`, `PaymentIntentCreateParamsPaymentMethodDatum`, `PaymentIntentCreateParamsPaymentMethodOption`, `PaymentIntentModifyParamsPaymentMethodDatum`, `PaymentIntentModifyParamsPaymentMethodOption`, `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationModifyParams`, `PaymentMethodConfiguration`, `PaymentMethodCreateParams`, `PaymentMethod`, `PaymentRecord.PaymentMethodDetail`, `SetupIntent.PaymentMethodOption`, `SetupIntentConfirmParamsPaymentMethodDatum`, `SetupIntentConfirmParamsPaymentMethodOption`, `SetupIntentCreateParamsPaymentMethodDatum`, `SetupIntentCreateParamsPaymentMethodOption`, `SetupIntentModifyParamsPaymentMethodDatum`, and `SetupIntentModifyParamsPaymentMethodOption`
40+
* Add support for `scalapay` on `Charge.PaymentMethodDetail`, `Checkout.Session.PaymentMethodOption`, `ConfirmationToken.PaymentMethodPreview`, `ConfirmationTokenCreateParamsPaymentMethodDatum`, `PaymentAttemptRecord.PaymentMethodDetail`, `PaymentIntent.PaymentMethodOption`, `PaymentIntentConfirmParamsPaymentMethodDatum`, `PaymentIntentConfirmParamsPaymentMethodOption`, `PaymentIntentCreateParamsPaymentMethodDatum`, `PaymentIntentCreateParamsPaymentMethodOption`, `PaymentIntentModifyParamsPaymentMethodDatum`, `PaymentIntentModifyParamsPaymentMethodOption`, `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationModifyParams`, `PaymentMethodConfiguration`, `PaymentMethodCreateParams`, `PaymentMethod`, `PaymentRecord.PaymentMethodDetail`, `Refund.DestinationDetail`, `SetupIntentConfirmParamsPaymentMethodDatum`, `SetupIntentCreateParamsPaymentMethodDatum`, `SetupIntentModifyParamsPaymentMethodDatum`, and `checkout.SessionCreateParamsPaymentMethodOption`
41+
* Add support for `mandate` on `Charge.PaymentMethodDetail.Twint`, `PaymentAttemptRecord.PaymentMethodDetail.Twint`, and `PaymentRecord.PaymentMethodDetail.Twint`
42+
* Add support for new values `bizum` and `scalapay` on enums `PaymentIntentConfirmParams.excluded_payment_method_types`, `PaymentIntentCreateParams.excluded_payment_method_types`, `PaymentIntentModifyParams.excluded_payment_method_types`, `SetupIntentCreateParams.excluded_payment_method_types`, `SetupIntentModifyParams.excluded_payment_method_types`, and `checkout.SessionCreateParams.excluded_payment_method_types`
43+
* Change type of `PaymentIntentConfirmParamsPaymentMethodOptionTwint.setup_future_usage`, `PaymentIntentCreateParamsPaymentMethodOptionTwint.setup_future_usage`, `PaymentIntentModifyParamsPaymentMethodOptionTwint.setup_future_usage`, and `checkout.SessionCreateParamsPaymentMethodOptionTwint.setup_future_usage` from `literal('none')` to `enum('none'|'off_session')`
44+
* Add support for new values `bizum` and `scalapay` on enum `checkout.SessionCreateParams.payment_method_types`
45+
* ⚠️ Change type of `Checkout.Session.PaymentMethodOption.Twint.setup_future_usage` and `PaymentIntent.PaymentMethodOption.Twint.setup_future_usage` from `literal('none')` to `enum('none'|'off_session')`
46+
* Add support for new values `bizum` and `scalapay` on enums `ConfirmationTokenCreateParamsPaymentMethodDatum.type`, `PaymentIntentConfirmParamsPaymentMethodDatum.type`, `PaymentIntentCreateParamsPaymentMethodDatum.type`, `PaymentIntentModifyParamsPaymentMethodDatum.type`, `SetupIntentConfirmParamsPaymentMethodDatum.type`, `SetupIntentCreateParamsPaymentMethodDatum.type`, and `SetupIntentModifyParamsPaymentMethodDatum.type`
47+
* ⚠️ Add support for new values `bizum` and `scalapay` on enums `ConfirmationToken.PaymentMethodPreview.type` and `PaymentMethod.type`
48+
* Add support for new values `bizum` and `scalapay` on enums `CustomerListPaymentMethodsParams.type`, `PaymentMethodCreateParams.type`, and `PaymentMethodListParams.type`
49+
* Add support for `credited_items` on `InvoiceItem.ProrationDetail`
50+
* Add support for new value `twint` on enums `InvoiceCreateParamsPaymentSetting.payment_method_types`, `InvoiceModifyParamsPaymentSetting.payment_method_types`, `SubscriptionCreateParamsPaymentSetting.payment_method_types`, and `SubscriptionModifyParamsPaymentSetting.payment_method_types`
51+
* Add support for `discountable` on `InvoiceCreatePreviewParamsScheduleDetailPhaseAddInvoiceItem`, `SubscriptionCreateParamsAddInvoiceItem`, `SubscriptionModifyParamsAddInvoiceItem`, `SubscriptionSchedule.Phase.AddInvoiceItem`, `SubscriptionScheduleCreateParamsPhaseAddInvoiceItem`, and `SubscriptionScheduleModifyParamsPhaseAddInvoiceItem`
52+
* Add support for `billing_schedules` on `InvoiceCreatePreviewParamsSubscriptionDetail`, `SubscriptionCreateParams`, `SubscriptionModifyParams`, and `Subscription`
53+
* Add support for new value `max_billed_until` on enums `InvoiceCreatePreviewParamsSubscriptionDetail.cancel_at`, `SubscriptionCreateParams.cancel_at`, and `SubscriptionModifyParams.cancel_at`
54+
* Add support for `amount_paid_off_stripe` on `Invoice`
55+
* ⚠️ Add support for new value `twint` on enums `Invoice.PaymentSetting.payment_method_types` and `Subscription.PaymentSetting.payment_method_types`
56+
* Add support for `twint` on `Mandate.PaymentMethodDetail` and `SetupAttempt.PaymentMethodDetail`
57+
* Add support for `metadata` on `PaymentIntent.TransferDatum`, `PaymentIntentCreateParamsTransferDatum`, `PaymentIntentModifyParamsTransferDatum`, and `Subscription.PendingUpdate`
58+
* Add support for `payment_data` on `PaymentIntent.TransferDatum`, `PaymentIntentCreateParamsTransferDatum`, and `PaymentIntentModifyParamsTransferDatum`
59+
* ⚠️ Add support for new values `bizum` and `scalapay` on enums `PaymentIntent.excluded_payment_method_types` and `SetupIntent.excluded_payment_method_types`
60+
* Add support for `blik_authorize` on `PaymentIntent.NextAction` and `SetupIntent.NextAction`
61+
* Add support for `payment_method_options` on `PaymentLinkCreateParams`, `PaymentLinkModifyParams`, and `PaymentLink`
62+
* Add support for new value `bizum` on enums `PaymentLinkCreateParams.payment_method_types` and `PaymentLinkModifyParams.payment_method_types`
63+
* ⚠️ Add support for new value `bizum` on enum `PaymentLink.payment_method_types`
64+
* Add support for `active` on `PaymentMethodConfigurationListParams`
65+
* Add support for `billed_until` on `SubscriptionItem`
66+
* Add support for `discount` and `discounts` on `Subscription.PendingUpdate`
67+
* Add support for `verifone_m425`, `verifone_p630`, `verifone_ux700`, and `verifone_v660p` on `Terminal.Configuration`, `terminal.ConfigurationCreateParams`, and `terminal.ConfigurationModifyParams`
68+
* Add support for new values `simulated_verifone_m425`, `simulated_verifone_p630`, `simulated_verifone_ux700`, `simulated_verifone_v660p`, `verifone_m425`, `verifone_p630`, `verifone_ux700`, and `verifone_v660p` on enum `terminal.ReaderListParams.device_type`
69+
* Add support for `api_error` and `print_content` on `Terminal.Reader.Action`
70+
* ⚠️ Add support for new value `print_content` on enum `Terminal.Reader.Action.type`
71+
* ⚠️ Add support for new values `simulated_verifone_m425`, `simulated_verifone_p630`, `simulated_verifone_ux700`, `simulated_verifone_v660p`, `verifone_m425`, `verifone_p630`, `verifone_ux700`, and `verifone_v660p` on enum `Terminal.Reader.device_type`
72+
* Add support for `customer` on `test_helpers.TestClockCreateParams`
73+
* Add support for new value `2026-05-27.dahlia` on enum `WebhookEndpointCreateParams.api_version`
74+
* Add support for `signer` on `V2.Core.Account.Identity.BusinessDetail.Document.ProofOfRegistration`, `V2.Core.Account.Identity.BusinessDetail.Document.ProofOfUltimateBeneficialOwnership`, `v2.core.AccountCreateParamsIdentityBusinessDetailDocumentProofOfRegistration`, `v2.core.AccountCreateParamsIdentityBusinessDetailDocumentProofOfUltimateBeneficialOwnership`, `v2.core.AccountModifyParamsIdentityBusinessDetailDocumentProofOfRegistration`, `v2.core.AccountModifyParamsIdentityBusinessDetailDocumentProofOfUltimateBeneficialOwnership`, `v2.core.AccountTokenCreateParamsIdentityBusinessDetailDocumentProofOfRegistration`, and `v2.core.AccountTokenCreateParamsIdentityBusinessDetailDocumentProofOfUltimateBeneficialOwnership`
75+
* Add support for `azure_event_grid` on `V2.Core.EventDestination` and `v2.core.EventDestinationCreateParams`
76+
* ⚠️ Add support for new value `no_azure_partner_topic_exists` on enum `V2.Core.EventDestination.StatusDetail.Disabled.reason`
77+
* ⚠️ Add support for new value `azure_event_grid` on enum `V2.Core.EventDestination.type`
78+
* Add support for new value `azure_event_grid` on enum `v2.core.EventDestinationCreateParams.type`
79+
* ⚠️ Add support for new value `meter_event_value_too_many_digits` on enums `EventsV1BillingMeterErrorReportTriggeredEvent.Reason.ErrorType.code` and `EventsV1BillingMeterNoMeterFoundEvent.Reason.ErrorType.code`
80+
* Add support for event notifications `V2CommerceProductCatalogImportsFailedEvent`, `V2CommerceProductCatalogImportsProcessingEvent`, `V2CommerceProductCatalogImportsSucceededEvent`, and `V2CommerceProductCatalogImportsSucceededWithErrorsEvent` with related object `v2.commerce.ProductCatalogImport`
81+
* Add support for error codes `payment_method_microdeposit_processing_error` and `siret_invalid` on `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `SetupAttempt.SetupError`, `SetupIntent.LastSetupError`, and `StripeError`
82+
* [#1813](https://github.com/stripe/stripe-python/pull/1813) Emit warning when `stripe-notify` header is present in response
83+
2684
## 15.2.0b2 - 2026-04-24
2785
* [#1797](https://github.com/stripe/stripe-python/pull/1797) Update generated code for beta
2886
* Add support for new resources `v2.commerce.ProductCatalogImport`, `v2.data.reporting.QueryRun`, `v2.extend.WorkflowRun`, `v2.extend.Workflow`, `v2.iam.ActivityLog`, `v2.network.BusinessProfile`, and `v2.orchestrated_commerce.Agreement`

CODEGEN_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d59a1f4bdea3032b8e282d40badc032cb021fc60
1+
6012b623b1c09ad54d466947da04511a042ee45a

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2277
1+
v2324

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ stripe.add_beta_version("feature_beta", "v3")
280280

281281
### Private Preview SDKs
282282

283-
Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `aX` suffix like `12.2.0a2`. These are invite-only features. Once invited, you can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-python?tab=readme-ov-file#public-preview-sdks) above and replacing the suffix `b` with `a` in package versions.
283+
Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `aX` suffix like `12.2.0a2`. You can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-python?tab=readme-ov-file#public-preview-sdks) above and replacing the suffix `b` with `a` in package versions. Note that access to specific private preview API features may require separate approval.
284284

285285
### Custom requests
286286

@@ -354,6 +354,9 @@ New features and bug fixes are released on the latest major version of the Strip
354354
355355
## Development
356356
357+
> [!WARNING]
358+
> External contributions to this repo from first-time contributors are currently on hiatus. If you'd like to see a change made to the package, please open an issue.
359+
357360
[Contribution guidelines for this project](CONTRIBUTING.md)
358361
359362
The test suite depends on [stripe-mock], so make sure to fetch and run it from a

justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ test-one test_name: install-test-deps
2727
lint: install-dev-deps
2828
python -m flake8 --show-source stripe tests
2929

30-
# verify types. optional argument to test as of a specific minor python version (e.g. `8` to test `python 3.8`); otherwise uses current version
31-
typecheck minor_py_version="": install-test-deps install-dev-deps
30+
# verify types using current python version
31+
typecheck: install-test-deps install-dev-deps
3232
# suppress version update warnings
33-
PYRIGHT_PYTHON_IGNORE_WARNINGS=1 pyright {{ if minor_py_version == "" { "" } else { "--pythonversion 3." + minor_py_version } }}
33+
PYRIGHT_PYTHON_IGNORE_WARNINGS=1 pyright
3434

3535
# ⭐ format all code
3636
format: install-dev-deps

stripe/_api_requestor.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from io import BytesIO, IOBase
2+
import functools
3+
import hashlib
24
import json
35
import os
46
import platform
7+
import socket
58
from typing import (
69
Any,
710
AsyncIterable,
@@ -72,6 +75,19 @@
7275
_default_proxy: Optional[str] = None
7376

7477

78+
@functools.lru_cache(maxsize=None)
79+
def _get_uname_hash() -> Optional[str]:
80+
try:
81+
parts: List[str] = list(platform.uname())
82+
try:
83+
parts.append(socket.gethostname())
84+
except Exception:
85+
pass
86+
return hashlib.md5(" ".join(parts).encode()).hexdigest()
87+
except Exception:
88+
return None
89+
90+
7591
def _maybe_emit_stripe_notice(rheaders: Mapping[str, str]) -> None:
7692
notice = rheaders.get("Stripe-Notice")
7793
if notice:
@@ -561,6 +577,9 @@ def request_headers(
561577
"lang": "python",
562578
"httplib": self._get_http_client().name,
563579
}
580+
uname_hash = _get_uname_hash()
581+
if uname_hash is not None:
582+
ua["source"] = uname_hash
564583
attr_funcs: List[Tuple[str, Callable[[], str]]] = [
565584
("lang_version", platform.python_version),
566585
]

stripe/_api_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# -*- coding: utf-8 -*-
22
# File generated from our OpenAPI spec
33
class _ApiVersion:
4-
CURRENT = "2026-05-27.preview"
4+
CURRENT = "2026-06-24.preview"

0 commit comments

Comments
 (0)