Skip to content
Merged
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
2 changes: 1 addition & 1 deletion API_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5a9ac40aabbc00a67ae2a186633fc8dd64b25c56
c0dacb8d26f5b7c5d68ef88b3f51d40c1eafeab7
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2103
v2124
12 changes: 12 additions & 0 deletions stripe/_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ class SupportAddress(StripeObject):
"""
Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes.
"""
specified_commercial_transactions_act_url: Optional[str]
"""
A link to the business's publicly available terms related to the Specified Commercial Transaction Act. Only used for accounts in Japan.
"""
support_address: Optional[SupportAddress]
"""
A publicly available mailing address for sending support issues to.
Expand Down Expand Up @@ -1487,6 +1491,12 @@ class Schedule(StripeObject):
"""
_inner_class_types = {"schedule": Schedule}

class PaypayPayments(StripeObject):
goods_type: Optional[Literal["digital_content", "other"]]
"""
Whether your business sells digital content or not.
"""

class SepaDebitPayments(StripeObject):
creditor_id: Optional[str]
"""
Expand Down Expand Up @@ -1527,6 +1537,7 @@ class TosAcceptance(StripeObject):
invoices: Optional[Invoices]
payments: Payments
payouts: Optional[Payouts]
paypay_payments: Optional[PaypayPayments]
sepa_debit_payments: Optional[SepaDebitPayments]
tax_forms: Optional[TaxForms]
treasury: Optional[Treasury]
Expand All @@ -1541,6 +1552,7 @@ class TosAcceptance(StripeObject):
"invoices": Invoices,
"payments": Payments,
"payouts": Payouts,
"paypay_payments": PaypayPayments,
"sepa_debit_payments": SepaDebitPayments,
"tax_forms": TaxForms,
"treasury": Treasury,
Expand Down
2 changes: 1 addition & 1 deletion stripe/_api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def _args_for_request_with_retries(
**params,
}

encoded_params = urlencode(list(_api_encode(params or {}, api_mode)))
encoded_params = urlencode(list(_api_encode(params or {})))

# Don't use strict form encoding by changing the square bracket control
# characters back to their literals. This is fine by the server, and
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 = "2025-10-29.preview"
CURRENT = "2025-11-17.preview"
4 changes: 2 additions & 2 deletions stripe/_bank_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,9 @@ class Error(StripeObject):
"""
status: str
"""
For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated.
For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, `tokenized_account_number_deactivated` or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If the status is `tokenized_account_number_deactivated`, the account utilizes a tokenized account number which has been deactivated due to expiration or revocation. This account will need to be reverified to continue using it for money movement. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated.

For external accounts, possible values are `new`, `errored` and `verification_failed`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.
For external accounts, possible values are `new`, `errored`, `verification_failed`, and `tokenized_account_number_deactivated`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.
"""

