From 34930ea887acd86a6ce1ca07d95d5379b981259c Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Fri, 17 Nov 2023 09:04:02 -0800 Subject: [PATCH 01/14] Add more exports tests (#1140) --- tests/test_exports.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/test_exports.py b/tests/test_exports.py index 5b1541125..75b033ec7 100644 --- a/tests/test_exports.py +++ b/tests/test_exports.py @@ -22,6 +22,33 @@ def test_can_import_webhook_members() -> None: assert WebhookSignature is not None +def test_can_import_list_search_objects() -> None: + from stripe.api_resources import ( + ListObject as ListObjectFromApiResources, + SearchResultObject as SearchObjectFromApiResources, + ) + from stripe.stripe_object import ( + StripeObject, + ) + + assert ( + ListObjectFromApiResources[StripeObject] + == stripe.ListObject[StripeObject] + ) + assert ( + SearchObjectFromApiResources[StripeObject] + == stripe.SearchResultObject[StripeObject] + ) + + +def test_can_import_misc_resources() -> None: + from stripe.api_resources import ErrorObject, OAuthErrorObject, FileUpload + + assert ErrorObject is stripe.ErrorObject + assert OAuthErrorObject is stripe.OAuthErrorObject + assert FileUpload is stripe.FileUpload + + def test_can_import_abstract() -> None: from stripe.api_resources.abstract import ( APIResource as APIResourceFromApiResourcesAbstract, From e0228775f30cb67fcbe0a2d251c588d6f0adb4ae Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 20:33:57 +0000 Subject: [PATCH 02/14] Update generated code for v671 --- OPENAPI_VERSION | 2 +- stripe/api_resources/issuing/authorization.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 189d7cacc..ec86c47e3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v670 \ No newline at end of file +v671 \ No newline at end of file diff --git a/stripe/api_resources/issuing/authorization.py b/stripe/api_resources/issuing/authorization.py index f77533004..d4b0264ae 100644 --- a/stripe/api_resources/issuing/authorization.py +++ b/stripe/api_resources/issuing/authorization.py @@ -205,7 +205,7 @@ class AmountDetails(StripeObject): """ reason_message: Optional[str] """ - If approve/decline decision is directly responsed to the webhook with json payload and if the response is invalid (e.g., parsing errors), we surface the detailed message via this field. + If the `request_history.reason` is `webhook_error` because the direct webhook response is invalid (for example, parsing errors or missing parameters), we surface a more detailed error message via this field. """ _inner_class_types = {"amount_details": AmountDetails} From f4202c5eafa7d7c51fde67fbcca103c1331e1364 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 21:59:34 +0000 Subject: [PATCH 03/14] Update generated code for v672 --- OPENAPI_VERSION | 2 +- stripe/api_resources/price.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ec86c47e3..d032b9212 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v671 \ No newline at end of file +v672 \ No newline at end of file diff --git a/stripe/api_resources/price.py b/stripe/api_resources/price.py index 2e15946a9..969df8858 100644 --- a/stripe/api_resources/price.py +++ b/stripe/api_resources/price.py @@ -795,7 +795,7 @@ def list( ] # pyright: ignore[reportGeneralTypeIssues] ) -> ListObject["Price"]: """ - Returns a list of your active prices. For the list of inactive prices, set active to false. + Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. """ result = cls._static_request( "get", From 32c3a6effbd690f961aab09894e4bad6b887a47a Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 23:48:45 +0000 Subject: [PATCH 04/14] Update generated code for v673 --- OPENAPI_VERSION | 2 +- stripe/api_resources/issuing/authorization.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d032b9212..ce028ef16 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v672 \ No newline at end of file +v673 \ No newline at end of file diff --git a/stripe/api_resources/issuing/authorization.py b/stripe/api_resources/issuing/authorization.py index d4b0264ae..2915bc59b 100644 --- a/stripe/api_resources/issuing/authorization.py +++ b/stripe/api_resources/issuing/authorization.py @@ -693,7 +693,7 @@ class ReverseParams(RequestOptions): amount: int """ - The total amount that was authorized or rejected. This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + The total amount that was authorized or rejected. This amount is in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `amount` should be the same as `merchant_amount`, unless `currency` and `merchant_currency` are different. """ amount_details: Optional[AmountDetails] """ @@ -727,7 +727,7 @@ class ReverseParams(RequestOptions): """ currency: str """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + The currency of the cardholder. This currency can be different from the currency presented at authorization and the `merchant_currency` field on this authorization. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ id: str """ @@ -739,11 +739,11 @@ class ReverseParams(RequestOptions): """ merchant_amount: int """ - The total amount that was authorized or rejected. This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + The total amount that was authorized or rejected. This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `merchant_amount` should be the same as `amount`, unless `merchant_currency` and `currency` are different. """ merchant_currency: str """ - The currency that was presented to the cardholder for the authorization. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + The local currency that was presented to the cardholder for the authorization. This currency can be different from the cardholder currency and the `currency` field on this authorization. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ merchant_data: MerchantData metadata: Dict[str, str] From c6e3752e3bf1de28d7c118c0732d3ed4f65220a3 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 01:06:38 +0000 Subject: [PATCH 05/14] Update generated code for v674 --- OPENAPI_VERSION | 2 +- stripe/api_resources/issuing/authorization.py | 20 +++++++++++++++++++ stripe/api_resources/issuing/transaction.py | 8 ++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ce028ef16..663b86eff 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v673 \ No newline at end of file +v674 \ No newline at end of file diff --git a/stripe/api_resources/issuing/authorization.py b/stripe/api_resources/issuing/authorization.py index 2915bc59b..736117014 100644 --- a/stripe/api_resources/issuing/authorization.py +++ b/stripe/api_resources/issuing/authorization.py @@ -103,6 +103,14 @@ class NetworkData(StripeObject): """ Identifier assigned to the acquirer by the card network. Sometimes this value is not provided by the network; in this case, the value will be `null`. """ + system_trace_audit_number: Optional[str] + """ + The System Trace Audit Number (STAN) is a 6-digit identifier assigned by the acquirer. Prefer `network_data.transaction_id` if present, unless you have special requirements. + """ + transaction_id: Optional[str] + """ + Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + """ class PendingRequest(StripeObject): class AmountDetails(StripeObject): @@ -139,6 +147,10 @@ class AmountDetails(StripeObject): """ The local currency the merchant is requesting to authorize. """ + network_risk_score: Optional[int] + """ + The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99. + """ _inner_class_types = {"amount_details": AmountDetails} class RequestHistory(StripeObject): @@ -184,6 +196,10 @@ class AmountDetails(StripeObject): """ The currency that was collected by the merchant and presented to the cardholder for the authorization. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ + network_risk_score: Optional[int] + """ + The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99. + """ reason: Literal[ "account_disabled", "card_active", @@ -207,6 +223,10 @@ class AmountDetails(StripeObject): """ If the `request_history.reason` is `webhook_error` because the direct webhook response is invalid (for example, parsing errors or missing parameters), we surface a more detailed error message via this field. """ + requested_at: Optional[int] + """ + Time when the card network received an authorization request from the acquirer in UTC. Referred to by networks as transmission time. + """ _inner_class_types = {"amount_details": AmountDetails} class Treasury(StripeObject): diff --git a/stripe/api_resources/issuing/transaction.py b/stripe/api_resources/issuing/transaction.py index 05c8473d7..e60d73cca 100644 --- a/stripe/api_resources/issuing/transaction.py +++ b/stripe/api_resources/issuing/transaction.py @@ -100,10 +100,18 @@ class MerchantData(StripeObject): """ class NetworkData(StripeObject): + authorization_code: Optional[str] + """ + A code created by Stripe which is shared with the merchant to validate the authorization. This field will be populated if the authorization message was approved. The code typically starts with the letter "S", followed by a six-digit number. For example, "S498162". Please note that the code is not guaranteed to be unique across authorizations. + """ processing_date: Optional[str] """ The date the transaction was processed by the card network. This can be different from the date the seller recorded the transaction depending on when the acquirer submits the transaction to the network. """ + transaction_id: Optional[str] + """ + Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + """ class PurchaseDetails(StripeObject): class Flight(StripeObject): From ead60ceeba6d788f837c569de5a997c299da9f84 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:42:45 +0000 Subject: [PATCH 06/14] Update generated code for v675 --- OPENAPI_VERSION | 2 +- stripe/api_resources/charge.py | 21 ++ stripe/api_resources/payment_intent.py | 261 +++++++++++++++++++++++++ stripe/api_resources/setup_attempt.py | 12 ++ stripe/api_resources/setup_intent.py | 249 +++++++++++++++++++++++ 5 files changed, 544 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 663b86eff..d2954ef44 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v674 \ No newline at end of file +v675 \ No newline at end of file diff --git a/stripe/api_resources/charge.py b/stripe/api_resources/charge.py index fe9aefc85..14d41e36b 100644 --- a/stripe/api_resources/charge.py +++ b/stripe/api_resources/charge.py @@ -440,6 +440,22 @@ class ThreeDSecure(StripeObject): For authenticated transactions: how the customer was authenticated by the issuing bank. """ + electronic_commerce_indicator: Optional[ + Literal["01", "02", "05", "06", "07"] + ] + """ + The Electronic Commerce Indicator (ECI). A protocol-level field + indicating what degree of authentication was performed. + """ + exemption_indicator: Optional[Literal["low_risk", "none"]] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + exemption_indicator_applied: Optional[bool] + """ + Whether Stripe requested the value of `exemption_indicator` in the transaction. This will depend on + the outcome of Stripe's internal risk assessment. + """ result: Optional[ Literal[ "attempt_acknowledged", @@ -468,6 +484,11 @@ class ThreeDSecure(StripeObject): Additional information about why 3D Secure succeeded or failed based on the `result`. """ + transaction_id: Optional[str] + """ + The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID + (dsTransId) for this payment. + """ version: Optional[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was used. diff --git a/stripe/api_resources/payment_intent.py b/stripe/api_resources/payment_intent.py index afdbcdc73..7f8ad4964 100644 --- a/stripe/api_resources/payment_intent.py +++ b/stripe/api_resources/payment_intent.py @@ -3811,6 +3811,93 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. """ + three_d_secure: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this payment. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: str + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + network_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: str + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: Literal["1.0.2", "2.1.0", "2.2.0"] + """ + The version of 3D Secure that was performed. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class ConfirmParamsPaymentMethodOptionsCardStatementDetails(TypedDict): address: NotRequired[ @@ -6339,6 +6426,93 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. """ + three_d_secure: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this payment. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: str + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + network_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: str + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: Literal["1.0.2", "2.1.0", "2.2.0"] + """ + The version of 3D Secure that was performed. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class CreateParamsPaymentMethodOptionsCardStatementDetails(TypedDict): address: NotRequired[ @@ -8863,6 +9037,93 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. """ + three_d_secure: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this payment. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: str + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + network_options: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: str + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: Literal["1.0.2", "2.1.0", "2.2.0"] + """ + The version of 3D Secure that was performed. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class ModifyParamsPaymentMethodOptionsCardStatementDetails(TypedDict): address: NotRequired[ diff --git a/stripe/api_resources/setup_attempt.py b/stripe/api_resources/setup_attempt.py index 2ee6d0f7e..bcadda078 100644 --- a/stripe/api_resources/setup_attempt.py +++ b/stripe/api_resources/setup_attempt.py @@ -109,6 +109,13 @@ class ThreeDSecure(StripeObject): For authenticated transactions: how the customer was authenticated by the issuing bank. """ + electronic_commerce_indicator: Optional[ + Literal["01", "02", "05", "06", "07"] + ] + """ + The Electronic Commerce Indicator (ECI). A protocol-level field + indicating what degree of authentication was performed. + """ result: Optional[ Literal[ "attempt_acknowledged", @@ -137,6 +144,11 @@ class ThreeDSecure(StripeObject): Additional information about why 3D Secure succeeded or failed based on the `result`. """ + transaction_id: Optional[str] + """ + The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID + (dsTransId) for this payment. + """ version: Optional[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was used. diff --git a/stripe/api_resources/setup_intent.py b/stripe/api_resources/setup_intent.py index 5e3b37958..4b6a534b3 100644 --- a/stripe/api_resources/setup_intent.py +++ b/stripe/api_resources/setup_intent.py @@ -821,6 +821,89 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + three_d_secure: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this setup. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: NotRequired["str"] + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + network_options: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: NotRequired["str"] + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + """ + The version of 3D Secure that was performed. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int @@ -1706,6 +1789,89 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + three_d_secure: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this setup. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: NotRequired["str"] + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + network_options: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: NotRequired["str"] + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + """ + The version of 3D Secure that was performed. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int @@ -2579,6 +2745,89 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + three_d_secure: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this setup. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: NotRequired["str"] + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + network_options: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: NotRequired["str"] + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + """ + The version of 3D Secure that was performed. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int From f79df43d51ee65429f732783f7be400103d0326e Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 17:45:57 +0000 Subject: [PATCH 07/14] Update generated code for v676 --- OPENAPI_VERSION | 2 +- stripe/api_resources/customer_cash_balance_transaction.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d2954ef44..53273f3a3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v675 \ No newline at end of file +v676 \ No newline at end of file diff --git a/stripe/api_resources/customer_cash_balance_transaction.py b/stripe/api_resources/customer_cash_balance_transaction.py index e115f8fdd..cf9048360 100644 --- a/stripe/api_resources/customer_cash_balance_transaction.py +++ b/stripe/api_resources/customer_cash_balance_transaction.py @@ -133,6 +133,12 @@ class RefundedFromPayment(StripeObject): The [Refund](https://stripe.com/docs/api/refunds/object) that moved these funds into the customer's cash balance. """ + class TransferredToBalance(StripeObject): + balance_transaction: ExpandableField["BalanceTransaction"] + """ + The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds transferred to your Stripe balance. + """ + class UnappliedFromPayment(StripeObject): payment_intent: ExpandableField["PaymentIntent"] """ @@ -199,6 +205,7 @@ class RetrieveParams(RequestOptions): String representing the object's type. Objects of the same type share the same value. """ refunded_from_payment: Optional[RefundedFromPayment] + transferred_to_balance: Optional[TransferredToBalance] type: Literal[ "adjusted_for_overdraft", "applied_to_payment", @@ -263,5 +270,6 @@ def retrieve( "applied_to_payment": AppliedToPayment, "funded": Funded, "refunded_from_payment": RefundedFromPayment, + "transferred_to_balance": TransferredToBalance, "unapplied_from_payment": UnappliedFromPayment, } From 74713923c27db576492a35eedcbd344a29295daf Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 19:01:22 +0000 Subject: [PATCH 08/14] Update generated code for v677 --- OPENAPI_VERSION | 2 +- stripe/api_resources/treasury/outbound_payment.py | 2 +- stripe/api_resources/treasury/outbound_transfer.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 53273f3a3..94be7d7a6 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v676 \ No newline at end of file +v677 \ No newline at end of file diff --git a/stripe/api_resources/treasury/outbound_payment.py b/stripe/api_resources/treasury/outbound_payment.py index 581519592..b9d3f4a1c 100644 --- a/stripe/api_resources/treasury/outbound_payment.py +++ b/stripe/api_resources/treasury/outbound_payment.py @@ -239,7 +239,7 @@ class CreateParams(RequestOptions): """ statement_descriptor: NotRequired["str"] """ - The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `wire` payments, or 500 characters for `stripe` network transfers. The default value is `payment`. + The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `us_domestic_wire` payments, or 500 characters for `stripe` network transfers. The default value is "payment". """ class CreateParamsEndUserDetails(TypedDict): diff --git a/stripe/api_resources/treasury/outbound_transfer.py b/stripe/api_resources/treasury/outbound_transfer.py index 7805380da..3fd2b6976 100644 --- a/stripe/api_resources/treasury/outbound_transfer.py +++ b/stripe/api_resources/treasury/outbound_transfer.py @@ -224,7 +224,7 @@ class CreateParams(RequestOptions): """ statement_descriptor: NotRequired["str"] """ - Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. The default value is `transfer`. + Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". """ class CreateParamsNetworkDetails(TypedDict): From f77a11d1c1f19f4b9910b5cc3eeb764fec38e953 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:35:13 -0800 Subject: [PATCH 09/14] Add more abstract exports tests (#1143) --- .../api_resources/abstract/custom_method.py | 8 ++- .../abstract/nested_resource_class_methods.py | 6 ++- tests/test_exports.py | 54 +++++++++++++++++-- 3 files changed, 62 insertions(+), 6 deletions(-) diff --git a/stripe/api_resources/abstract/custom_method.py b/stripe/api_resources/abstract/custom_method.py index 8ee1fdd60..463cb398d 100644 --- a/stripe/api_resources/abstract/custom_method.py +++ b/stripe/api_resources/abstract/custom_method.py @@ -1,8 +1,14 @@ +from typing import Optional from stripe import util from urllib.parse import quote_plus -def custom_method(name, http_verb, http_path=None, is_streaming=False): +def custom_method( + name: str, + http_verb: str, + http_path: Optional[str] = None, + is_streaming=False, +): if http_verb not in ["get", "post", "delete"]: raise ValueError( "Invalid http_verb: %s. Must be one of 'get', 'post' or 'delete'" diff --git a/stripe/api_resources/abstract/nested_resource_class_methods.py b/stripe/api_resources/abstract/nested_resource_class_methods.py index bf9a55a98..1e913334a 100644 --- a/stripe/api_resources/abstract/nested_resource_class_methods.py +++ b/stripe/api_resources/abstract/nested_resource_class_methods.py @@ -1,3 +1,4 @@ +from typing import List, Optional from urllib.parse import quote_plus from stripe.api_resources.abstract import APIResource @@ -6,7 +7,10 @@ # TODO(major): Remove this. It is no longer used except for "nested_resource_url" and "nested_resource_request", # which are unnecessary ande deprecated. def nested_resource_class_methods( - resource, path=None, operations=None, resource_plural=None + resource: str, + path: Optional[str] = None, + operations: Optional[List[str]] = None, + resource_plural: Optional[str] = None, ): if resource_plural is None: resource_plural = "%ss" % resource diff --git a/tests/test_exports.py b/tests/test_exports.py index 75b033ec7..ad24702fb 100644 --- a/tests/test_exports.py +++ b/tests/test_exports.py @@ -1,4 +1,5 @@ # pyright: strict +from typing import Any import stripe @@ -50,17 +51,62 @@ def test_can_import_misc_resources() -> None: def test_can_import_abstract() -> None: - from stripe.api_resources.abstract import ( - APIResource as APIResourceFromApiResourcesAbstract, - ) + # fmt: off + from stripe.api_resources.abstract import APIResource as APIResourceFromAbs + from stripe.api_resources.abstract import SingletonAPIResource as SingletonFromAbs + from stripe.api_resources.abstract import CreateableAPIResource as CreateableFromAbs + from stripe.api_resources.abstract import UpdateableAPIResource as UpdateableFromAbs + from stripe.api_resources.abstract import DeletableAPIResource as DeletableFromAbs + from stripe.api_resources.abstract import ListableAPIResource as ListableFromAbs + from stripe.api_resources.abstract import SearchableAPIResource as SearchableFromAbs + from stripe.api_resources.abstract import VerifyMixin as VerifyMixinFromAbstract + from stripe.api_resources.abstract import custom_method as custom_methodFromAbstract + from stripe.api_resources.abstract import APIResourceTestHelpers as APIResourceTestHelpersFromAbstract + from stripe.api_resources.abstract import nested_resource_class_methods as nested_resource_class_methodsFromAbstract + # fmt: on + from stripe.stripe_object import ( StripeObject, ) assert ( - APIResourceFromApiResourcesAbstract[StripeObject] + APIResourceFromAbs[StripeObject] == stripe.abstract.APIResource[StripeObject] ) + assert ( + stripe.abstract.SingletonAPIResource[StripeObject] + == SingletonFromAbs[StripeObject] + ) + assert ( + stripe.abstract.CreateableAPIResource[StripeObject] + == CreateableFromAbs[StripeObject] + ) + assert ( + stripe.abstract.UpdateableAPIResource[StripeObject] + == UpdateableFromAbs[StripeObject] + ) + assert ( + stripe.abstract.DeletableAPIResource[StripeObject] + == DeletableFromAbs[StripeObject] + ) + assert ( + stripe.abstract.ListableAPIResource[StripeObject] + == ListableFromAbs[StripeObject] + ) + assert ( + stripe.abstract.SearchableAPIResource[StripeObject] + == SearchableFromAbs[StripeObject] + ) + assert stripe.abstract.VerifyMixin is VerifyMixinFromAbstract + assert stripe.abstract.custom_method is custom_methodFromAbstract + assert ( + stripe.abstract.APIResourceTestHelpers[Any] + is APIResourceTestHelpersFromAbstract[Any] + ) + assert ( + stripe.abstract.nested_resource_class_methods + is nested_resource_class_methodsFromAbstract + ) def test_can_import_app_info() -> None: From c0c34394ad7e0d7ceb4145f7fa85be3ea3a6f3ad Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 21:39:11 +0000 Subject: [PATCH 10/14] Update generated code for v678 --- OPENAPI_VERSION | 2 +- stripe/api_resources/customer_session.py | 114 ++++++++++++++++++++++- 2 files changed, 114 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 94be7d7a6..372f3d3c1 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v677 \ No newline at end of file +v678 \ No newline at end of file diff --git a/stripe/api_resources/customer_session.py b/stripe/api_resources/customer_session.py index a5c8250ec..5664ca4cd 100644 --- a/stripe/api_resources/customer_session.py +++ b/stripe/api_resources/customer_session.py @@ -3,8 +3,15 @@ from stripe.api_resources.abstract import CreateableAPIResource from stripe.api_resources.expandable_field import ExpandableField from stripe.request_options import RequestOptions +from stripe.stripe_object import StripeObject from typing import ClassVar, List, Optional, cast -from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) if TYPE_CHECKING: from stripe.api_resources.customer import Customer @@ -18,7 +25,58 @@ class CustomerSession(CreateableAPIResource["CustomerSession"]): OBJECT_NAME: ClassVar[Literal["customer_session"]] = "customer_session" + class Components(StripeObject): + class PaymentElement(StripeObject): + class Features(StripeObject): + payment_method_detach: Literal["auto", "never"] + """ + Whether the payment element supports detaching payment methods. + """ + payment_method_set_as_customer_default: Literal[ + "auto", "never" + ] + """ + Whether the payment element supports setting payment methods as the customer's default. + """ + payment_method_update: Literal["auto", "never"] + """ + Whether the payment element supports updating payment methods. + """ + + enabled: bool + """ + Whether the payment element is enabled. + """ + features: Optional[Features] + """ + This hash contains the features the Payment Element supports. + """ + _inner_class_types = {"features": Features} + + class PricingTable(StripeObject): + enabled: bool + """ + Whether the pricing table is enabled. + """ + + payment_element: Optional[PaymentElement] + """ + This hash contains whether the payment element is enabled and the features it supports. + """ + pricing_table: Optional[PricingTable] + """ + This hash contains whether the pricing table is enabled. + """ + _inner_class_types = { + "payment_element": PaymentElement, + "pricing_table": PricingTable, + } + class CreateParams(RequestOptions): + components: "CustomerSession.CreateParamsComponents" + """ + Configuration for each component. + """ customer: str """ The ID of an existing customer for which to create the customer session. @@ -28,12 +86,64 @@ class CreateParams(RequestOptions): Specifies which fields in the response should be expanded. """ + class CreateParamsComponents(TypedDict): + payment_element: NotRequired[ + "CustomerSession.CreateParamsComponentsPaymentElement" + ] + """ + Configuration for the payment element. + """ + pricing_table: NotRequired[ + "CustomerSession.CreateParamsComponentsPricingTable" + ] + """ + Configuration for the pricing table. + """ + + class CreateParamsComponentsPricingTable(TypedDict): + enabled: bool + """ + Whether pricing table is enabled. + """ + + class CreateParamsComponentsPaymentElement(TypedDict): + enabled: bool + """ + Whether the payment element is enabled. + """ + features: NotRequired[ + "CustomerSession.CreateParamsComponentsPaymentElementFeatures" + ] + """ + This hash defines whether the payment element supports certain features. + """ + + class CreateParamsComponentsPaymentElementFeatures(TypedDict): + payment_method_detach: NotRequired["Literal['auto', 'never']"] + """ + Whether the payment element supports detaching a payment method. + """ + payment_method_set_as_customer_default: NotRequired[ + "Literal['auto', 'never']" + ] + """ + Whether the payment element supports setting a payment method as the customer's default. + """ + payment_method_update: NotRequired["Literal['auto', 'never']"] + """ + Whether the payment element supports updating a payment method. + """ + 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 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. + """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. @@ -81,3 +191,5 @@ def create( params, ), ) + + _inner_class_types = {"components": Components} From 67f468ac5c259bfb29ff5a2bc76345ba51209d5b Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 00:02:38 +0000 Subject: [PATCH 11/14] Update generated code for v679 --- OPENAPI_VERSION | 2 +- stripe/api_resources/charge.py | 48 +++++------ stripe/api_resources/payment_intent.py | 108 ++++++++++++------------- 3 files changed, 79 insertions(+), 79 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 372f3d3c1..25737827e 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v678 \ No newline at end of file +v679 \ No newline at end of file diff --git a/stripe/api_resources/charge.py b/stripe/api_resources/charge.py index 14d41e36b..53766adc3 100644 --- a/stripe/api_resources/charge.py +++ b/stripe/api_resources/charge.py @@ -1967,14 +1967,14 @@ class CaptureParamsPaymentDetailsLodgingDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "Charge.CaptureParamsPaymentDetailsLodgingDeliveryReceipient" + recipient: NotRequired[ + "Charge.CaptureParamsPaymentDetailsLodgingDeliveryRecipient" ] """ Details of the recipient. """ - class CaptureParamsPaymentDetailsLodgingDeliveryReceipient(TypedDict): + class CaptureParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -2103,14 +2103,14 @@ class CaptureParamsPaymentDetailsFlightDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "Charge.CaptureParamsPaymentDetailsFlightDeliveryReceipient" + recipient: NotRequired[ + "Charge.CaptureParamsPaymentDetailsFlightDeliveryRecipient" ] """ Details of the recipient. """ - class CaptureParamsPaymentDetailsFlightDeliveryReceipient(TypedDict): + class CaptureParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -2179,14 +2179,14 @@ class CaptureParamsPaymentDetailsEventDetailsDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "Charge.CaptureParamsPaymentDetailsEventDetailsDeliveryReceipient" + recipient: NotRequired[ + "Charge.CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient" ] """ Details of the recipient. """ - class CaptureParamsPaymentDetailsEventDetailsDeliveryReceipient(TypedDict): + class CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -2389,14 +2389,14 @@ class CaptureParamsPaymentDetailsCarRentalDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "Charge.CaptureParamsPaymentDetailsCarRentalDeliveryReceipient" + recipient: NotRequired[ + "Charge.CaptureParamsPaymentDetailsCarRentalDeliveryRecipient" ] """ Details of the recipient. """ - class CaptureParamsPaymentDetailsCarRentalDeliveryReceipient(TypedDict): + class CaptureParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -2866,14 +2866,14 @@ class ModifyParamsPaymentDetailsLodgingDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "Charge.ModifyParamsPaymentDetailsLodgingDeliveryReceipient" + recipient: NotRequired[ + "Charge.ModifyParamsPaymentDetailsLodgingDeliveryRecipient" ] """ Details of the recipient. """ - class ModifyParamsPaymentDetailsLodgingDeliveryReceipient(TypedDict): + class ModifyParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -3002,14 +3002,14 @@ class ModifyParamsPaymentDetailsFlightDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "Charge.ModifyParamsPaymentDetailsFlightDeliveryReceipient" + recipient: NotRequired[ + "Charge.ModifyParamsPaymentDetailsFlightDeliveryRecipient" ] """ Details of the recipient. """ - class ModifyParamsPaymentDetailsFlightDeliveryReceipient(TypedDict): + class ModifyParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -3078,14 +3078,14 @@ class ModifyParamsPaymentDetailsEventDetailsDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "Charge.ModifyParamsPaymentDetailsEventDetailsDeliveryReceipient" + recipient: NotRequired[ + "Charge.ModifyParamsPaymentDetailsEventDetailsDeliveryRecipient" ] """ Details of the recipient. """ - class ModifyParamsPaymentDetailsEventDetailsDeliveryReceipient(TypedDict): + class ModifyParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -3288,14 +3288,14 @@ class ModifyParamsPaymentDetailsCarRentalDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "Charge.ModifyParamsPaymentDetailsCarRentalDeliveryReceipient" + recipient: NotRequired[ + "Charge.ModifyParamsPaymentDetailsCarRentalDeliveryRecipient" ] """ Details of the recipient. """ - class ModifyParamsPaymentDetailsCarRentalDeliveryReceipient(TypedDict): + class ModifyParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. diff --git a/stripe/api_resources/payment_intent.py b/stripe/api_resources/payment_intent.py index 7f8ad4964..13e979e29 100644 --- a/stripe/api_resources/payment_intent.py +++ b/stripe/api_resources/payment_intent.py @@ -903,7 +903,7 @@ class Affiliate(StripeObject): """ class Delivery(StripeObject): - class Receipient(StripeObject): + class Recipient(StripeObject): email: Optional[str] """ The email of the recipient the ticket is delivered to. @@ -921,8 +921,8 @@ class Receipient(StripeObject): """ The delivery method for the payment """ - receipient: Optional[Receipient] - _inner_class_types = {"receipient": Receipient} + recipient: Optional[Recipient] + _inner_class_types = {"recipient": Recipient} class Driver(StripeObject): name: Optional[str] @@ -1102,7 +1102,7 @@ class Affiliate(StripeObject): """ class Delivery(StripeObject): - class Receipient(StripeObject): + class Recipient(StripeObject): email: Optional[str] """ The email of the recipient the ticket is delivered to. @@ -1120,8 +1120,8 @@ class Receipient(StripeObject): """ The delivery method for the payment """ - receipient: Optional[Receipient] - _inner_class_types = {"receipient": Receipient} + recipient: Optional[Recipient] + _inner_class_types = {"recipient": Recipient} access_controlled_venue: Optional[bool] """ @@ -2392,14 +2392,14 @@ class CaptureParamsPaymentDetailsLodgingDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.CaptureParamsPaymentDetailsLodgingDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsLodgingDeliveryRecipient" ] """ Details of the recipient. """ - class CaptureParamsPaymentDetailsLodgingDeliveryReceipient(TypedDict): + class CaptureParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -2530,14 +2530,14 @@ class CaptureParamsPaymentDetailsFlightDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.CaptureParamsPaymentDetailsFlightDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsFlightDeliveryRecipient" ] """ Details of the recipient. """ - class CaptureParamsPaymentDetailsFlightDeliveryReceipient(TypedDict): + class CaptureParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -2606,14 +2606,14 @@ class CaptureParamsPaymentDetailsEventDetailsDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.CaptureParamsPaymentDetailsEventDetailsDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient" ] """ Details of the recipient. """ - class CaptureParamsPaymentDetailsEventDetailsDeliveryReceipient(TypedDict): + class CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -2816,14 +2816,14 @@ class CaptureParamsPaymentDetailsCarRentalDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.CaptureParamsPaymentDetailsCarRentalDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsCarRentalDeliveryRecipient" ] """ Details of the recipient. """ - class CaptureParamsPaymentDetailsCarRentalDeliveryReceipient(TypedDict): + class CaptureParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -4856,14 +4856,14 @@ class ConfirmParamsPaymentDetailsLodgingDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentDetailsLodgingDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsLodgingDeliveryRecipient" ] """ Details of the recipient. """ - class ConfirmParamsPaymentDetailsLodgingDeliveryReceipient(TypedDict): + class ConfirmParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -4994,14 +4994,14 @@ class ConfirmParamsPaymentDetailsFlightDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentDetailsFlightDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsFlightDeliveryRecipient" ] """ Details of the recipient. """ - class ConfirmParamsPaymentDetailsFlightDeliveryReceipient(TypedDict): + class ConfirmParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -5070,14 +5070,14 @@ class ConfirmParamsPaymentDetailsEventDetailsDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentDetailsEventDetailsDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsEventDetailsDeliveryRecipient" ] """ Details of the recipient. """ - class ConfirmParamsPaymentDetailsEventDetailsDeliveryReceipient(TypedDict): + class ConfirmParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -5280,14 +5280,14 @@ class ConfirmParamsPaymentDetailsCarRentalDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentDetailsCarRentalDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsCarRentalDeliveryRecipient" ] """ Details of the recipient. """ - class ConfirmParamsPaymentDetailsCarRentalDeliveryReceipient(TypedDict): + class ConfirmParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -7469,14 +7469,14 @@ class CreateParamsPaymentDetailsLodgingDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.CreateParamsPaymentDetailsLodgingDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsLodgingDeliveryRecipient" ] """ Details of the recipient. """ - class CreateParamsPaymentDetailsLodgingDeliveryReceipient(TypedDict): + class CreateParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -7605,14 +7605,14 @@ class CreateParamsPaymentDetailsFlightDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.CreateParamsPaymentDetailsFlightDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsFlightDeliveryRecipient" ] """ Details of the recipient. """ - class CreateParamsPaymentDetailsFlightDeliveryReceipient(TypedDict): + class CreateParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -7681,14 +7681,14 @@ class CreateParamsPaymentDetailsEventDetailsDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.CreateParamsPaymentDetailsEventDetailsDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsEventDetailsDeliveryRecipient" ] """ Details of the recipient. """ - class CreateParamsPaymentDetailsEventDetailsDeliveryReceipient(TypedDict): + class CreateParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -7891,14 +7891,14 @@ class CreateParamsPaymentDetailsCarRentalDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.CreateParamsPaymentDetailsCarRentalDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsCarRentalDeliveryRecipient" ] """ Details of the recipient. """ - class CreateParamsPaymentDetailsCarRentalDeliveryReceipient(TypedDict): + class CreateParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -10080,14 +10080,14 @@ class ModifyParamsPaymentDetailsLodgingDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.ModifyParamsPaymentDetailsLodgingDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsLodgingDeliveryRecipient" ] """ Details of the recipient. """ - class ModifyParamsPaymentDetailsLodgingDeliveryReceipient(TypedDict): + class ModifyParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -10216,14 +10216,14 @@ class ModifyParamsPaymentDetailsFlightDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.ModifyParamsPaymentDetailsFlightDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsFlightDeliveryRecipient" ] """ Details of the recipient. """ - class ModifyParamsPaymentDetailsFlightDeliveryReceipient(TypedDict): + class ModifyParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -10292,14 +10292,14 @@ class ModifyParamsPaymentDetailsEventDetailsDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.ModifyParamsPaymentDetailsEventDetailsDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsEventDetailsDeliveryRecipient" ] """ Details of the recipient. """ - class ModifyParamsPaymentDetailsEventDetailsDeliveryReceipient(TypedDict): + class ModifyParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. @@ -10502,14 +10502,14 @@ class ModifyParamsPaymentDetailsCarRentalDelivery(TypedDict): """ The delivery method for the payment """ - receipient: NotRequired[ - "PaymentIntent.ModifyParamsPaymentDetailsCarRentalDeliveryReceipient" + recipient: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsCarRentalDeliveryRecipient" ] """ Details of the recipient. """ - class ModifyParamsPaymentDetailsCarRentalDeliveryReceipient(TypedDict): + class ModifyParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): email: NotRequired["str"] """ The email of the recipient the ticket is delivered to. From 2afd5ffa2703654c5a9805661ee777c7dabf46ea Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 04:07:36 +0000 Subject: [PATCH 12/14] Update generated code for v680 --- OPENAPI_VERSION | 2 +- stripe/api_resources/refund.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 25737827e..1418e2ae4 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v679 \ No newline at end of file +v680 \ No newline at end of file diff --git a/stripe/api_resources/refund.py b/stripe/api_resources/refund.py index 8a79b1005..5ef21d717 100644 --- a/stripe/api_resources/refund.py +++ b/stripe/api_resources/refund.py @@ -240,7 +240,7 @@ class ExpireParams(RequestOptions): """ status: Optional[str] """ - Status of the refund. For credit card refunds, this can be `pending`, `succeeded`, or `failed`. For other types of refunds, it can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). + Status of the refund. This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). """ transfer_reversal: Optional[ExpandableField["Reversal"]] """ From 107439e0b6e1a5c3cc58ce9c8534506d376b6dcd Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 19:40:38 +0000 Subject: [PATCH 13/14] Update generated code (#1138) * Update generated code for v669 * Update generated code for v670 * Update generated code for v671 * Update generated code for v672 * Update generated code for v673 * Update generated code for v674 * Update generated code for v675 * Update generated code for v676 * Update generated code for v677 * Update generated code for v680 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/api_resources/account.py | 1 + stripe/api_resources/apple_pay_domain.py | 1 + stripe/api_resources/application_fee.py | 1 + stripe/api_resources/apps/secret.py | 1 + stripe/api_resources/balance_transaction.py | 1 + .../billing_portal/configuration.py | 1 + stripe/api_resources/charge.py | 34 ++- stripe/api_resources/checkout/session.py | 1 + stripe/api_resources/country_spec.py | 1 + stripe/api_resources/coupon.py | 1 + stripe/api_resources/credit_note.py | 1 + stripe/api_resources/credit_note_line_item.py | 1 + stripe/api_resources/customer.py | 1 + .../customer_cash_balance_transaction.py | 9 + stripe/api_resources/dispute.py | 1 + stripe/api_resources/event.py | 5 +- stripe/api_resources/exchange_rate.py | 1 + stripe/api_resources/file.py | 1 + stripe/api_resources/file_link.py | 1 + .../financial_connections/account.py | 1 + .../identity/verification_report.py | 1 + .../identity/verification_session.py | 1 + stripe/api_resources/invoice.py | 1 + stripe/api_resources/invoice_item.py | 1 + stripe/api_resources/issuing/authorization.py | 31 ++- stripe/api_resources/issuing/card.py | 1 + stripe/api_resources/issuing/cardholder.py | 1 + stripe/api_resources/issuing/dispute.py | 1 + stripe/api_resources/issuing/token.py | 1 + stripe/api_resources/issuing/transaction.py | 9 + stripe/api_resources/payment_intent.py | 262 ++++++++++++++++++ stripe/api_resources/payment_link.py | 1 + stripe/api_resources/payment_method.py | 1 + .../payment_method_configuration.py | 1 + stripe/api_resources/payment_method_domain.py | 1 + stripe/api_resources/payout.py | 1 + stripe/api_resources/plan.py | 1 + stripe/api_resources/price.py | 3 +- stripe/api_resources/product.py | 1 + stripe/api_resources/promotion_code.py | 1 + stripe/api_resources/quote.py | 1 + .../radar/early_fraud_warning.py | 1 + stripe/api_resources/radar/value_list.py | 1 + stripe/api_resources/radar/value_list_item.py | 1 + stripe/api_resources/refund.py | 3 +- stripe/api_resources/reporting/report_run.py | 1 + stripe/api_resources/reporting/report_type.py | 1 + stripe/api_resources/review.py | 1 + stripe/api_resources/setup_attempt.py | 13 + stripe/api_resources/setup_intent.py | 250 +++++++++++++++++ stripe/api_resources/shipping_rate.py | 1 + .../sigma/scheduled_query_run.py | 1 + stripe/api_resources/subscription.py | 1 + stripe/api_resources/subscription_item.py | 1 + stripe/api_resources/subscription_schedule.py | 1 + stripe/api_resources/tax/registration.py | 1 + stripe/api_resources/tax_code.py | 1 + stripe/api_resources/tax_rate.py | 1 + .../api_resources/terminal/configuration.py | 1 + stripe/api_resources/terminal/location.py | 1 + stripe/api_resources/terminal/reader.py | 1 + .../api_resources/test_helpers/test_clock.py | 1 + stripe/api_resources/topup.py | 1 + stripe/api_resources/transfer.py | 1 + .../api_resources/treasury/credit_reversal.py | 1 + .../api_resources/treasury/debit_reversal.py | 1 + .../treasury/financial_account.py | 1 + .../treasury/inbound_transfer.py | 1 + .../treasury/outbound_payment.py | 3 +- .../treasury/outbound_transfer.py | 3 +- .../api_resources/treasury/received_credit.py | 1 + .../api_resources/treasury/received_debit.py | 1 + stripe/api_resources/treasury/transaction.py | 1 + .../treasury/transaction_entry.py | 1 + stripe/api_resources/webhook_endpoint.py | 1 + 76 files changed, 677 insertions(+), 13 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d491c2801..1418e2ae4 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v669 \ No newline at end of file +v680 \ No newline at end of file diff --git a/stripe/api_resources/account.py b/stripe/api_resources/account.py index 0a4d7897b..995cf6c9b 100644 --- a/stripe/api_resources/account.py +++ b/stripe/api_resources/account.py @@ -3584,6 +3584,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/apple_pay_domain.py b/stripe/api_resources/apple_pay_domain.py index 74fea33b7..62d938b9e 100644 --- a/stripe/api_resources/apple_pay_domain.py +++ b/stripe/api_resources/apple_pay_domain.py @@ -171,6 +171,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/application_fee.py b/stripe/api_resources/application_fee.py index a8341f73b..2e570dbea 100644 --- a/stripe/api_resources/application_fee.py +++ b/stripe/api_resources/application_fee.py @@ -220,6 +220,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/apps/secret.py b/stripe/api_resources/apps/secret.py index 71c13cc4e..84ca30de9 100644 --- a/stripe/api_resources/apps/secret.py +++ b/stripe/api_resources/apps/secret.py @@ -281,6 +281,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/balance_transaction.py b/stripe/api_resources/balance_transaction.py index 8c141ac96..1cdaea9c9 100644 --- a/stripe/api_resources/balance_transaction.py +++ b/stripe/api_resources/balance_transaction.py @@ -283,6 +283,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/billing_portal/configuration.py b/stripe/api_resources/billing_portal/configuration.py index a51989e2c..a4f5f9983 100644 --- a/stripe/api_resources/billing_portal/configuration.py +++ b/stripe/api_resources/billing_portal/configuration.py @@ -694,6 +694,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/charge.py b/stripe/api_resources/charge.py index 89aab1953..340295c87 100644 --- a/stripe/api_resources/charge.py +++ b/stripe/api_resources/charge.py @@ -440,6 +440,22 @@ class ThreeDSecure(StripeObject): For authenticated transactions: how the customer was authenticated by the issuing bank. """ + electronic_commerce_indicator: Optional[ + Literal["01", "02", "05", "06", "07"] + ] + """ + The Electronic Commerce Indicator (ECI). A protocol-level field + indicating what degree of authentication was performed. + """ + exemption_indicator: Optional[Literal["low_risk", "none"]] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + exemption_indicator_applied: Optional[bool] + """ + Whether Stripe requested the value of `exemption_indicator` in the transaction. This will depend on + the outcome of Stripe's internal risk assessment. + """ result: Optional[ Literal[ "attempt_acknowledged", @@ -468,6 +484,11 @@ class ThreeDSecure(StripeObject): Additional information about why 3D Secure succeeded or failed based on the `result`. """ + transaction_id: Optional[str] + """ + The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID + (dsTransId) for this payment. + """ version: Optional[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was used. @@ -771,6 +792,12 @@ class ShippingAddress(StripeObject): } class CardPresent(StripeObject): + class Offline(StripeObject): + stored_at: Optional[int] + """ + Time at which the payment was collected while offline + """ + class Receipt(StripeObject): account_type: Optional[ Literal["checking", "credit", "prepaid", "unknown"] @@ -881,6 +908,10 @@ class Receipt(StripeObject): """ Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + offline: Optional[Offline] + """ + Details about payments collected offline. + """ overcapture_supported: bool """ Defines whether the authorized amount can be over-captured or not @@ -901,7 +932,7 @@ class Receipt(StripeObject): """ A collection of fields required to be displayed on receipts. Only required for EMV transactions. """ - _inner_class_types = {"receipt": Receipt} + _inner_class_types = {"offline": Offline, "receipt": Receipt} class Cashapp(StripeObject): buyer_id: Optional[str] @@ -2326,6 +2357,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/checkout/session.py b/stripe/api_resources/checkout/session.py index 3dd71e15a..504dcb675 100644 --- a/stripe/api_resources/checkout/session.py +++ b/stripe/api_resources/checkout/session.py @@ -3683,6 +3683,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/country_spec.py b/stripe/api_resources/country_spec.py index 33f82029d..792598426 100644 --- a/stripe/api_resources/country_spec.py +++ b/stripe/api_resources/country_spec.py @@ -121,6 +121,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/coupon.py b/stripe/api_resources/coupon.py index ff1fd9e4a..8a7c65ca8 100644 --- a/stripe/api_resources/coupon.py +++ b/stripe/api_resources/coupon.py @@ -346,6 +346,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/credit_note.py b/stripe/api_resources/credit_note.py index 1730eb955..aa30465ce 100644 --- a/stripe/api_resources/credit_note.py +++ b/stripe/api_resources/credit_note.py @@ -779,6 +779,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/credit_note_line_item.py b/stripe/api_resources/credit_note_line_item.py index e8449e08a..03ab05a90 100644 --- a/stripe/api_resources/credit_note_line_item.py +++ b/stripe/api_resources/credit_note_line_item.py @@ -177,6 +177,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/customer.py b/stripe/api_resources/customer.py index 3ec59d83d..151cb20ee 100644 --- a/stripe/api_resources/customer.py +++ b/stripe/api_resources/customer.py @@ -1637,6 +1637,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/customer_cash_balance_transaction.py b/stripe/api_resources/customer_cash_balance_transaction.py index b301962dc..cf9048360 100644 --- a/stripe/api_resources/customer_cash_balance_transaction.py +++ b/stripe/api_resources/customer_cash_balance_transaction.py @@ -133,6 +133,12 @@ class RefundedFromPayment(StripeObject): The [Refund](https://stripe.com/docs/api/refunds/object) that moved these funds into the customer's cash balance. """ + class TransferredToBalance(StripeObject): + balance_transaction: ExpandableField["BalanceTransaction"] + """ + The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds transferred to your Stripe balance. + """ + class UnappliedFromPayment(StripeObject): payment_intent: ExpandableField["PaymentIntent"] """ @@ -199,6 +205,7 @@ class RetrieveParams(RequestOptions): String representing the object's type. Objects of the same type share the same value. """ refunded_from_payment: Optional[RefundedFromPayment] + transferred_to_balance: Optional[TransferredToBalance] type: Literal[ "adjusted_for_overdraft", "applied_to_payment", @@ -237,6 +244,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) @@ -262,5 +270,6 @@ def retrieve( "applied_to_payment": AppliedToPayment, "funded": Funded, "refunded_from_payment": RefundedFromPayment, + "transferred_to_balance": TransferredToBalance, "unapplied_from_payment": UnappliedFromPayment, } diff --git a/stripe/api_resources/dispute.py b/stripe/api_resources/dispute.py index 360178414..dccf87375 100644 --- a/stripe/api_resources/dispute.py +++ b/stripe/api_resources/dispute.py @@ -552,6 +552,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/event.py b/stripe/api_resources/event.py index b571ecd87..64d75c581 100644 --- a/stripe/api_resources/event.py +++ b/stripe/api_resources/event.py @@ -31,8 +31,8 @@ class Event(ListableAPIResource["Event"]): `Event` objects directly to an endpoint on your server. You can manage webhooks in your [account settings](https://dashboard.stripe.com/account/webhooks). Learn how - to [listen for events] - (/docs/webhooks) so that your integration can automatically trigger reactions. + to [listen for events](https://stripe.com/docs/webhooks) + so that your integration can automatically trigger reactions. When using [Connect](https://stripe.com/docs/connect), you can also receive event notifications that occur in connected accounts. For these events, there's an @@ -405,6 +405,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/exchange_rate.py b/stripe/api_resources/exchange_rate.py index 6a53a9b9d..aac3471a7 100644 --- a/stripe/api_resources/exchange_rate.py +++ b/stripe/api_resources/exchange_rate.py @@ -98,6 +98,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/file.py b/stripe/api_resources/file.py index da98da642..c9b5f4280 100644 --- a/stripe/api_resources/file.py +++ b/stripe/api_resources/file.py @@ -163,6 +163,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/file_link.py b/stripe/api_resources/file_link.py index d01935296..8bdd6c763 100644 --- a/stripe/api_resources/file_link.py +++ b/stripe/api_resources/file_link.py @@ -204,6 +204,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/financial_connections/account.py b/stripe/api_resources/financial_connections/account.py index 5b2739a6c..0570eaa67 100644 --- a/stripe/api_resources/financial_connections/account.py +++ b/stripe/api_resources/financial_connections/account.py @@ -386,6 +386,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/identity/verification_report.py b/stripe/api_resources/identity/verification_report.py index 53b2eb0d4..5146a99aa 100644 --- a/stripe/api_resources/identity/verification_report.py +++ b/stripe/api_resources/identity/verification_report.py @@ -404,6 +404,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/identity/verification_session.py b/stripe/api_resources/identity/verification_session.py index 84c25f369..89d15c973 100644 --- a/stripe/api_resources/identity/verification_session.py +++ b/stripe/api_resources/identity/verification_session.py @@ -536,6 +536,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/invoice.py b/stripe/api_resources/invoice.py index 1c50f9953..6b099bfa8 100644 --- a/stripe/api_resources/invoice.py +++ b/stripe/api_resources/invoice.py @@ -3725,6 +3725,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/invoice_item.py b/stripe/api_resources/invoice_item.py index 2e649cf02..f29eb7d62 100644 --- a/stripe/api_resources/invoice_item.py +++ b/stripe/api_resources/invoice_item.py @@ -546,6 +546,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/authorization.py b/stripe/api_resources/issuing/authorization.py index 0d007ec8f..736117014 100644 --- a/stripe/api_resources/issuing/authorization.py +++ b/stripe/api_resources/issuing/authorization.py @@ -103,6 +103,14 @@ class NetworkData(StripeObject): """ Identifier assigned to the acquirer by the card network. Sometimes this value is not provided by the network; in this case, the value will be `null`. """ + system_trace_audit_number: Optional[str] + """ + The System Trace Audit Number (STAN) is a 6-digit identifier assigned by the acquirer. Prefer `network_data.transaction_id` if present, unless you have special requirements. + """ + transaction_id: Optional[str] + """ + Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + """ class PendingRequest(StripeObject): class AmountDetails(StripeObject): @@ -139,6 +147,10 @@ class AmountDetails(StripeObject): """ The local currency the merchant is requesting to authorize. """ + network_risk_score: Optional[int] + """ + The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99. + """ _inner_class_types = {"amount_details": AmountDetails} class RequestHistory(StripeObject): @@ -184,6 +196,10 @@ class AmountDetails(StripeObject): """ The currency that was collected by the merchant and presented to the cardholder for the authorization. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ + network_risk_score: Optional[int] + """ + The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99. + """ reason: Literal[ "account_disabled", "card_active", @@ -205,7 +221,11 @@ class AmountDetails(StripeObject): """ reason_message: Optional[str] """ - If approve/decline decision is directly responsed to the webhook with json payload and if the response is invalid (e.g., parsing errors), we surface the detailed message via this field. + If the `request_history.reason` is `webhook_error` because the direct webhook response is invalid (for example, parsing errors or missing parameters), we surface a more detailed error message via this field. + """ + requested_at: Optional[int] + """ + Time when the card network received an authorization request from the acquirer in UTC. Referred to by networks as transmission time. """ _inner_class_types = {"amount_details": AmountDetails} @@ -693,7 +713,7 @@ class ReverseParams(RequestOptions): amount: int """ - The total amount that was authorized or rejected. This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + The total amount that was authorized or rejected. This amount is in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `amount` should be the same as `merchant_amount`, unless `currency` and `merchant_currency` are different. """ amount_details: Optional[AmountDetails] """ @@ -727,7 +747,7 @@ class ReverseParams(RequestOptions): """ currency: str """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + The currency of the cardholder. This currency can be different from the currency presented at authorization and the `merchant_currency` field on this authorization. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ id: str """ @@ -739,11 +759,11 @@ class ReverseParams(RequestOptions): """ merchant_amount: int """ - The total amount that was authorized or rejected. This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + The total amount that was authorized or rejected. This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `merchant_amount` should be the same as `amount`, unless `merchant_currency` and `currency` are different. """ merchant_currency: str """ - The currency that was presented to the cardholder for the authorization. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + The local currency that was presented to the cardholder for the authorization. This currency can be different from the cardholder currency and the `currency` field on this authorization. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ merchant_data: MerchantData metadata: Dict[str, str] @@ -978,6 +998,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/card.py b/stripe/api_resources/issuing/card.py index 7c3f403f2..245fe249f 100644 --- a/stripe/api_resources/issuing/card.py +++ b/stripe/api_resources/issuing/card.py @@ -1570,6 +1570,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/cardholder.py b/stripe/api_resources/issuing/cardholder.py index bbae72b7d..525ab5eeb 100644 --- a/stripe/api_resources/issuing/cardholder.py +++ b/stripe/api_resources/issuing/cardholder.py @@ -1725,6 +1725,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/dispute.py b/stripe/api_resources/issuing/dispute.py index 14eabe3ff..7e929dd17 100644 --- a/stripe/api_resources/issuing/dispute.py +++ b/stripe/api_resources/issuing/dispute.py @@ -905,6 +905,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/token.py b/stripe/api_resources/issuing/token.py index a8f2599a1..84fb7491f 100644 --- a/stripe/api_resources/issuing/token.py +++ b/stripe/api_resources/issuing/token.py @@ -330,6 +330,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/transaction.py b/stripe/api_resources/issuing/transaction.py index c900e9cf8..e60d73cca 100644 --- a/stripe/api_resources/issuing/transaction.py +++ b/stripe/api_resources/issuing/transaction.py @@ -100,10 +100,18 @@ class MerchantData(StripeObject): """ class NetworkData(StripeObject): + authorization_code: Optional[str] + """ + A code created by Stripe which is shared with the merchant to validate the authorization. This field will be populated if the authorization message was approved. The code typically starts with the letter "S", followed by a six-digit number. For example, "S498162". Please note that the code is not guaranteed to be unique across authorizations. + """ processing_date: Optional[str] """ The date the transaction was processed by the card network. This can be different from the date the seller recorded the transaction depending on when the acquirer submits the transaction to the network. """ + transaction_id: Optional[str] + """ + Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + """ class PurchaseDetails(StripeObject): class Flight(StripeObject): @@ -796,6 +804,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payment_intent.py b/stripe/api_resources/payment_intent.py index 05ea58556..5d32f3d7a 100644 --- a/stripe/api_resources/payment_intent.py +++ b/stripe/api_resources/payment_intent.py @@ -2757,6 +2757,93 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ + three_d_secure: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this payment. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: str + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + network_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: str + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: Literal["1.0.2", "2.1.0", "2.2.0"] + """ + The version of 3D Secure that was performed. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int @@ -4573,6 +4660,93 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ + three_d_secure: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this payment. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: str + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + network_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: str + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: Literal["1.0.2", "2.1.0", "2.2.0"] + """ + The version of 3D Secure that was performed. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int @@ -6395,6 +6569,93 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ + three_d_secure: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this payment. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: str + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + exemption_indicator: NotRequired["Literal['low_risk', 'none']"] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + network_options: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: str + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: Literal["1.0.2", "2.1.0", "2.2.0"] + """ + The version of 3D Secure that was performed. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int @@ -8041,6 +8302,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payment_link.py b/stripe/api_resources/payment_link.py index a62428c75..90456e349 100644 --- a/stripe/api_resources/payment_link.py +++ b/stripe/api_resources/payment_link.py @@ -2125,6 +2125,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payment_method.py b/stripe/api_resources/payment_method.py index 620b7832e..3067ea3c0 100644 --- a/stripe/api_resources/payment_method.py +++ b/stripe/api_resources/payment_method.py @@ -1946,6 +1946,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payment_method_configuration.py b/stripe/api_resources/payment_method_configuration.py index 287aac02d..216561cb2 100644 --- a/stripe/api_resources/payment_method_configuration.py +++ b/stripe/api_resources/payment_method_configuration.py @@ -2256,6 +2256,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payment_method_domain.py b/stripe/api_resources/payment_method_domain.py index cf6d51c8b..31d925273 100644 --- a/stripe/api_resources/payment_method_domain.py +++ b/stripe/api_resources/payment_method_domain.py @@ -251,6 +251,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payout.py b/stripe/api_resources/payout.py index a48accf80..58868fdc1 100644 --- a/stripe/api_resources/payout.py +++ b/stripe/api_resources/payout.py @@ -408,6 +408,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/plan.py b/stripe/api_resources/plan.py index db01f0b74..ea97a0727 100644 --- a/stripe/api_resources/plan.py +++ b/stripe/api_resources/plan.py @@ -473,6 +473,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/price.py b/stripe/api_resources/price.py index 4fc0489ca..c4e275d2f 100644 --- a/stripe/api_resources/price.py +++ b/stripe/api_resources/price.py @@ -759,7 +759,7 @@ def list( ] # pyright: ignore[reportGeneralTypeIssues] ) -> ListObject["Price"]: """ - Returns a list of your active prices. For the list of inactive prices, set active to false. + Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. """ result = cls._static_request( "get", @@ -770,6 +770,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/product.py b/stripe/api_resources/product.py index 93ba6e9c5..f99421d9b 100644 --- a/stripe/api_resources/product.py +++ b/stripe/api_resources/product.py @@ -633,6 +633,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/promotion_code.py b/stripe/api_resources/promotion_code.py index 6945a2c59..5050025d9 100644 --- a/stripe/api_resources/promotion_code.py +++ b/stripe/api_resources/promotion_code.py @@ -321,6 +321,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/quote.py b/stripe/api_resources/quote.py index efb572413..df4518dec 100644 --- a/stripe/api_resources/quote.py +++ b/stripe/api_resources/quote.py @@ -1310,6 +1310,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/radar/early_fraud_warning.py b/stripe/api_resources/radar/early_fraud_warning.py index 02795e374..024818bdc 100644 --- a/stripe/api_resources/radar/early_fraud_warning.py +++ b/stripe/api_resources/radar/early_fraud_warning.py @@ -111,6 +111,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/radar/value_list.py b/stripe/api_resources/radar/value_list.py index 08a970eb0..8aef25226 100644 --- a/stripe/api_resources/radar/value_list.py +++ b/stripe/api_resources/radar/value_list.py @@ -283,6 +283,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/radar/value_list_item.py b/stripe/api_resources/radar/value_list_item.py index c1457a8d3..babe6797c 100644 --- a/stripe/api_resources/radar/value_list_item.py +++ b/stripe/api_resources/radar/value_list_item.py @@ -223,6 +223,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/refund.py b/stripe/api_resources/refund.py index 2571ccecb..5ef21d717 100644 --- a/stripe/api_resources/refund.py +++ b/stripe/api_resources/refund.py @@ -240,7 +240,7 @@ class ExpireParams(RequestOptions): """ status: Optional[str] """ - Status of the refund. For credit card refunds, this can be `pending`, `succeeded`, or `failed`. For other types of refunds, it can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). + Status of the refund. This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). """ transfer_reversal: Optional[ExpandableField["Reversal"]] """ @@ -394,6 +394,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/reporting/report_run.py b/stripe/api_resources/reporting/report_run.py index 0a7788890..dff9ad09c 100644 --- a/stripe/api_resources/reporting/report_run.py +++ b/stripe/api_resources/reporting/report_run.py @@ -260,6 +260,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/reporting/report_type.py b/stripe/api_resources/reporting/report_type.py index a3e1d73ab..d2060a4a4 100644 --- a/stripe/api_resources/reporting/report_type.py +++ b/stripe/api_resources/reporting/report_type.py @@ -94,6 +94,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/review.py b/stripe/api_resources/review.py index 7cb4047b1..3e7916e3d 100644 --- a/stripe/api_resources/review.py +++ b/stripe/api_resources/review.py @@ -283,6 +283,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/setup_attempt.py b/stripe/api_resources/setup_attempt.py index 6d4dcffe0..f66bc04cf 100644 --- a/stripe/api_resources/setup_attempt.py +++ b/stripe/api_resources/setup_attempt.py @@ -109,6 +109,13 @@ class ThreeDSecure(StripeObject): For authenticated transactions: how the customer was authenticated by the issuing bank. """ + electronic_commerce_indicator: Optional[ + Literal["01", "02", "05", "06", "07"] + ] + """ + The Electronic Commerce Indicator (ECI). A protocol-level field + indicating what degree of authentication was performed. + """ result: Optional[ Literal[ "attempt_acknowledged", @@ -137,6 +144,11 @@ class ThreeDSecure(StripeObject): Additional information about why 3D Secure succeeded or failed based on the `result`. """ + transaction_id: Optional[str] + """ + The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID + (dsTransId) for this payment. + """ version: Optional[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was used. @@ -771,6 +783,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/setup_intent.py b/stripe/api_resources/setup_intent.py index b72b85c89..a8e1890cf 100644 --- a/stripe/api_resources/setup_intent.py +++ b/stripe/api_resources/setup_intent.py @@ -765,6 +765,89 @@ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + three_d_secure: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this setup. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: NotRequired["str"] + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + network_options: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: NotRequired["str"] + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + """ + The version of 3D Secure that was performed. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int @@ -1623,6 +1706,89 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + three_d_secure: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this setup. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: NotRequired["str"] + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + network_options: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: NotRequired["str"] + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + """ + The version of 3D Secure that was performed. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int @@ -2475,6 +2641,89 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + three_d_secure: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this setup. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']" + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: NotRequired["str"] + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + "Literal['01', '02', '05', '06', '07']" + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + network_options: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired["str"] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: NotRequired["str"] + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: NotRequired["Literal['1.0.2', '2.1.0', '2.2.0']"] + """ + The version of 3D Secure that was performed. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired["str"] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired["int"] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int @@ -3457,6 +3706,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/shipping_rate.py b/stripe/api_resources/shipping_rate.py index 070be0107..09949c894 100644 --- a/stripe/api_resources/shipping_rate.py +++ b/stripe/api_resources/shipping_rate.py @@ -385,6 +385,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/sigma/scheduled_query_run.py b/stripe/api_resources/sigma/scheduled_query_run.py index 92de76f59..09046a69d 100644 --- a/stripe/api_resources/sigma/scheduled_query_run.py +++ b/stripe/api_resources/sigma/scheduled_query_run.py @@ -117,6 +117,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/subscription.py b/stripe/api_resources/subscription.py index 1b11202f8..3e8ab0af2 100644 --- a/stripe/api_resources/subscription.py +++ b/stripe/api_resources/subscription.py @@ -2048,6 +2048,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/subscription_item.py b/stripe/api_resources/subscription_item.py index ced9b9eac..974043e4b 100644 --- a/stripe/api_resources/subscription_item.py +++ b/stripe/api_resources/subscription_item.py @@ -494,6 +494,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/subscription_schedule.py b/stripe/api_resources/subscription_schedule.py index 86e23981c..39a0413ff 100644 --- a/stripe/api_resources/subscription_schedule.py +++ b/stripe/api_resources/subscription_schedule.py @@ -1417,6 +1417,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/tax/registration.py b/stripe/api_resources/tax/registration.py index 247376fa4..39d26a8a0 100644 --- a/stripe/api_resources/tax/registration.py +++ b/stripe/api_resources/tax/registration.py @@ -1679,6 +1679,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/tax_code.py b/stripe/api_resources/tax_code.py index 5852fd13b..005b05c40 100644 --- a/stripe/api_resources/tax_code.py +++ b/stripe/api_resources/tax_code.py @@ -77,6 +77,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/tax_rate.py b/stripe/api_resources/tax_rate.py index 59577472d..9df39a4e2 100644 --- a/stripe/api_resources/tax_rate.py +++ b/stripe/api_resources/tax_rate.py @@ -295,6 +295,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/terminal/configuration.py b/stripe/api_resources/terminal/configuration.py index 439747fc3..5cbd0a8f7 100644 --- a/stripe/api_resources/terminal/configuration.py +++ b/stripe/api_resources/terminal/configuration.py @@ -1027,6 +1027,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/terminal/location.py b/stripe/api_resources/terminal/location.py index 1c5545061..72599a943 100644 --- a/stripe/api_resources/terminal/location.py +++ b/stripe/api_resources/terminal/location.py @@ -301,6 +301,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/terminal/reader.py b/stripe/api_resources/terminal/reader.py index 0142e3c44..0c449cccb 100644 --- a/stripe/api_resources/terminal/reader.py +++ b/stripe/api_resources/terminal/reader.py @@ -705,6 +705,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/test_helpers/test_clock.py b/stripe/api_resources/test_helpers/test_clock.py index 8de0e3984..2a116ee90 100644 --- a/stripe/api_resources/test_helpers/test_clock.py +++ b/stripe/api_resources/test_helpers/test_clock.py @@ -291,6 +291,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/topup.py b/stripe/api_resources/topup.py index 7b5e89a9c..fd8883168 100644 --- a/stripe/api_resources/topup.py +++ b/stripe/api_resources/topup.py @@ -362,6 +362,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/transfer.py b/stripe/api_resources/transfer.py index f4e65475a..d640c7d36 100644 --- a/stripe/api_resources/transfer.py +++ b/stripe/api_resources/transfer.py @@ -325,6 +325,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/credit_reversal.py b/stripe/api_resources/treasury/credit_reversal.py index b99af2111..8fd7ac9e4 100644 --- a/stripe/api_resources/treasury/credit_reversal.py +++ b/stripe/api_resources/treasury/credit_reversal.py @@ -186,6 +186,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/debit_reversal.py b/stripe/api_resources/treasury/debit_reversal.py index 968878cc8..b24fb6756 100644 --- a/stripe/api_resources/treasury/debit_reversal.py +++ b/stripe/api_resources/treasury/debit_reversal.py @@ -200,6 +200,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/financial_account.py b/stripe/api_resources/treasury/financial_account.py index 87508edff..e7a217878 100644 --- a/stripe/api_resources/treasury/financial_account.py +++ b/stripe/api_resources/treasury/financial_account.py @@ -816,6 +816,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/inbound_transfer.py b/stripe/api_resources/treasury/inbound_transfer.py index 87e7f9750..48a16b94d 100644 --- a/stripe/api_resources/treasury/inbound_transfer.py +++ b/stripe/api_resources/treasury/inbound_transfer.py @@ -467,6 +467,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/outbound_payment.py b/stripe/api_resources/treasury/outbound_payment.py index 9dddf4076..b9d3f4a1c 100644 --- a/stripe/api_resources/treasury/outbound_payment.py +++ b/stripe/api_resources/treasury/outbound_payment.py @@ -239,7 +239,7 @@ class CreateParams(RequestOptions): """ statement_descriptor: NotRequired["str"] """ - The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `wire` payments, or 500 characters for `stripe` network transfers. The default value is `payment`. + The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `us_domestic_wire` payments, or 500 characters for `stripe` network transfers. The default value is "payment". """ class CreateParamsEndUserDetails(TypedDict): @@ -645,6 +645,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/outbound_transfer.py b/stripe/api_resources/treasury/outbound_transfer.py index 5ae606d00..45dbe2760 100644 --- a/stripe/api_resources/treasury/outbound_transfer.py +++ b/stripe/api_resources/treasury/outbound_transfer.py @@ -201,7 +201,7 @@ class CreateParams(RequestOptions): """ statement_descriptor: NotRequired["str"] """ - Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. The default value is `transfer`. + Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". """ class CreateParamsDestinationPaymentMethodOptions(TypedDict): @@ -484,6 +484,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/received_credit.py b/stripe/api_resources/treasury/received_credit.py index 7829f7ef4..541d889ec 100644 --- a/stripe/api_resources/treasury/received_credit.py +++ b/stripe/api_resources/treasury/received_credit.py @@ -383,6 +383,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/received_debit.py b/stripe/api_resources/treasury/received_debit.py index f7a955fe8..8c34df2ee 100644 --- a/stripe/api_resources/treasury/received_debit.py +++ b/stripe/api_resources/treasury/received_debit.py @@ -332,6 +332,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/transaction.py b/stripe/api_resources/treasury/transaction.py index 128dfde6f..eee64ad98 100644 --- a/stripe/api_resources/treasury/transaction.py +++ b/stripe/api_resources/treasury/transaction.py @@ -295,6 +295,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/transaction_entry.py b/stripe/api_resources/treasury/transaction_entry.py index 19deffa01..f079f173e 100644 --- a/stripe/api_resources/treasury/transaction_entry.py +++ b/stripe/api_resources/treasury/transaction_entry.py @@ -287,6 +287,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/webhook_endpoint.py b/stripe/api_resources/webhook_endpoint.py index 5df5097de..2e542bef9 100644 --- a/stripe/api_resources/webhook_endpoint.py +++ b/stripe/api_resources/webhook_endpoint.py @@ -495,6 +495,7 @@ def list( params=params, ) if not isinstance(result, ListObject): + raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) From fdad6c85d78f82275518e60b8d0afd48387aa3f5 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Tue, 21 Nov 2023 12:07:34 -0800 Subject: [PATCH 14/14] Bump version to 7.6.0 --- CHANGELOG.md | 15 ++++++++++++++- VERSION | 2 +- stripe/version.py | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2240f5508..660c78e47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## 7.6.0 - 2023-11-21 +* [#1138](https://github.com/stripe/stripe-python/pull/1138) Update generated code + * Add support for `electronic_commerce_indicator` on resource classes `Charge.PaymentMethodDetails.Card.ThreeDSecure` and `SetupAttempt.PaymentMethodDetails.Card.ThreeDSecure` + * Add support for `exemption_indicator` on resource class `Charge.PaymentMethodDetails.Card.ThreeDSecure` + * Add support for `transaction_id` on resource classes `Charge.PaymentMethodDetails.Card.ThreeDSecure`, `SetupAttempt.PaymentMethodDetails.Card.ThreeDSecure`, `issuing.Authorization.NetworkData`, and `issuing.Transaction.NetworkData` + * Add support for `offline` on resource class `Charge.PaymentMethodDetails.CardPresent` + * Add support for `transferred_to_balance` on resource `CustomerCashBalanceTransaction` + * Add support for `three_d_secure` on parameter classes `PaymentIntent.ConfirmParamsPaymentMethodOptionsCard`, `PaymentIntent.CreateParamsPaymentMethodOptionsCard`, `PaymentIntent.ModifyParamsPaymentMethodOptionsCard`, `SetupIntent.ConfirmParamsPaymentMethodOptionsCard`, `SetupIntent.CreateParamsPaymentMethodOptionsCard`, and `SetupIntent.ModifyParamsPaymentMethodOptionsCard` + * Add support for `system_trace_audit_number` on resource class `issuing.Authorization.NetworkData` + * Add support for `network_risk_score` on resource classes `issuing.Authorization.PendingRequest` and `issuing.Authorization.RequestHistory` + * Add support for `requested_at` on resource class `issuing.Authorization.RequestHistory` + * Add support for `authorization_code` on resource class `issuing.Transaction.NetworkData` + ## 7.5.0 - 2023-11-16 * [#1127](https://github.com/stripe/stripe-python/pull/1127) Update generated code * Add support for `bacs_debit_payments` on `Account.CreateParamsSettings` @@ -10,7 +23,7 @@ * [#1135](https://github.com/stripe/stripe-python/pull/1135) Add initial tests for exports and run them in mypy and pyright * [#1130](https://github.com/stripe/stripe-python/pull/1130) Mention types in README.md * [#1134](https://github.com/stripe/stripe-python/pull/1134) Run pyright via tox -* [#1131](https://github.com/stripe/stripe-python/pull/1131) Upgrade black dependency +* [#1131](https://github.com/stripe/stripe-python/pull/1131) Upgrade black dependency * [#1132](https://github.com/stripe/stripe-python/pull/1132) Fix unnecessary casts from pyright 1.1.336 * [#1126](https://github.com/stripe/stripe-python/pull/1126) Suppress type errors from latest pyright * [#1125](https://github.com/stripe/stripe-python/pull/1125) Add support for Python 3.11/3.12 diff --git a/VERSION b/VERSION index 18bb4182d..93c8ddab9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.5.0 +7.6.0 diff --git a/stripe/version.py b/stripe/version.py index 94bf91ae7..1d8b14888 100644 --- a/stripe/version.py +++ b/stripe/version.py @@ -1 +1 @@ -VERSION = "7.5.0" +VERSION = "7.6.0"