Skip to content

Commit

Permalink
Merge pull request #1163 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] authored Dec 8, 2023
2 parents 07e251c + cdb1c13 commit 3f8a8cd
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 43 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 7.8.1 - 2023-12-08
* [#1159](https://github.com/stripe/stripe-python/pull/1159) Fix __getattr__ to raise AttributeError rather than returning None. This fixes a regression in 7.8.0 that caused `stripe.checkout`/`stripe.issuing` etc. to return `None`.
* [#1157](https://github.com/stripe/stripe-python/pull/1157) Add missing explicit reexport for `OAuth`, `Webhook`, `WebhookSignature`

## 7.8.0 - 2023-12-07
* [#1155](https://github.com/stripe/stripe-python/pull/1155) Update generated code
* Add support for `payment_details`, `payments`, and `payouts` on `AccountSession.components` and `CreateParams.components`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v704
v708
42 changes: 0 additions & 42 deletions stripe/_account_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,6 @@ class CreateParamsComponents(TypedDict):
"""
Configuration for the account onboarding embedded component.
"""
issuing_card: NotRequired[
"AccountSession.CreateParamsComponentsIssuingCard"
]
"""
Configuration for the issuing card component.
"""
issuing_cards_list: NotRequired[
"AccountSession.CreateParamsComponentsIssuingCardsList"
]
"""
Configuration for the issuing cards list component.
"""
payment_details: NotRequired[
"AccountSession.CreateParamsComponentsPaymentDetails"
]
Expand Down Expand Up @@ -213,36 +201,6 @@ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict):
Whether to allow sending refunds. This is `true` by default.
"""

class CreateParamsComponentsIssuingCardsList(TypedDict):
enabled: bool
"""
Whether the embedded component is enabled.
"""
features: NotRequired[
"AccountSession.CreateParamsComponentsIssuingCardsListFeatures"
]
"""
The list of features enabled in the embedded component.
"""

class CreateParamsComponentsIssuingCardsListFeatures(TypedDict):
pass

class CreateParamsComponentsIssuingCard(TypedDict):
enabled: bool
"""
Whether the embedded component is enabled.
"""
features: NotRequired[
"AccountSession.CreateParamsComponentsIssuingCardFeatures"
]
"""
The list of features enabled in the embedded component.
"""

class CreateParamsComponentsIssuingCardFeatures(TypedDict):
pass

class CreateParamsComponentsAccountOnboarding(TypedDict):
enabled: bool
"""
Expand Down
63 changes: 63 additions & 0 deletions stripe/_payment_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ class Liability(StripeObject):
_inner_class_types = {"liability": Liability}

class ConsentCollection(StripeObject):
class PaymentMethodReuseAgreement(StripeObject):
position: Literal["auto", "hidden"]
"""
Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used.
When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
"""

payment_method_reuse_agreement: Optional[PaymentMethodReuseAgreement]
"""
Settings related to the payment method reuse text shown in the Checkout UI.
"""
promotions: Optional[Literal["auto", "none"]]
"""
If set to `auto`, enables the collection of customer consent for promotional communications.
Expand All @@ -96,6 +108,9 @@ class ConsentCollection(StripeObject):
"""
If set to `required`, it requires cutomers to accept the terms of service before being able to pay. If set to `none`, customers won't be shown a checkbox to accept the terms of service.
"""
_inner_class_types = {
"payment_method_reuse_agreement": PaymentMethodReuseAgreement,
}

class CustomField(StripeObject):
class Dropdown(StripeObject):
Expand Down Expand Up @@ -169,6 +184,12 @@ class Text(StripeObject):
}

class CustomText(StripeObject):
class AfterSubmit(StripeObject):
message: str
"""
Text may be up to 1200 characters in length.
"""

class ShippingAddress(StripeObject):
message: str
"""
Expand All @@ -187,6 +208,10 @@ class TermsOfServiceAcceptance(StripeObject):
Text may be up to 1200 characters in length.
"""

after_submit: Optional[AfterSubmit]
"""
Custom text that should be displayed after the payment confirmation button.
"""
shipping_address: Optional[ShippingAddress]
"""
Custom text that should be displayed alongside shipping address collection.
Expand All @@ -200,6 +225,7 @@ class TermsOfServiceAcceptance(StripeObject):
Custom text that should be displayed in place of the default terms of service agreement text.
"""
_inner_class_types = {
"after_submit": AfterSubmit,
"shipping_address": ShippingAddress,
"submit": Submit,
"terms_of_service_acceptance": TermsOfServiceAcceptance,
Expand Down Expand Up @@ -1296,6 +1322,12 @@ class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict):
"""

class CreateParamsCustomText(TypedDict):
after_submit: NotRequired[
"Literal['']|PaymentLink.CreateParamsCustomTextAfterSubmit"
]
"""
Custom text that should be displayed after the payment confirmation button.
"""
shipping_address: NotRequired[
"Literal['']|PaymentLink.CreateParamsCustomTextShippingAddress"
]
Expand Down Expand Up @@ -1333,6 +1365,12 @@ class CreateParamsCustomTextShippingAddress(TypedDict):
Text may be up to 1200 characters in length.
"""

class CreateParamsCustomTextAfterSubmit(TypedDict):
message: str
"""
Text may be up to 1200 characters in length.
"""

class CreateParamsCustomField(TypedDict):
dropdown: NotRequired["PaymentLink.CreateParamsCustomFieldDropdown"]
"""
Expand Down Expand Up @@ -1410,6 +1448,12 @@ class CreateParamsCustomFieldDropdownOption(TypedDict):
"""

class CreateParamsConsentCollection(TypedDict):
payment_method_reuse_agreement: NotRequired[
"PaymentLink.CreateParamsConsentCollectionPaymentMethodReuseAgreement"
]
"""
Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method.
"""
promotions: NotRequired["Literal['auto', 'none']"]
"""
If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout
Expand All @@ -1422,6 +1466,13 @@ class CreateParamsConsentCollection(TypedDict):
There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public).
"""

class CreateParamsConsentCollectionPaymentMethodReuseAgreement(TypedDict):
position: Literal["auto", "hidden"]
"""
Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's
defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
"""

class CreateParamsAutomaticTax(TypedDict):
enabled: bool
"""
Expand Down Expand Up @@ -2048,6 +2099,12 @@ class ModifyParamsInvoiceCreationInvoiceDataCustomField(TypedDict):
"""

class ModifyParamsCustomText(TypedDict):
after_submit: NotRequired[
"Literal['']|PaymentLink.ModifyParamsCustomTextAfterSubmit"
]
"""
Custom text that should be displayed after the payment confirmation button.
"""
shipping_address: NotRequired[
"Literal['']|PaymentLink.ModifyParamsCustomTextShippingAddress"
]
Expand Down Expand Up @@ -2085,6 +2142,12 @@ class ModifyParamsCustomTextShippingAddress(TypedDict):
Text may be up to 1200 characters in length.
"""

class ModifyParamsCustomTextAfterSubmit(TypedDict):
message: str
"""
Text may be up to 1200 characters in length.
"""

class ModifyParamsCustomField(TypedDict):
dropdown: NotRequired["PaymentLink.ModifyParamsCustomFieldDropdown"]
"""
Expand Down
51 changes: 51 additions & 0 deletions stripe/checkout/_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ class Consent(StripeObject):
"""

class ConsentCollection(StripeObject):
class PaymentMethodReuseAgreement(StripeObject):
position: Literal["auto", "hidden"]
"""
Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used.
When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
"""

payment_method_reuse_agreement: Optional[PaymentMethodReuseAgreement]
"""
If set to `hidden`, it will hide legal text related to the reuse of a payment method.
"""
promotions: Optional[Literal["auto", "none"]]
"""
If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout
Expand All @@ -130,6 +142,9 @@ class ConsentCollection(StripeObject):
"""
If set to `required`, it requires customers to accept the terms of service before being able to pay.
"""
_inner_class_types = {
"payment_method_reuse_agreement": PaymentMethodReuseAgreement,
}

class CurrencyConversion(StripeObject):
amount_subtotal: int
Expand Down Expand Up @@ -233,6 +248,12 @@ class Text(StripeObject):
}

class CustomText(StripeObject):
class AfterSubmit(StripeObject):
message: str
"""
Text may be up to 1200 characters in length.
"""

class ShippingAddress(StripeObject):
message: str
"""
Expand All @@ -251,6 +272,10 @@ class TermsOfServiceAcceptance(StripeObject):
Text may be up to 1200 characters in length.
"""

after_submit: Optional[AfterSubmit]
"""
Custom text that should be displayed after the payment confirmation button.
"""
shipping_address: Optional[ShippingAddress]
"""
Custom text that should be displayed alongside shipping address collection.
Expand All @@ -264,6 +289,7 @@ class TermsOfServiceAcceptance(StripeObject):
Custom text that should be displayed in place of the default terms of service agreement text.
"""
_inner_class_types = {
"after_submit": AfterSubmit,
"shipping_address": ShippingAddress,
"submit": Submit,
"terms_of_service_acceptance": TermsOfServiceAcceptance,
Expand Down Expand Up @@ -3152,6 +3178,12 @@ class CreateParamsCustomerUpdate(TypedDict):
"""

class CreateParamsCustomText(TypedDict):
after_submit: NotRequired[
"Literal['']|Session.CreateParamsCustomTextAfterSubmit"
]
"""
Custom text that should be displayed after the payment confirmation button.
"""
shipping_address: NotRequired[
"Literal['']|Session.CreateParamsCustomTextShippingAddress"
]
Expand Down Expand Up @@ -3187,6 +3219,12 @@ class CreateParamsCustomTextShippingAddress(TypedDict):
Text may be up to 1200 characters in length.
"""

class CreateParamsCustomTextAfterSubmit(TypedDict):
message: str
"""
Text may be up to 1200 characters in length.
"""

class CreateParamsCustomField(TypedDict):
dropdown: NotRequired["Session.CreateParamsCustomFieldDropdown"]
"""
Expand Down Expand Up @@ -3264,6 +3302,12 @@ class CreateParamsCustomFieldDropdownOption(TypedDict):
"""

class CreateParamsConsentCollection(TypedDict):
payment_method_reuse_agreement: NotRequired[
"Session.CreateParamsConsentCollectionPaymentMethodReuseAgreement"
]
"""
Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method.
"""
promotions: NotRequired["Literal['auto', 'none']"]
"""
If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout
Expand All @@ -3276,6 +3320,13 @@ class CreateParamsConsentCollection(TypedDict):
There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public).
"""

class CreateParamsConsentCollectionPaymentMethodReuseAgreement(TypedDict):
position: Literal["auto", "hidden"]
"""
Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's
defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
"""

class CreateParamsAutomaticTax(TypedDict):
enabled: bool
"""
Expand Down
17 changes: 17 additions & 0 deletions stripe/financial_connections/_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class ListParamsTransactedAt(TypedDict):
Maximum value to filter by (inclusive)
"""

class RetrieveParams(RequestOptions):
expand: NotRequired["List[str]"]
"""
Specifies which fields in the response should be expanded.
"""

account: str
"""
The ID of the Financial Connections Account this transaction belongs to.
Expand Down Expand Up @@ -159,4 +165,15 @@ def list(

return result

@classmethod
def retrieve(
cls, id: str, **params: Unpack["Transaction.RetrieveParams"]
) -> "Transaction":
"""
Retrieves the details of a Financial Connections Transaction
"""
instance = cls(id, **params)
instance.refresh()
return instance

_inner_class_types = {"status_transitions": StatusTransitions}

0 comments on commit 3f8a8cd

Please sign in to comment.