8000 Merge pull request #1489 from stripe/latest-codegen-beta · stripe/stripe-python@687696d · GitHub
[go: up one dir, main page]

Skip to content

Commit 687696d

Browse files
Merge pull request #1489 from stripe/latest-codegen-beta
Update generated code for beta
2 parents 8cad2d4 + 44dab76 commit 687696d

Some content is hidden

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

57 files changed

+1817
-90
lines changed

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1648
1+
v1669

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ API.
1313

1414
See the [Python API docs](https://stripe.com/docs/api?lang=python).
1515

16-
See [video demonstrations][youtube-playlist] covering how to use the library.
17-
1816
## Installation
1917

2018
You don't need this source code unless you want to modify the package. If you just
@@ -65,6 +63,12 @@ customer = client.customers.retrieve("cus_123456789")
6563
print(customer.email)
6664
```
6765

66+
### StripeClient vs legacy pattern
67+
68+
We introduced the `StripeClient` class in v8 of the Python SDK. The legacy pattern used prior to that version is still available to use but will be marked as deprecated soon. Review the [migration guide to use StripeClient](https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v8-(StripeClient)) to move from the legacy pattern.
69+
70+
Once the legacy pattern is deprecated, new API endpoints will only be accessible in the StripeClient. While there are no current plans to remove the legacy pattern for existing API endpoints, this may change in the future.
71+
6872
### Handling exceptions
6973

7074
Unsuccessful requests raise exceptions. The class of the exception will reflect
@@ -401,7 +405,6 @@ just format
401405
[poetry]: https://github.com/sdispater/poetry
402406
[stripe-mock]: https://github.com/stripe/stripe-mock
403407
[idempotency-keys]: https://stripe.com/docs/api/idempotent_requests?lang=python
404-
[youtube-playlist]: https://www.youtube.com/playlist?list=PLy1nL-pvL2M55YVn0mGoQ5r-39A1-ZypO
405408
406409
<!--
407410
# vim: set tw=79:

deps/build-requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# packages needed to package & release
22

3-
twine
4-
setuptools
3+
# pinned to latest as of 2025-04-08; nothing special about these versions
4+
twine == 6.1.0
5+
build == 1.2.2

justfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,16 @@ format: install-dev-deps
3131
format-check: install-dev-deps
3232
ruff format . --check --quiet
3333

34-
# remove venv
34+
# remove venv & build artifacts
3535
clean:
36-
# clear old files too
37-
rm -rf {{ VENV_NAME }} venv .tox
36+
rm -rf {{ VENV_NAME }} venv .tox dist stripe.egg-info
3837

3938
# blow away and reinstall virtual env
4039
reset: clean && venv
4140

4241
# build the package for upload
4342
build: install-build-deps
44-
# --universal is deprecated, so we'll probably need to look at this eventually
45-
# given that we don't care about universal 2 and 3 packages, we probably don't need it?
46-
python -I setup.py clean --all sdist bdist_wheel --universal
43+
python -m build
4744
python -m twine check dist/*
4845

4946
# typecheck some examples w/ mypy
@@ -64,7 +61,8 @@ _install-all: install-dev-deps install-test-deps install-build-deps
6461

6562
# installs files out of a {group}-requirements.txt into the local venv; mostly used by other recipes
6663
install group: venv
67-
python -I -m pip install -r deps/{{ group }}-requirements.txt --disable-pip-version-check {{ if is_dependency() == "true" {"--quiet"} else {""} }}
64+
# always log deps in CI, but don't do it locally
65+
python -I -m pip install -r deps/{{ group }}-requirements.txt --disable-pip-version-check {{ if env("CI", "") == "true" {""} else if is_dependency() == "true" {"--quiet"} else {""} }}
6866

6967
# create a virtualenv if it doesn't exist; always installs the local package
7068
[private]

stripe/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ def __getattr__(name):
300300
gift_cards as gift_cards,
301301
identity as identity,
302302
issuing as issuing,
303+
privacy as privacy,
303304
radar as radar,
304305
reporting as reporting,
305306
sigma as sigma,
@@ -555,6 +556,7 @@ def __getattr__(name):
555556
from stripe._plan_service import PlanService as PlanService
556557
from stripe._price import Price as Price
557558
from stripe._price_service import PriceService as PriceService
559+
from stripe._privacy_service import PrivacyService as PrivacyService
558560
from stripe._product import Product as Product
559561
from stripe._product_feature import ProductFeature as ProductFeature
560562
from stripe._product_feature_service import (

stripe/_account.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,20 @@ class SupportAddress(StripeObject):
120120
"""
121121
[The merchant category code for the account](https://stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.
122122
"""
123+
minority_owned_business_designation: Optional[
124+
List[
125+
Literal[
126+
"lgbtqi_owned_business",
127+
"minority_owned_business",
128+
"none_of_these_apply",
129+
"prefer_not_to_answer",
130+
"women_owned_business",
131+
]
132+
]
133+
]
134+
"""
135+
Whether the business is a minority-owned, women-owned, and/or LGBTQI+-owned business.
136+
"""
123137
monthly_estimated_revenue: Optional[MonthlyEstimatedRevenue]
124138
name: Optional[str]
125139
"""
@@ -911,6 +925,7 @@ class Error(StripeObject):
911925
"verification_failed_residential_address",
912926
"verification_failed_tax_id_match",
913927
1241 "verification_failed_tax_id_not_issued",
928+
"verification_legal_entity_structure_mismatch",
914929
"verification_missing_directors",
915930
"verification_missing_executives",
916931
"verification_missing_owners",
@@ -1089,6 +1104,7 @@ class Error(StripeObject):
10891104
"verification_failed_residential_address",
10901105
"verification_failed_tax_id_match",
10911106
"verification_failed_tax_id_not_issued",
1107+
"verification_legal_entity_structure_mismatch",
10921108
"verification_missing_directors",
10931109
"verification_missing_executives",
10941110
"verification_missing_owners",
@@ -1650,6 +1666,20 @@ class CreateParamsBusinessProfile(TypedDict):
16501666
"""
16511667
[The merchant category code for the account](https://stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.
16521668
"""
1669+
minority_owned_business_designation: NotRequired[
1670+
List[
1671+
Literal[
1672+
"lgbtqi_owned_business",
1673+
"minority_owned_business",
1674+
"none_of_these_apply",
1675+
"prefer_not_to_answer",
1676+
"women_owned_business",
1677+
]
1678+
]
1679+
]
1680+
"""
1681+
Whether the business is a minority-owned, women-owned, and/or LGBTQI+-owned business.
1682+
"""
16531683
monthly_estimated_revenue: NotRequired[
16541684
"Account.CreateParamsBusinessProfileMonthlyEstimatedRevenue"
16551685
]

stripe/_account_service.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,20 @@ class CreateParamsBusinessProfile(TypedDict):
158158
"""
159159
[The merchant category code for the account](https://stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.
160160
"""
161+
minority_owned_business_designation: NotRequired[
162+
List[
163+
Literal[
164+
"lgbtqi_owned_business",
165+
"minority_owned_business",
166+
"none_of_these_apply",
167+
"prefer_not_to_answer",
168+
"women_owned_business",
169+
]
170+
]
171+
]
172+
"""
173+
Whether the business is a minority-owned, women-owned, and/or LGBTQI+-owned business.
174+
"""
161175
monthly_estimated_revenue: NotRequired[
162176
"AccountService.CreateParamsBusinessProfileMonthlyEstimatedRevenue"
163177
]
@@ -2292,6 +2306,20 @@ class UpdateParamsBusinessProfile(TypedDict):
22922306
"""
22932307
[The merchant category code for the account](https://stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.
22942308
"""
2309+
minority_owned_business_designation: NotRequired[
2310+
List[
2311+
Literal[
2312+
"lgbtqi_owned_business",
2313+
"minority_owned_business",
2314+
"none_of_these_apply",
2315+
"prefer_not_to_answer",
2316+
"women_owned_business",
2317+
]
2318+
]
2319+
]
2320+
"""
2321+
Whether the business is a minority-owned, women-owned, and/or LGBTQI+-owned business.
2322+
"""
22952323
monthly_estimated_revenue: NotRequired[
22962324
"AccountService.UpdateParamsBusinessProfileMonthlyEstimatedRevenue"
22972325
]

stripe/_account_session.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,12 @@ class CreateParamsComponents(TypedDict):
472472
"""
473473
Configuration for the documents embedded component.
474474
"""
475+
export_tax_transactions: NotRequired[
476+
"AccountSession.CreateParamsComponentsExportTaxTransactions"
477+
]
478+
"""
479+
Configuration for the export tax transactions embedded component.
480+
"""
475481
financial_account: NotRequired[
476482
"AccountSession.CreateParamsComponentsFinancialAccount"
477483
]
@@ -508,6 +514,12 @@ class CreateParamsComponents(TypedDict):
508514
"""
509515
Configuration for the payment details embedded component.
510516
"""
517+
payment_disputes: NotRequired[
518+
"AccountSession.CreateParamsComponentsPaymentDisputes"
519+
]
520+
"""
521+
Configuration for the payment disputes embedded component.
522+
"""
511523
payment_method_settings: NotRequired[
512524
"AccountSession.CreateParamsComponentsPaymentMethodSettings"
513525
]
@@ -754,6 +766,21 @@ class CreateParamsComponentsDocuments(TypedDict):
754766
class CreateParamsComponentsDocumentsFeatures(TypedDict):
755767
pass
756768

769+
class CreateParamsComponentsExportTaxTransactions(TypedDict):
770+
enabled: bool
771+
"""
772+
Whether the embedded component is enabled.
773+
"""
774+
features: NotRequired[
775+
"AccountSession.CreateParamsComponentsExportTaxTransactionsFeatures"
776+
]
777+
"""
778+
The list of features enabled in the embedded component.
779+
"""
780+
781+
class CreateParamsComponentsExportTaxTransactionsFeatures(TypedDict):
782+
pass
783+
757784
class CreateParamsComponentsFinancialAccount(TypedDict):
758785
enabled: bool
759786
"""
@@ -920,6 +947,32 @@ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict):
920947
Whether to allow sending refunds. This is `true` by default.
921948
"""
922949

950+
class CreateParamsComponentsPaymentDisputes(TypedDict):
951+
enabled: bool
952+
"""
953+
Whether the embedded component is enabled.
954+
"""
955+
features: NotRequired[
956+
"AccountSession.CreateParamsComponentsPaymentDisputesFeatures"
957+
]
958+
"""
959+
The list of features enabled in the embedded component.
960+
"""
961+
962+
class CreateParamsComponentsPaymentDisputesFeatures(TypedDict):
963+
destination_on_behalf_of_charge_management: NotRequired[bool]
964+
"""
965+
Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default.
966+
"""
967+
dispute_management: NotRequired[bool]
968+
"""
969+
Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default.
970+
"""
971+
refund_management: NotRequired[bool]
972+
"""
973+
Whether to allow sending refunds. This is `true` by default.
974+
"""
975+
923976
class CreateParamsComponentsPaymentMethodSettings(TypedDict):
924977
enabled: bool
925978
"""

stripe/_account_session_service.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ class CreateParamsComponents(TypedDict):
8383
"""
8484
Configuration for the documents embedded component.
8585
"""
86+
export_tax_transactions: NotRequired[
87+
"AccountSessionService.CreateParamsComponentsExportTaxTransactions"
88+
]
89+
"""
90+
Configuration for the export tax transactions embedded component.
91+
"""
8692
financial_account: NotRequired[
8793
"AccountSessionService.CreateParamsComponentsFinancialAccount"
8894
]
@@ -119,6 +125,12 @@ class CreateParamsComponents(TypedDict):
119125
"""
120126
Configuration for the payment details embedded component.
121127
"""
128+
payment_disputes: NotRequired[
129+
"AccountSessionService.CreateParamsComponentsPaymentDisputes"
130+
]
131+
"""
132+
Configuration for the payment disputes embedded component.
133+
"""
122134
payment_method_settings: NotRequired[
123135
"AccountSessionService.CreateParamsComponentsPaymentMethodSettings"
124136
]
@@ -369,6 +381,21 @@ class CreateParamsComponentsDocuments(TypedDict):
369381
class CreateParamsComponentsDocumentsFeatures(TypedDict):
370382
pass
371383

384+
class CreateParamsComponentsExportTaxTransactions(TypedDict):
385+
enabled: bool
386+
"""
387+
Whether the embedded component is enabled.
388+
"""
389+
features: NotRequired[
390+
"AccountSessionService.CreateParamsComponentsExportTaxTransactionsFeatures"
391+
]
392+
"""
393+
The list of features enabled in the embedded component.
394+
"""
395+
396+
class CreateParamsComponentsExportTaxTransactionsFeatures(TypedDict):
397+
pass
398+
372399
class CreateParamsComponentsFinancialAccount(TypedDict):
373400
enabled: bool
374401
"""
@@ -535,6 +562,32 @@ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict):
535562
Whether to allow sending refunds. This is `true` by default.
536563
"""
537564

565+
class CreateParamsComponentsPaymentDisputes(TypedDict):
566+
enabled: bool
567+
"""
568+
Whether the embedded component is enabled.
569+
"""
570+
features: NotRequired[
571+
"AccountSessionService.CreateParamsComponentsPaymentDisputesFeatures"
572+
]
573+
"""
574+
The list of features enabled in the embedded component.
575+
"""
576+
577+
class CreateParamsComponentsPaymentDisputesFeatures(TypedDict):
578+
destination_on_behalf_of_charge_management: NotRequired[bool]
579+
"""
580+
Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default.
581+
"""
582+
dispute_management: NotRequired[bool]
583+
"""
584+
Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default.
585+
"""
586+
refund_management: NotRequired[bool]
587+
"""
588+
Whether to allow sending refunds. This is `true` by default.
589+
"""
590+
538591
class CreateParamsComponentsPaymentMethodSettings(TypedDict):
539592
enabled: bool
540593
"""

stripe/_balance_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class BalanceSettings(
1313
UpdateableAPIResource["BalanceSettings"],
1414
):
1515
"""
16-
"Options for customizing account balances within Stripe."
16+
Options for customizing account balances within Stripe.
1717
"""
1818

1919
OBJECT_NAME: ClassVar[Literal["balance_settings"]] = "balance_settings"

stripe/_bank_account.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class Error(StripeObject):
124124
"verification_failed_residential_address",
125125
"verification_failed_tax_id_match",
126126
"verification_failed_tax_id_not_issued",
127+
"verification_legal_entity_structure_mismatch",
127128
"verification_missing_directors",
128129
"verification_missing_executives",
129130
"verification_missing_owners",
@@ -252,6 +253,7 @@ class Error(StripeObject):
252253
"verification_failed_residential_address",
253254
"verification_failed_tax_id_match",
254255
"verification_failed_tax_id_not_issued",
256+
"verification_legal_entity_structure_mismatch",
255257
"verification_missing_directors",
256258
"verification_missing_executives",
257259
"verification_missing_owners",

stripe/_capability.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class Error(StripeObject):
118118
"verification_failed_residential_address",
119119
"verification_failed_tax_id_match",
120120
"verification_failed_tax_id_not_issued",
121+
"verification_legal_entity_structure_mismatch",
121122
"verification_missing_directors",
122123
"verification_missing_executives",
123124
"verification_missing_owners",
@@ -285,6 +286,7 @@ class Error(StripeObject):
285286
"verification_failed_residential_address",
286287
"verification_failed_tax_id_match",
287288
"verification_failed_tax_id_not_issued",
289+
"verification_legal_entity_structure_mismatch",
288290
"verification_missing_directors",
289291
"verification_missing_executives",
290292
"verification_missing_owners",

0 commit comments

Comments
 (0)
0