@classmethod
Expand Down
8 changes: 7 additions & 1 deletion stripe/_charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,7 @@ class Ideal(StripeObject):
"asn_bank",
"bunq",
"buut",
"finom",
"handelsbanken",
"ing",
"knab",
Expand All @@ -1289,7 +1290,7 @@ class Ideal(StripeObject):
]
]
"""
The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `finom`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
"""
bic: Optional[
Literal[
Expand All @@ -1298,6 +1299,7 @@ class Ideal(StripeObject):
"BITSNL2A",
"BUNQNL2A",
"BUUTNL2A",
"FNOMNL22",
"FVLBNL22",
"HANDNL2A",
"INGBNL2A",
Expand Down Expand Up @@ -1328,6 +1330,10 @@ class Ideal(StripeObject):
"""
Last four characters of the IBAN.
"""
transaction_id: Optional[str]
"""
Unique transaction ID generated by iDEAL.
"""
verified_name: Optional[str]
"""
Owner's verified full name. Values are verified or provided by iDEAL directly
Expand Down
5 changes: 4 additions & 1 deletion stripe/_confirmation_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ class Ideal(StripeObject):
"asn_bank",
"bunq",
"buut",
"finom",
"handelsbanken",
"ing",
"knab",
Expand All @@ -973,7 +974,7 @@ class Ideal(StripeObject):
]
]
"""
The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `finom`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
"""
bic: Optional[
Literal[
Expand All @@ -982,6 +983,7 @@ class Ideal(StripeObject):
"BITSNL2A",
"BUNQNL2A",
"BUUTNL2A",
"FNOMNL22",
"FVLBNL22",
"HANDNL2A",
"INGBNL2A",
Expand Down Expand Up @@ -1423,6 +1425,7 @@ class Blocked(StripeObject):
"bank_account_restricted",
"bank_account_unusable",
"debit_not_authorized",
"tokenized_account_number_deactivated",
]
]
"""
Expand Down
13 changes: 6 additions & 7 deletions stripe/_encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import datetime
import time
from collections import OrderedDict
from typing import Generator, Optional, Tuple, Any
from typing import Generator, Tuple, Any


def _encode_datetime(dttime: datetime.datetime):
Expand All @@ -27,26 +27,25 @@ def _json_encode_date_callback(value):
return value


def _api_encode(
data, api_mode: Optional[str]
) -> Generator[Tuple[str, Any], None, None]:
def _api_encode(data) -> Generator[Tuple[str, Any], None, None]:
for key, value in data.items():
if value is None:
continue
elif hasattr(value, "stripe_id"):
yield (key, value.stripe_id)
elif isinstance(value, list) or isinstance(value, tuple):
for i, sv in enumerate(value):
encoded_key = key if api_mode == "V2" else "%s[%d]" % (key, i)
# Always use indexed format for arrays
encoded_key = "%s[%d]" % (key, i)
if isinstance(sv, dict):
subdict = _encode_nested_dict(encoded_key, sv)
for k, v in _api_encode(subdict, api_mode):
for k, v in _api_encode(subdict):
yield (k, v)
else:
yield (encoded_key, sv)
elif isinstance(value, dict):
subdict = _encode_nested_dict(key, value)
for subkey, subvalue in _api_encode(subdict, api_mode):
for subkey, subvalue in _api_encode(subdict):
yield (subkey, subvalue)
elif isinstance(value, datetime.datetime):
yield (key, _encode_datetime(value))
Expand Down
3 changes: 3 additions & 0 deletions stripe/_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class Request(StripeObject):
"billing_portal.session.created",
"capability.updated",
"capital.financing_offer.accepted",
"capital.financing_offer.accepted_other_offer",
"capital.financing_offer.canceled",
"capital.financing_offer.created",
"capital.financing_offer.expired",
Expand Down Expand Up @@ -229,6 +230,7 @@ class Request(StripeObject):
"customer_cash_balance_transaction.created",
"entitlements.active_entitlement_summary.updated",
"file.created",
"financial_connections.account.account_numbers_updated",
"financial_connections.account.created",
"financial_connections.account.deactivated",
"financial_connections.account.disconnected",
Expand All @@ -237,6 +239,7 @@ class Request(StripeObject):
"financial_connections.account.refreshed_inferred_balances",
"financial_connections.account.refreshed_ownership",
"financial_connections.account.refreshed_transactions",
"financial_connections.account.upcoming_account_number_expiry",
"financial_connections.session.updated",
"fx_quote.expired",
"identity.verification_session.canceled",
Expand Down
6 changes: 3 additions & 3 deletions stripe/_mandate.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class Payto(StripeObject):
"""
amount_type: Literal["fixed", "maximum"]
"""
The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`.
"""
end_date: Optional[str]
"""
Expand All @@ -179,7 +179,7 @@ class Payto(StripeObject):
"weekly",
]
"""
The periodicity at which payments will be collected.
The periodicity at which payments will be collected. Defaults to `adhoc`.
"""
payments_per_period: Optional[int]
"""
Expand All @@ -201,7 +201,7 @@ class Payto(StripeObject):
]
]
"""
The purpose for which payments are made. Defaults to retail.
The purpose for which payments are made. Has a default value based on your merchant category code.
"""
start_date: Optional[str]
"""
Expand Down
2 changes: 1 addition & 1 deletion stripe/_multipart_data_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, chunk_size: int = 1028):
def add_params(self, params):
# Flatten parameters first

params = dict(_api_encode(params, "V1"))
params = dict(_api_encode(params))

for key, value in params.items():
if value is None:
Expand Down
2 changes: 1 addition & 1 deletion stripe/_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def authorize_url(
OAuth._set_client_id(params)
if "response_type" not in params:
params["response_type"] = "code"
query = urlencode(list(_api_encode(params, "V1")))
query = urlencode(list(_api_encode(params)))
url = connect_api_base + path + "?" + query
return url

Expand Down
2 changes: 1 addition & 1 deletion stripe/_oauth_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def authorize_url(
self._set_client_id(params)
if "response_type" not in params:
params["response_type"] = "code"
query = urlencode(list(_api_encode(params, "V1")))
query = urlencode(list(_api_encode(params)))

# connect_api_base will be always set to stripe.DEFAULT_CONNECT_API_BASE
# if it is not overridden on the client explicitly.
Expand Down
9 changes: 5 additions & 4 deletions stripe/_object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@
"stripe.v2.core._account_person",
"AccountPerson",
),
"v2.core.account_person_token": (
"stripe.v2.core._account_person_token",
"AccountPersonToken",
),
"v2.core.account_token": ("stripe.v2.core._account_token", "AccountToken"),
"v2.core.event": ("stripe.v2.core._event", "Event"),
"v2.core.event_destination": (
"stripe.v2.core._event_destination",
Expand Down Expand Up @@ -494,10 +499,6 @@
"stripe.v2.money_management._transaction_entry",
"TransactionEntry",
),
"v2.payments.off_session_payment": (
"stripe.v2.payments._off_session_payment",
"OffSessionPayment",
),
# V2 Object classes: The end of the section generated from our OpenAPI spec
}

Expand Down
21 changes: 15 additions & 6 deletions stripe/_payment_attempt_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,7 @@ class Ideal(StripeObject):
"asn_bank",
"bunq",
"buut",
"finom",
"handelsbanken",
"ing",
"knab",
Expand All @@ -960,7 +961,7 @@ class Ideal(StripeObject):
]
]
"""
The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `finom`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
"""
bic: Optional[
Literal[
Expand All @@ -969,6 +970,7 @@ class Ideal(StripeObject):
"BITSNL2A",
"BUNQNL2A",
"BUUTNL2A",
"FNOMNL22",
"FVLBNL22",
"HANDNL2A",
"INGBNL2A",
Expand Down Expand Up @@ -999,6 +1001,10 @@ class Ideal(StripeObject):
"""
Last four characters of the IBAN.
"""
transaction_id: Optional[str]
"""
Unique transaction ID generated by iDEAL.
"""
verified_name: Optional[str]
"""
Owner's verified full name. Values are verified or provided by iDEAL directly
Expand Down Expand Up @@ -1737,7 +1743,13 @@ class Twint(StripeObject):

class UsBankAccount(StripeObject):
account_holder_type: Optional[Literal["company", "individual"]]
"""
The type of entity that holds the account. This can be either 'individual' or 'company'.
"""
account_type: Optional[Literal["checking", "savings"]]
"""
The type of the bank account. This can be either 'checking' or 'savings'.
"""
bank_name: Optional[str]
"""
Name of the bank associated with the bank account.
Expand All @@ -1756,11 +1768,11 @@ class UsBankAccount(StripeObject):
"""
payment_reference: Optional[str]
"""
Reference number to locate ACH payments with customer's bank.
The ACH payment reference for this transaction.
"""
routing_number: Optional[str]
"""
Routing number of the bank account.
The routing number for the bank account.
"""

class Wechat(StripeObject):
Expand Down Expand Up @@ -1871,9 +1883,6 @@ class Zip(StripeObject):
It contains information specific to the payment method.
"""
us_bank_account: Optional[UsBankAccount]
"""
Details of the US Bank Account used for this payment attempt.
"""
wechat: Optional[Wechat]
wechat_pay: Optional[WechatPay]
zip: Optional[Zip]
Expand Down
6 changes: 3 additions & 3 deletions stripe/_payment_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2763,7 +2763,7 @@ class MandateOptions(StripeObject):
"""
amount_type: Optional[Literal["fixed", "maximum"]]
"""
The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`.
"""
end_date: Optional[str]
"""
Expand All @@ -2782,7 +2782,7 @@ class MandateOptions(StripeObject):
]
]
"""
The periodicity at which payments will be collected.
The periodicity at which payments will be collected. Defaults to `adhoc`.
"""
payments_per_period: Optional[int]
"""
Expand All @@ -2804,7 +2804,7 @@ class MandateOptions(StripeObject):
]
]
"""
The purpose for which payments are made. Defaults to retail.
The purpose for which payments are made. Has a default value based on your merchant category code.
"""

mandate_options: Optional[MandateOptions]
Expand Down
Loading
Loading