diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d45ce2be..f05d5f667 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 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.6.0b1 - 2023-11-16 * [#1128](https://github.com/stripe/stripe-python/pull/1128) Update generated code for beta * Add support for `issuing_card` and `issuing_cards_list` on `AccountSession.CreateParamsComponents` @@ -21,7 +34,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/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/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/stripe/api_resources/charge.py b/stripe/api_resources/charge.py index 6ba97d2f6..53766adc3 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] @@ -1936,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. @@ -2072,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. @@ -2148,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. @@ -2358,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. @@ -2835,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. @@ -2971,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. @@ -3047,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. @@ -3257,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/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, } 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} diff --git a/stripe/api_resources/event.py b/stripe/api_resources/event.py index 968645297..c147cec0b 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 diff --git a/stripe/api_resources/issuing/authorization.py b/stripe/api_resources/issuing/authorization.py index f77533004..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] 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): diff --git a/stripe/api_resources/payment_intent.py b/stripe/api_resources/payment_intent.py index afdbcdc73..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. @@ -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[ @@ -4769,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. @@ -4907,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. @@ -4983,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. @@ -5193,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. @@ -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[ @@ -7295,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. @@ -7431,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. @@ -7507,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. @@ -7717,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. @@ -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[ @@ -9819,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. @@ -9955,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. @@ -10031,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. @@ -10241,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. 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", 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"]] """ 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 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): diff --git a/tests/test_exports.py b/tests/test_exports.py index 5b1541125..ad24702fb 100644 --- a/tests/test_exports.py +++ b/tests/test_exports.py @@ -1,4 +1,5 @@ # pyright: strict +from typing import Any import stripe @@ -22,18 +23,90 @@ def test_can_import_webhook_members() -> None: assert WebhookSignature is not None -def test_can_import_abstract() -> None: - from stripe.api_resources.abstract import ( - APIResource as APIResourceFromApiResourcesAbstract, +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: + # 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: