From dc8b8118bae06818862af3f9a3830dcb99982faf Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 19:34:16 +0000 Subject: [PATCH] Update generated code (#1255) * Update generated code for v841 * Update generated code for v845 * Update generated code for v849 * Update generated code for v850 * Update generated code for v851 * Update generated code for v852 * Update generated code for v853 * Update generated code for v855 * Update generated code for v857 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_bank_account.py | 2 +- stripe/_charge.py | 65 ++++++++++++++++++++++++ stripe/_invoice.py | 8 +++ stripe/_invoice_service.py | 8 +++ stripe/_payment_link.py | 12 ++--- stripe/_payment_link_service.py | 8 +-- stripe/_refund.py | 41 ++++++++++++++- stripe/_token.py | 6 ++- stripe/_token_service.py | 6 ++- stripe/checkout/_session.py | 18 +++---- stripe/checkout/_session_service.py | 8 +-- stripe/identity/_verification_report.py | 2 +- stripe/identity/_verification_session.py | 2 +- stripe/terminal/_reader.py | 41 ++++++++++++++- stripe/terminal/_reader_service.py | 21 +++++++- 16 files changed, 216 insertions(+), 34 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e3b365910..148e3ec37 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v840 \ No newline at end of file +v857 \ No newline at end of file diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index 6c5d6e236..9f253c840 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -355,7 +355,7 @@ class DeleteParams(RequestOptions): """ 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 external accounts, possible values are `new`, `errored` and `verification_failed`. If a payouts fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In 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` 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. """ deleted: Optional[Literal[True]] """ diff --git a/stripe/_charge.py b/stripe/_charge.py index ff4341274..dcc1f47af 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -4,6 +4,7 @@ from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource +from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource @@ -46,6 +47,7 @@ from stripe._transfer import Transfer +@nested_resource_class_methods("refund") class Charge( CreateableAPIResource["Charge"], ListableAPIResource["Charge"], @@ -1927,6 +1929,24 @@ class ListParamsCreated(TypedDict): Maximum value to filter by (inclusive) """ + class ListRefundsParams(RequestOptions): + ending_before: NotRequired["str"] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired["int"] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired["str"] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + class ModifyParams(RequestOptions): customer: NotRequired["str"] """ @@ -2021,6 +2041,12 @@ class RetrieveParams(RequestOptions): Specifies which fields in the response should be expanded. """ + class RetrieveRefundParams(RequestOptions): + expand: NotRequired["List[str]"] + """ + Specifies which fields in the response should be expanded. + """ + class SearchParams(RequestOptions): expand: NotRequired["List[str]"] """ @@ -2398,6 +2424,45 @@ def mark_as_safe(self, idempotency_key=None) -> "Charge": self._request_and_refresh("post", url, params) return self + @classmethod + def retrieve_refund( + cls, + charge: str, + refund: str, + **params: Unpack["Charge.RetrieveRefundParams"] + ) -> "Refund": + """ + Retrieves the details of an existing refund. + """ + return cast( + "Refund", + cls._static_request( + "get", + "/v1/charges/{charge}/refunds/{refund}".format( + charge=sanitize_id(charge), refund=sanitize_id(refund) + ), + params=params, + ), + ) + + @classmethod + def list_refunds( + cls, charge: str, **params: Unpack["Charge.ListRefundsParams"] + ) -> ListObject["Refund"]: + """ + You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. + """ + return cast( + ListObject["Refund"], + cls._static_request( + "get", + "/v1/charges/{charge}/refunds".format( + charge=sanitize_id(charge) + ), + params=params, + ), + ) + _inner_class_types = { "billing_details": BillingDetails, "fraud_details": FraudDetails, diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 1a4c51108..00f080b2a 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -1059,6 +1059,10 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + number: NotRequired["str"] + """ + Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. + """ on_behalf_of: NotRequired["str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. @@ -1736,6 +1740,10 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + number: NotRequired["Literal['']|str"] + """ + Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. + """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 69cb98fa5..8824ff44f 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -109,6 +109,10 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + number: NotRequired["str"] + """ + Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. + """ on_behalf_of: NotRequired["str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. @@ -1400,6 +1404,10 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + number: NotRequired["Literal['']|str"] + """ + Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. + """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 7cfb0d096..bae3f7821 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -702,7 +702,7 @@ class CreateParams(RequestOptions): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Configuration for collecting the customer's billing address. + Configuration for collecting the customer's billing address. Defaults to `auto`. """ consent_collection: NotRequired[ "PaymentLink.CreateParamsConsentCollection" @@ -764,7 +764,7 @@ class CreateParams(RequestOptions): """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ @@ -1576,7 +1576,7 @@ class ModifyParams(RequestOptions): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Configuration for collecting the customer's billing address. + Configuration for collecting the customer's billing address. Defaults to `auto`. """ custom_fields: NotRequired[ "Literal['']|List[PaymentLink.ModifyParamsCustomField]" @@ -1626,7 +1626,7 @@ class ModifyParams(RequestOptions): """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ @@ -2296,7 +2296,7 @@ class RetrieveParams(RequestOptions): automatic_tax: AutomaticTax billing_address_collection: Literal["auto", "required"] """ - Configuration for collecting the customer's billing address. + Configuration for collecting the customer's billing address. Defaults to `auto`. """ consent_collection: Optional[ConsentCollection] """ @@ -2353,7 +2353,7 @@ class RetrieveParams(RequestOptions): """ payment_method_collection: Literal["always", "if_required"] """ - Configuration for collecting a payment method during checkout. + Configuration for collecting a payment method during checkout. Defaults to `always`. """ payment_method_types: Optional[ List[ diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 7794ba179..3242dfe95 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -42,7 +42,7 @@ class CreateParams(TypedDict): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Configuration for collecting the customer's billing address. + Configuration for collecting the customer's billing address. Defaults to `auto`. """ consent_collection: NotRequired[ "PaymentLinkService.CreateParamsConsentCollection" @@ -106,7 +106,7 @@ class CreateParams(TypedDict): """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ @@ -920,7 +920,7 @@ class UpdateParams(TypedDict): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Configuration for collecting the customer's billing address. + Configuration for collecting the customer's billing address. Defaults to `auto`. """ custom_fields: NotRequired[ "Literal['']|List[PaymentLinkService.UpdateParamsCustomField]" @@ -972,7 +972,7 @@ class UpdateParams(TypedDict): """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ diff --git a/stripe/_refund.py b/stripe/_refund.py index f06a4df91..1df08c45d 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -10,7 +10,14 @@ from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload -from typing_extensions import Literal, NotRequired, Type, Unpack, TYPE_CHECKING +from typing_extensions import ( + Literal, + NotRequired, + Type, + TypedDict, + Unpack, + TYPE_CHECKING, +) if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction @@ -360,6 +367,14 @@ class ExpireParams(RequestOptions): """ class ListParams(RequestOptions): + charge: NotRequired["str"] + """ + Only return refunds for the charge specified by this charge ID. + """ + created: NotRequired["Refund.ListParamsCreated|int"] + """ + Only return refunds that were created during the given date interval. + """ ending_before: NotRequired["str"] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. @@ -372,11 +387,33 @@ class ListParams(RequestOptions): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ + payment_intent: NotRequired["str"] + """ + Only return refunds for the PaymentIntent specified by this ID. + """ starting_after: NotRequired["str"] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ + class ListParamsCreated(TypedDict): + gt: NotRequired["int"] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired["int"] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired["int"] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired["int"] + """ + Maximum value to filter by (inclusive) + """ + class ModifyParams(RequestOptions): expand: NotRequired["List[str]"] """ @@ -567,7 +604,7 @@ def list( cls, **params: Unpack["Refund.ListParams"] ) -> ListObject["Refund"]: """ - You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. + Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. """ result = cls._static_request( "get", diff --git a/stripe/_token.py b/stripe/_token.py index 08b452376..ea31719c8 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -597,7 +597,7 @@ class CreateParamsAccountIndividualVerificationDocument(TypedDict): class CreateParamsBankAccount(TypedDict): account_holder_name: NotRequired["str"] """ - The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. + The name of the person or business that owns the bank account. This field is required when attaching the bank account to a `Customer` object. """ account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -621,6 +621,10 @@ class CreateParamsBankAccount(TypedDict): """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts) """ + payment_method: NotRequired["str"] + """ + The ID of a Payment Method with a `type` of `us_bank_account`. The Payment Method's bank account information will be copied and returned as a Bank Account Token. This parameter is exclusive with respect to all other parameters in the `bank_account` hash. You must include the top-level `customer` parameter if the Payment Method is attached to a `Customer` object. If the Payment Method is not attached to a `Customer` object, it will be consumed and cannot be used again. You may not use Payment Methods which were created by a Setup Intent with `attach_to_self=true`. + """ routing_number: NotRequired["str"] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 280b82e96..798459555 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -568,7 +568,7 @@ class CreateParamsAccountIndividualVerificationDocument(TypedDict): class CreateParamsBankAccount(TypedDict): account_holder_name: NotRequired["str"] """ - The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. + The name of the person or business that owns the bank account. This field is required when attaching the bank account to a `Customer` object. """ account_holder_type: NotRequired["Literal['company', 'individual']"] """ @@ -592,6 +592,10 @@ class CreateParamsBankAccount(TypedDict): """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts) """ + payment_method: NotRequired["str"] + """ + The ID of a Payment Method with a `type` of `us_bank_account`. The Payment Method's bank account information will be copied and returned as a Bank Account Token. This parameter is exclusive with respect to all other parameters in the `bank_account` hash. You must include the top-level `customer` parameter if the Payment Method is attached to a `Customer` object. If the Payment Method is not attached to a `Customer` object, it will be consumed and cannot be used again. You may not use Payment Methods which were created by a Setup Intent with `attach_to_self=true`. + """ routing_number: NotRequired["str"] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 6d99c10c5..28898775d 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1479,7 +1479,7 @@ class CreateParams(RequestOptions): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Specify whether Checkout should collect the customer's billing address. + Specify whether Checkout should collect the customer's billing address. Defaults to `auto`. """ cancel_url: NotRequired["str"] """ @@ -1598,7 +1598,7 @@ class CreateParams(RequestOptions): Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ @@ -1641,7 +1641,7 @@ class CreateParams(RequestOptions): "Literal['always', 'if_required', 'never']" ] """ - This parameter applies to `ui_mode: embedded`. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. """ return_url: NotRequired["str"] """ @@ -1689,7 +1689,7 @@ class CreateParams(RequestOptions): """ ui_mode: NotRequired["Literal['embedded', 'hosted']"] """ - `ui_mode` can be `hosted` or `embedded`. The default is `hosted`. + The UI mode of the Session. Defaults to `hosted`. """ class CreateParamsAfterExpiration(TypedDict): @@ -3470,7 +3470,7 @@ class RetrieveParams(RequestOptions): automatic_tax: AutomaticTax billing_address_collection: Optional[Literal["auto", "required"]] """ - Describes whether Checkout should collect the customer's billing address. + Describes whether Checkout should collect the customer's billing address. Defaults to `auto`. """ cancel_url: Optional[str] """ @@ -3525,7 +3525,7 @@ class RetrieveParams(RequestOptions): """ customer_details: Optional[CustomerDetails] """ - The customer details including the customer's tax exempt status and the customer's tax IDs. Only the customer's email is present on Sessions in `setup` mode. + The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions in `setup` mode. """ customer_email: Optional[str] """ @@ -3629,7 +3629,7 @@ class RetrieveParams(RequestOptions): """ payment_method_collection: Optional[Literal["always", "if_required"]] """ - Configure whether a Checkout Session should collect a payment method. + Configure whether a Checkout Session should collect a payment method. Defaults to `always`. """ payment_method_configuration_details: Optional[ PaymentMethodConfigurationDetails @@ -3658,7 +3658,7 @@ class RetrieveParams(RequestOptions): """ redirect_on_completion: Optional[Literal["always", "if_required", "never"]] """ - Applies to Checkout Sessions with `ui_mode: embedded`. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. """ return_url: Optional[str] """ @@ -3710,7 +3710,7 @@ class RetrieveParams(RequestOptions): """ ui_mode: Optional[Literal["embedded", "hosted"]] """ - The UI mode of the Session. Can be `hosted` (default) or `embedded`. + The UI mode of the Session. Defaults to `hosted`. """ url: Optional[str] """ diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index d14975cd0..ba38a4ff2 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -32,7 +32,7 @@ class CreateParams(TypedDict): """ billing_address_collection: NotRequired["Literal['auto', 'required']"] """ - Specify whether Checkout should collect the customer's billing address. + Specify whether Checkout should collect the customer's billing address. Defaults to `auto`. """ cancel_url: NotRequired["str"] """ @@ -157,7 +157,7 @@ class CreateParams(TypedDict): Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. This may occur if the Checkout Session includes a free trial or a discount. - Can only be set in `subscription` mode. + Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ @@ -200,7 +200,7 @@ class CreateParams(TypedDict): "Literal['always', 'if_required', 'never']" ] """ - This parameter applies to `ui_mode: embedded`. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. """ return_url: NotRequired["str"] """ @@ -254,7 +254,7 @@ class CreateParams(TypedDict): """ ui_mode: NotRequired["Literal['embedded', 'hosted']"] """ - `ui_mode` can be `hosted` or `embedded`. The default is `hosted`. + The UI mode of the Session. Defaults to `hosted`. """ class CreateParamsAfterExpiration(TypedDict): diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index fbc13cd64..8f291ed02 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -384,7 +384,7 @@ class RetrieveParams(RequestOptions): """ Result from a selfie check """ - type: Optional[Literal["document", "id_number"]] + type: Literal["document", "id_number"] """ Type of report. """ diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 7a1279af1..d66717bfa 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -389,7 +389,7 @@ class RetrieveParams(RequestOptions): """ Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). """ - type: Optional[Literal["document", "id_number"]] + type: Literal["document", "id_number"] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. """ diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index f13a1fe65..378c6cec9 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -51,6 +51,10 @@ class Tipping(StripeObject): Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). """ + enable_customer_cancellation: Optional[bool] + """ + Enable customer initiated cancellation when processing this payment. + """ skip_tipping: Optional[bool] """ Override showing a tipping selection screen on this transaction. @@ -73,7 +77,10 @@ class Tipping(StripeObject): class ProcessSetupIntent(StripeObject): class ProcessConfig(StripeObject): - pass + enable_customer_cancellation: Optional[bool] + """ + Enable customer initiated cancellation when processing this SetupIntent. + """ generated_card: Optional[str] """ @@ -90,6 +97,12 @@ class ProcessConfig(StripeObject): _inner_class_types = {"process_config": ProcessConfig} class RefundPayment(StripeObject): + class RefundPaymentConfig(StripeObject): + enable_customer_cancellation: Optional[bool] + """ + Enable customer initiated cancellation when refunding this payment. + """ + amount: Optional[int] """ The amount being refunded. @@ -120,10 +133,15 @@ class RefundPayment(StripeObject): """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ + refund_payment_config: Optional[RefundPaymentConfig] + """ + Represents a per-transaction override of a reader configuration + """ reverse_transfer: Optional[bool] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ + _inner_class_types = {"refund_payment_config": RefundPaymentConfig} class SetReaderDisplay(StripeObject): class Cart(StripeObject): @@ -349,6 +367,10 @@ class ProcessPaymentIntentParams(RequestOptions): """ class ProcessPaymentIntentParamsProcessConfig(TypedDict): + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ skip_tipping: NotRequired["bool"] """ Override showing a tipping selection screen on this transaction. @@ -387,7 +409,10 @@ class ProcessSetupIntentParams(RequestOptions): """ class ProcessSetupIntentParamsProcessConfig(TypedDict): - pass + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ class RefundPaymentParams(RequestOptions): amount: NotRequired["int"] @@ -414,11 +439,23 @@ class RefundPaymentParams(RequestOptions): """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ + refund_payment_config: NotRequired[ + "Reader.RefundPaymentParamsRefundPaymentConfig" + ] + """ + Configuration overrides + """ reverse_transfer: NotRequired["bool"] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ + class RefundPaymentParamsRefundPaymentConfig(TypedDict): + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ + class RetrieveParams(RequestOptions): expand: NotRequired["List[str]"] """ diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 067c07234..0692e7bfb 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -94,6 +94,10 @@ class ProcessPaymentIntentParams(TypedDict): """ class ProcessPaymentIntentParamsProcessConfig(TypedDict): + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ skip_tipping: NotRequired["bool"] """ Override showing a tipping selection screen on this transaction. @@ -132,7 +136,10 @@ class ProcessSetupIntentParams(TypedDict): """ class ProcessSetupIntentParamsProcessConfig(TypedDict): - pass + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ class RefundPaymentParams(TypedDict): amount: NotRequired["int"] @@ -159,11 +166,23 @@ class RefundPaymentParams(TypedDict): """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ + refund_payment_config: NotRequired[ + "ReaderService.RefundPaymentParamsRefundPaymentConfig" + ] + """ + Configuration overrides + """ reverse_transfer: NotRequired["bool"] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ + class RefundPaymentParamsRefundPaymentConfig(TypedDict): + enable_customer_cancellation: NotRequired["bool"] + """ + Enables cancel button on transaction screens. + """ + class RetrieveParams(TypedDict): expand: NotRequired["List[str]"] """