Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code for beta #1355

Merged
merged 10 commits into from
Jul 5, 2024
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1104
v1116
2 changes: 1 addition & 1 deletion stripe/_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ class SearchParams(RequestOptions):
"""
next_invoice_sequence: Optional[int]
"""
The suffix of the customer's next invoice number (for example, 0001).
The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses.
"""
object: Literal["customer"]
"""
Expand Down
86 changes: 63 additions & 23 deletions stripe/_customer_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

class CustomerSession(CreateableAPIResource["CustomerSession"]):
"""
A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs)
control over a customer.
A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access
control over a Customer.
"""

OBJECT_NAME: ClassVar[Literal["customer_session"]] = "customer_session"
Expand All @@ -34,30 +34,50 @@ class BuyButton(StripeObject):

class PaymentElement(StripeObject):
class Features(StripeObject):
payment_method_allow_redisplay_filters: List[
Literal["always", "limited", "unspecified"]
]
"""
A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list.

If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"].
"""
payment_method_redisplay: Literal["disabled", "enabled"]
"""
Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`.
"""
payment_method_redisplay_limit: Optional[int]
"""
Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`.
"""
payment_method_remove: Literal["disabled", "enabled"]
"""
Controls whether the Payment Element displays the option to remove a saved payment method."
Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`.

Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods).
"""
payment_method_save: Literal["disabled", "enabled"]
"""
Controls whether the Payment Element displays a checkbox offering to save a new payment method.
Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`.

If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`.
"""
payment_method_update: Literal["disabled", "enabled"]
payment_method_save_usage: Optional[
Literal["off_session", "on_session"]
]
"""
Controls whether the Payment Element displays the option to update a saved payment method.
When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent.

When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation.
"""

enabled: bool
"""
Whether the payment element is enabled.
Whether the Payment Element is enabled.
"""
features: Optional[Features]
"""
This hash defines whether the payment element supports certain features.
This hash defines whether the Payment Element supports certain features.
"""
_inner_class_types = {"features": Features}

Expand All @@ -73,7 +93,7 @@ class PricingTable(StripeObject):
"""
payment_element: Optional[PaymentElement]
"""
This hash contains whether the payment element is enabled and the features it supports.
This hash contains whether the Payment Element is enabled and the features it supports.
"""
pricing_table: PricingTable
"""
Expand All @@ -92,7 +112,7 @@ class CreateParams(RequestOptions):
"""
customer: str
"""
The ID of an existing customer for which to create the customer session.
The ID of an existing customer for which to create the Customer Session.
"""
expand: NotRequired[List[str]]
"""
Expand All @@ -110,7 +130,7 @@ class CreateParamsComponents(TypedDict):
"CustomerSession.CreateParamsComponentsPaymentElement"
]
"""
Configuration for the payment element.
Configuration for the Payment Element.
"""
pricing_table: NotRequired[
"CustomerSession.CreateParamsComponentsPricingTable"
Expand All @@ -128,31 +148,51 @@ class CreateParamsComponentsBuyButton(TypedDict):
class CreateParamsComponentsPaymentElement(TypedDict):
enabled: bool
"""
Whether the payment element is enabled.
Whether the Payment Element is enabled.
"""
features: NotRequired[
"CustomerSession.CreateParamsComponentsPaymentElementFeatures"
]
"""
This hash defines whether the payment element supports certain features.
This hash defines whether the Payment Element supports certain features.
"""

class CreateParamsComponentsPaymentElementFeatures(TypedDict):
payment_method_allow_redisplay_filters: NotRequired[
List[Literal["always", "limited", "unspecified"]]
]
"""
A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list.

If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"].
"""
payment_method_redisplay: NotRequired[Literal["disabled", "enabled"]]
"""
Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`.
"""
payment_method_redisplay_limit: NotRequired[int]
"""
Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`.
"""
payment_method_remove: NotRequired[Literal["disabled", "enabled"]]
"""
Controls whether the Payment Element displays the option to remove a saved payment method."
Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`.

Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods).
"""
payment_method_save: NotRequired[Literal["disabled", "enabled"]]
"""
Controls whether the Payment Element displays a checkbox offering to save a new payment method.
Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`.

If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`.
"""
payment_method_update: NotRequired[Literal["disabled", "enabled"]]
payment_method_save_usage: NotRequired[
Literal["off_session", "on_session"]
]
"""
Controls whether the Payment Element displays the option to update a saved payment method.
When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent.

When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation.
"""

class CreateParamsComponentsPricingTable(TypedDict):
Expand All @@ -163,25 +203,25 @@ class CreateParamsComponentsPricingTable(TypedDict):

client_secret: str
"""
The client secret of this customer session. Used on the client to set up secure access to the given `customer`.
The client secret of this Customer Session. Used on the client to set up secure access to the given `customer`.

The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.
"""
components: Optional[Components]
"""
Configuration for the components supported by this customer session.
Configuration for the components supported by this Customer Session.
"""
created: int
"""
Time at which the object was created. Measured in seconds since the Unix epoch.
"""
customer: ExpandableField["Customer"]
"""
The customer the customer session was created for.
The Customer the Customer Session was created for.
"""
expires_at: int
"""
The timestamp at which this customer session will expire.
The timestamp at which this Customer Session will expire.
"""
livemode: bool
"""
Expand All @@ -197,7 +237,7 @@ def create(
cls, **params: Unpack["CustomerSession.CreateParams"]
) -> "CustomerSession":
"""
Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
"""
return cast(
"CustomerSession",
Expand All @@ -213,7 +253,7 @@ async def create_async(
cls, **params: Unpack["CustomerSession.CreateParams"]
) -> "CustomerSession":
"""
Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
"""
return cast(
"CustomerSession",
Expand Down
40 changes: 30 additions & 10 deletions stripe/_customer_session_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CreateParams(TypedDict):
"""
customer: str
"""
The ID of an existing customer for which to create the customer session.
The ID of an existing customer for which to create the Customer Session.
"""
expand: NotRequired[List[str]]
"""
Expand All @@ -33,7 +33,7 @@ class CreateParamsComponents(TypedDict):
"CustomerSessionService.CreateParamsComponentsPaymentElement"
]
"""
Configuration for the payment element.
Configuration for the Payment Element.
"""
pricing_table: NotRequired[
"CustomerSessionService.CreateParamsComponentsPricingTable"
Expand All @@ -51,31 +51,51 @@ class CreateParamsComponentsBuyButton(TypedDict):
class CreateParamsComponentsPaymentElement(TypedDict):
enabled: bool
"""
Whether the payment element is enabled.
Whether the Payment Element is enabled.
"""
features: NotRequired[
"CustomerSessionService.CreateParamsComponentsPaymentElementFeatures"
]
"""
This hash defines whether the payment element supports certain features.
This hash defines whether the Payment Element supports certain features.
"""

class CreateParamsComponentsPaymentElementFeatures(TypedDict):
payment_method_allow_redisplay_filters: NotRequired[
List[Literal["always", "limited", "unspecified"]]
]
"""
A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list.

If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"].
"""
payment_method_redisplay: NotRequired[Literal["disabled", "enabled"]]
"""
Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`.
"""
payment_method_redisplay_limit: NotRequired[int]
"""
Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`.
"""
payment_method_remove: NotRequired[Literal["disabled", "enabled"]]
"""
Controls whether the Payment Element displays the option to remove a saved payment method."
Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`.

Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods).
"""
payment_method_save: NotRequired[Literal["disabled", "enabled"]]
"""
Controls whether the Payment Element displays a checkbox offering to save a new payment method.
Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`.

If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`.
"""
payment_method_update: NotRequired[Literal["disabled", "enabled"]]
payment_method_save_usage: NotRequired[
Literal["off_session", "on_session"]
]
"""
Controls whether the Payment Element displays the option to update a saved payment method.
When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent.

When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation.
"""

class CreateParamsComponentsPricingTable(TypedDict):
Expand All @@ -90,7 +110,7 @@ def create(
options: RequestOptions = {},
) -> CustomerSession:
"""
Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
"""
return cast(
CustomerSession,
Expand All @@ -110,7 +130,7 @@ async def create_async(
options: RequestOptions = {},
) -> CustomerSession:
"""
Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
"""
return cast(
CustomerSession,
Expand Down
4 changes: 4 additions & 0 deletions stripe/_financial_connections_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# File generated from our OpenAPI spec
from stripe._stripe_service import StripeService
from stripe.financial_connections._account_service import AccountService
from stripe.financial_connections._institution_service import (
InstitutionService,
)
from stripe.financial_connections._session_service import SessionService
from stripe.financial_connections._transaction_service import (
TransactionService,
Expand All @@ -12,5 +15,6 @@ class FinancialConnectionsService(StripeService):
def __init__(self, requestor):
super().__init__(requestor)
self.accounts = AccountService(self._requestor)
self.institutions = InstitutionService(self._requestor)
self.sessions = SessionService(self._requestor)
self.transactions = TransactionService(self._requestor)
Loading
Loading