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
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ List out the key changes made in this PR, e.g.

### See Also
<!-- Include any links or additional information that help explain this change. -->

## Changelog
<!-- Heads up! This section should include entries for any user-facing changes.
Either fill it out or remove it if there are no entries to report.
List changes that affect end users, e.g.
- Fixes crash when calling `foo.bar()` with null argument
- Adds support for new `baz` parameter on `PaymentIntent` creation
List breaking changes first with a ⚠️ prefix, e.g.
- ⚠️ Removes deprecated `legacy_method` function
-->
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
656489921ee220b536bc00fc1c8ee7ed528f24e2
1d5fb9dc5cd047376b47f4bbb9af90300932ea60
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2290
v2291
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ stripe.add_beta_version("feature_beta", "v3")

### Private Preview SDKs

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.
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.

### Custom requests

Expand Down
16 changes: 16 additions & 0 deletions stripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ def add_beta_version(
)
from stripe._fx_quote import FxQuote as FxQuote
from stripe._fx_quote_service import FxQuoteService as FxQuoteService
from stripe._gift_card import GiftCard as GiftCard
from stripe._gift_card_operation import (
GiftCardOperation as GiftCardOperation,
)
from stripe._gift_card_operation_service import (
GiftCardOperationService as GiftCardOperationService,
)
from stripe._gift_card_service import GiftCardService as GiftCardService
from stripe._http_client import (
AIOHTTPClient as AIOHTTPClient,
HTTPClient as HTTPClient,
Expand Down Expand Up @@ -628,6 +636,8 @@ def add_beta_version(
from stripe._tax_deducted_at_source import (
TaxDeductedAtSource as TaxDeductedAtSource,
)
from stripe._tax_fund import TaxFund as TaxFund
from stripe._tax_fund_service import TaxFundService as TaxFundService
from stripe._tax_id import TaxId as TaxId
from stripe._tax_id_service import TaxIdService as TaxIdService
from stripe._tax_rate import TaxRate as TaxRate
Expand Down Expand Up @@ -880,6 +890,10 @@ def add_beta_version(
"FundingInstructions": ("stripe._funding_instructions", False),
"FxQuote": ("stripe._fx_quote", False),
"FxQuoteService": ("stripe._fx_quote_service", False),
"GiftCard": ("stripe._gift_card", False),
"GiftCardOperation": ("stripe._gift_card_operation", False),
"GiftCardOperationService": ("stripe._gift_card_operation_service", False),
"GiftCardService": ("stripe._gift_card_service", False),
"AIOHTTPClient": ("stripe._http_client", False),
"HTTPClient": ("stripe._http_client", False),
"HTTPXClient": ("stripe._http_client", False),
Expand Down Expand Up @@ -1056,6 +1070,8 @@ def add_beta_version(
"TaxCode": ("stripe._tax_code", False),
"TaxCodeService": ("stripe._tax_code_service", False),
"TaxDeductedAtSource": ("stripe._tax_deducted_at_source", False),
"TaxFund": ("stripe._tax_fund", False),
"TaxFundService": ("stripe._tax_fund_service", False),
"TaxId": ("stripe._tax_id", False),
"TaxIdService": ("stripe._tax_id_service", False),
"TaxRate": ("stripe._tax_rate", False),
Expand Down
19 changes: 19 additions & 0 deletions stripe/_api_requestor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from io import BytesIO, IOBase
import functools
import hashlib
import json
import os
import platform
import socket
from typing import (
Any,
AsyncIterable,
Expand Down Expand Up @@ -72,6 +75,19 @@
_default_proxy: Optional[str] = None


@functools.lru_cache(maxsize=None)
def _get_uname_hash() -> Optional[str]:
try:
parts: List[str] = list(platform.uname())
try:
parts.append(socket.gethostname())
except Exception:
pass
return hashlib.md5(" ".join(parts).encode()).hexdigest()
except Exception:
return None


def _maybe_emit_stripe_notice(rheaders: Mapping[str, str]) -> None:
notice = rheaders.get("Stripe-Notice")
if notice:
Expand Down Expand Up @@ -563,6 +579,9 @@ def request_headers(
"lang": "python",
"httplib": self._get_http_client().name,
}
uname_hash = _get_uname_hash()
if uname_hash is not None:
ua["source"] = uname_hash
attr_funcs: List[Tuple[str, Callable[[], str]]] = [
("lang_version", platform.python_version),
]
Expand Down
2 changes: 1 addition & 1 deletion stripe/_api_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
class _ApiVersion:
CURRENT = "2026-06-03.preview"
CURRENT = "2026-06-10.preview"
16 changes: 16 additions & 0 deletions stripe/_charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,18 @@ class AccountFunding(StripeObject):
"""

class Benefits(StripeObject):
class FrMealVoucher(StripeObject):
siret: str
"""
The 14-digit SIRET of the meal voucher acceptor used for this charge.
"""

fr_meal_voucher: Optional[FrMealVoucher]
issuer: Optional[str]
"""
Issuer of the benefit card utilized on this payment
"""
_inner_class_types = {"fr_meal_voucher": FrMealVoucher}

class Checks(StripeObject):
address_line1_check: Optional[str]
Expand Down Expand Up @@ -982,6 +990,12 @@ class ShippingAddress(StripeObject):
}

class CardPresent(StripeObject):
class Multicapture(StripeObject):
status: Literal["available", "unavailable"]
"""
Indicates whether or not multiple captures are supported.
"""

class Offline(StripeObject):
stored_at: Optional[int]
"""
Expand Down Expand Up @@ -1120,6 +1134,7 @@ class Wallet(StripeObject):
"""
ID of the [location](https://docs.stripe.com/api/terminal/locations) that this transaction's reader is assigned to.
"""
multicapture: Optional[Multicapture]
network: Optional[str]
"""
Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`.
Expand Down Expand Up @@ -1170,6 +1185,7 @@ class Wallet(StripeObject):
"""
wallet: Optional[Wallet]
_inner_class_types = {
"multicapture": Multicapture,
"offline": Offline,
"reauthorization": Reauthorization,
"receipt": Receipt,
Expand Down
8 changes: 8 additions & 0 deletions stripe/_confirmation_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ class Checks(StripeObject):
class GeneratedFrom(StripeObject):
class PaymentMethodDetails(StripeObject):
class CardPresent(StripeObject):
class Multicapture(StripeObject):
status: Literal["available", "unavailable"]
"""
Indicates whether or not multiple captures are supported.
"""

class Offline(StripeObject):
stored_at: Optional[int]
"""
Expand Down Expand Up @@ -406,6 +412,7 @@ class Wallet(StripeObject):
"""
ID of the [location](https://docs.stripe.com/api/terminal/locations) that this transaction's reader is assigned to.
"""
multicapture: Optional[Multicapture]
network: Optional[str]
"""
Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`.
Expand Down Expand Up @@ -456,6 +463,7 @@ class Wallet(StripeObject):
"""
wallet: Optional[Wallet]
_inner_class_types = {
"multicapture": Multicapture,
"offline": Offline,
"reauthorization": Reauthorization,
"receipt": Receipt,
Expand Down
Loading
Loading