diff --git a/API_VERSION b/API_VERSION index 652341448..7fa3a2d3c 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -b3c36f1e05eaa7339c3d0d5e862e76cfff6c6bed \ No newline at end of file +577fcb57736b925392ea563c0284df9002c75ac9 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d1d1d3621..8a7edbe68 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2080 \ No newline at end of file +v2100 \ No newline at end of file diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 6baf0f3a6..03e85f272 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -460,6 +460,10 @@ "stripe.v2.billing._pricing_plan_subscription", "PricingPlanSubscription", ), + "v2.billing.pricing_plan_subscription_components": ( + "stripe.v2.billing._pricing_plan_subscription_components", + "PricingPlanSubscriptionComponents", + ), "v2.billing.pricing_plan_version": ( "stripe.v2.billing._pricing_plan_version", "PricingPlanVersion", diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index 5f7d7b114..b3faa7592 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -77,6 +77,10 @@ class ValueSettings(StripeObject): """ customer_mapping: CustomerMapping default_aggregation: DefaultAggregation + dimension_payload_keys: Optional[List[str]] + """ + Set of keys that will be used to group meter events by. + """ display_name: str """ The meter's name. diff --git a/stripe/billing/_meter_event_summary.py b/stripe/billing/_meter_event_summary.py index 823b330c3..ca9ab2dbf 100644 --- a/stripe/billing/_meter_event_summary.py +++ b/stripe/billing/_meter_event_summary.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject -from typing import ClassVar +from typing import ClassVar, Dict, Optional from typing_extensions import Literal @@ -20,6 +20,10 @@ class MeterEventSummary(StripeObject): """ Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`. """ + dimensions: Optional[Dict[str, str]] + """ + Key-value pairs of dimension values for event summaries with grouping on dimensions. + """ end_time: int """ End timestamp for this event summary (exclusive). Must be aligned with minute boundaries. diff --git a/stripe/delegated_checkout/_requested_session.py b/stripe/delegated_checkout/_requested_session.py index d1e48bbe3..5908c2cb8 100644 --- a/stripe/delegated_checkout/_requested_session.py +++ b/stripe/delegated_checkout/_requested_session.py @@ -4,7 +4,7 @@ from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -38,8 +38,188 @@ class RequestedSession( ) class FulfillmentDetails(StripeObject): + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: Optional[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class FulfillmentOption(StripeObject): + class Shipping(StripeObject): + class ShippingOption(StripeObject): + description: Optional[str] + """ + The description of the shipping option. + """ + display_name: str + """ + The display name of the shipping option. + """ + earliest_delivery_time: Optional[int] + """ + The earliest delivery time of the shipping option. + """ + key: str + """ + The key of the shipping option. + """ + latest_delivery_time: Optional[int] + """ + The latest delivery time of the shipping option. + """ + shipping_amount: int + """ + The shipping amount of the shipping option. + """ + + shipping_options: Optional[List[ShippingOption]] + """ + The shipping options. + """ + _inner_class_types = {"shipping_options": ShippingOption} + + shipping: Optional[Shipping] + """ + The shipping option. + """ + type: str + """ + The type of the fulfillment option. + """ + _inner_class_types = {"shipping": Shipping} + + class SelectedFulfillmentOption(StripeObject): + class Shipping(StripeObject): + shipping_option: Optional[str] + """ + The shipping option. + """ + + shipping: Optional[Shipping] + """ + The shipping option. + """ + type: str + """ + The type of the selected fulfillment option. + """ + _inner_class_types = {"shipping": Shipping} + + address: Optional[Address] + """ + The fulfillment address. + """ + email: Optional[str] + """ + The email address for the fulfillment details. + """ + fulfillment_options: Optional[List[FulfillmentOption]] + """ + The fulfillment options. + """ + name: Optional[str] + """ + The name for the fulfillment details. + """ + phone: Optional[str] + """ + The phone number for the fulfillment details. + """ + selected_fulfillment_option: Optional[SelectedFulfillmentOption] + """ + The fulfillment option. + """ + _inner_class_types = { + "address": Address, + "fulfillment_options": FulfillmentOption, + "selected_fulfillment_option": SelectedFulfillmentOption, + } + + class LineItemDetail(StripeObject): + description: Optional[str] + """ + The description of the line item. + """ + images: Optional[List[str]] + """ + The images of the line item. + """ + key: str + """ + The key of the line item. + """ + name: str + """ + The name of the line item. + """ + quantity: int + """ + The quantity of the line item. + """ + sku_id: str + """ + The SKU ID of the line item. + """ + unit_amount: int + """ + The unit amount of the line item. + """ + + class OrderDetails(StripeObject): + order_status_url: Optional[str] + """ + The URL to the order status. + """ + + class SellerDetails(StripeObject): pass + class TotalDetails(StripeObject): + amount_discount: Optional[int] + """ + The amount discount of the total details. + """ + amount_fulfillment: Optional[int] + """ + The amount fulfillment of the total details. + """ + amount_tax: Optional[int] + """ + The amount tax of the total details. + """ + + amount_subtotal: int + """ + The subtotal amount of the requested session. + """ + amount_total: int + """ + The total amount of the requested session. + """ + created_at: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ 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). @@ -48,19 +228,64 @@ class FulfillmentDetails(StripeObject): """ The customer for this requested session. """ + expires_at: int + """ + Time at which the requested session expires. Measured in seconds since the Unix epoch. + """ fulfillment_details: Optional[FulfillmentDetails] + """ + The details of the fulfillment. + """ id: str """ Unique identifier for the object. """ + line_item_details: List[LineItemDetail] + """ + The line items to be purchased. + """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ object: Literal["delegated_checkout.requested_session"] """ String representing the object's type. Objects of the same type share the same value. """ + order_details: Optional[OrderDetails] + """ + The details of the order. + """ + payment_method: Optional[str] + """ + The payment method used for the requested session. + """ + seller_details: SellerDetails + setup_future_usage: Optional[Literal["on_session"]] + """ + Whether or not the payment method should be saved for future use. + """ + shared_metadata: Optional[Dict[str, str]] + """ + The metadata shared with the seller. + """ + shared_payment_issued_token: Optional[str] + """ + The SPT used for payment. + """ + status: Literal["completed", "expired", "open"] + """ + The status of the requested session. + """ + total_details: TotalDetails + updated_at: int + """ + Time at which the object was last updated. Measured in seconds since the Unix epoch. + """ @classmethod def _cls_confirm( @@ -382,4 +607,10 @@ async def retrieve_async( await instance.refresh_async() return instance - _inner_class_types = {"fulfillment_details": FulfillmentDetails} + _inner_class_types = { + "fulfillment_details": FulfillmentDetails, + "line_item_details": LineItemDetail, + "order_details": OrderDetails, + "seller_details": SellerDetails, + "total_details": TotalDetails, + } diff --git a/stripe/delegated_checkout/_requested_session_service.py b/stripe/delegated_checkout/_requested_session_service.py index b41d653eb..94a8d31ab 100644 --- a/stripe/delegated_checkout/_requested_session_service.py +++ b/stripe/delegated_checkout/_requested_session_service.py @@ -116,7 +116,7 @@ async def update_async( def create( self, - params: Optional["RequestedSessionCreateParams"] = None, + params: "RequestedSessionCreateParams", options: Optional["RequestOptions"] = None, ) -> "RequestedSession": """ @@ -135,7 +135,7 @@ def create( async def create_async( self, - params: Optional["RequestedSessionCreateParams"] = None, + params: "RequestedSessionCreateParams", options: Optional["RequestOptions"] = None, ) -> "RequestedSession": """ diff --git a/stripe/events/_v2_core_health_authorization_rate_drop_firing_event.py b/stripe/events/_v2_core_health_authorization_rate_drop_firing_event.py index e442132a0..34c5dcb9e 100644 --- a/stripe/events/_v2_core_health_authorization_rate_drop_firing_event.py +++ b/stripe/events/_v2_core_health_authorization_rate_drop_firing_event.py @@ -73,12 +73,14 @@ class Dimension(StripeObject): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", "card_present", "cartes_bancaires", "cashapp", + "crypto", "dummy_passthrough_card", "eps", "fpx", @@ -89,25 +91,45 @@ class Dimension(StripeObject): "kakao_pay", "klarna", "konbini", + "kriya", + "kr_card", "link", + "mb_way", "mobilepay", + "mondu", "multibanco", "naver_pay", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", "oxxo", "p24", "paper_check", + "payco", "paynow", "paypal", + "paypay", "payto", "pay_by_bank", "pix", "promptpay", + "rechnung", "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", "sepa_debit", + "sequra", "sofort", + "sunbit", "swish", "twint", "upi", + "us_bank_account", + "vipps", "wechat_pay", "zip", ] diff --git a/stripe/events/_v2_core_health_authorization_rate_drop_resolved_event.py b/stripe/events/_v2_core_health_authorization_rate_drop_resolved_event.py index 9a8705e0f..c7b823470 100644 --- a/stripe/events/_v2_core_health_authorization_rate_drop_resolved_event.py +++ b/stripe/events/_v2_core_health_authorization_rate_drop_resolved_event.py @@ -73,12 +73,14 @@ class Dimension(StripeObject): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", "card_present", "cartes_bancaires", "cashapp", + "crypto", "dummy_passthrough_card", "eps", "fpx", @@ -89,25 +91,45 @@ class Dimension(StripeObject): "kakao_pay", "klarna", "konbini", + "kriya", + "kr_card", "link", + "mb_way", "mobilepay", + "mondu", "multibanco", "naver_pay", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", "oxxo", "p24", "paper_check", + "payco", "paynow", "paypal", + "paypay", "payto", "pay_by_bank", "pix", "promptpay", + "rechnung", "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", "sepa_debit", + "sequra", "sofort", + "sunbit", "swish", "twint", "upi", + "us_bank_account", + "vipps", "wechat_pay", "zip", ] diff --git a/stripe/events/_v2_core_health_payment_method_error_firing_event.py b/stripe/events/_v2_core_health_payment_method_error_firing_event.py index 111970ea1..1a1371734 100644 --- a/stripe/events/_v2_core_health_payment_method_error_firing_event.py +++ b/stripe/events/_v2_core_health_payment_method_error_firing_event.py @@ -57,12 +57,14 @@ class Impact(StripeObject): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", "card_present", "cartes_bancaires", "cashapp", + "crypto", "dummy_passthrough_card", "eps", "fpx", @@ -73,25 +75,45 @@ class Impact(StripeObject): "kakao_pay", "klarna", "konbini", + "kriya", + "kr_card", "link", + "mb_way", "mobilepay", + "mondu", "multibanco", "naver_pay", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", "oxxo", "p24", "paper_check", + "payco", "paynow", "paypal", + "paypay", "payto", "pay_by_bank", "pix", "promptpay", + "rechnung", "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", "sepa_debit", + "sequra", "sofort", + "sunbit", "swish", "twint", "upi", + "us_bank_account", + "vipps", "wechat_pay", "zip", ] diff --git a/stripe/events/_v2_core_health_payment_method_error_resolved_event.py b/stripe/events/_v2_core_health_payment_method_error_resolved_event.py index 4255275ab..e2f38d4bd 100644 --- a/stripe/events/_v2_core_health_payment_method_error_resolved_event.py +++ b/stripe/events/_v2_core_health_payment_method_error_resolved_event.py @@ -59,12 +59,14 @@ class Impact(StripeObject): "au_becs_debit", "bacs_debit", "bancontact", + "billie", "blik", "boleto", "card", "card_present", "cartes_bancaires", "cashapp", + "crypto", "dummy_passthrough_card", "eps", "fpx", @@ -75,25 +77,45 @@ class Impact(StripeObject): "kakao_pay", "klarna", "konbini", + "kriya", + "kr_card", "link", + "mb_way", "mobilepay", + "mondu", "multibanco", "naver_pay", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", "oxxo", "p24", "paper_check", + "payco", "paynow", "paypal", + "paypay", "payto", "pay_by_bank", "pix", "promptpay", + "rechnung", "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", "sepa_debit", + "sequra", "sofort", + "sunbit", "swish", "twint", "upi", + "us_bank_account", + "vipps", "wechat_pay", "zip", ] diff --git a/stripe/events/_v2_money_management_transaction_created_event.py b/stripe/events/_v2_money_management_transaction_created_event.py index 08fb20e82..d9d137098 100644 --- a/stripe/events/_v2_money_management_transaction_created_event.py +++ b/stripe/events/_v2_money_management_transaction_created_event.py @@ -1,12 +1,15 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe._api_mode import ApiMode from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse from stripe._util import get_api_mode from stripe.v2.core._event import Event, EventNotification, RelatedObject -from typing import Any, Dict, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal, TYPE_CHECKING, override if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor from stripe._stripe_client import StripeClient from stripe.v2.money_management._transaction import Transaction @@ -76,6 +79,41 @@ class V2MoneyManagementTransactionCreatedEvent(Event): LOOKUP_TYPE = "v2.money_management.transaction.created" type: Literal["v2.money_management.transaction.created"] + class V2MoneyManagementTransactionCreatedEventData(StripeObject): + v1_id: Optional[str] + """ + Id of the v1 Transaction corresponding to this Transaction. + """ + + data: V2MoneyManagementTransactionCreatedEventData + """ + Data for the v2.money_management.transaction.created event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2MoneyManagementTransactionCreatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2MoneyManagementTransactionCreatedEvent.V2MoneyManagementTransactionCreatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + class RelatedObject(StripeObject): id: str """ diff --git a/stripe/params/billing/_meter_create_params.py b/stripe/params/billing/_meter_create_params.py index d1b7aeb47..b0642d4e0 100644 --- a/stripe/params/billing/_meter_create_params.py +++ b/stripe/params/billing/_meter_create_params.py @@ -34,6 +34,10 @@ class MeterCreateParams(RequestOptions): """ Fields that specify how to calculate a meter event's value. """ + dimension_payload_keys: NotRequired[List[str]] + """ + Set of keys that will be used to group meter events by. Each key must be present in the event payload. + """ class MeterCreateParamsCustomerMapping(TypedDict): diff --git a/stripe/params/billing/_meter_event_summary_list_params.py b/stripe/params/billing/_meter_event_summary_list_params.py index 3c5d49a64..a49699e33 100644 --- a/stripe/params/billing/_meter_event_summary_list_params.py +++ b/stripe/params/billing/_meter_event_summary_list_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -9,6 +9,14 @@ class MeterEventSummaryListParams(TypedDict): """ The customer for which to fetch event summaries. """ + dimension_filters: NotRequired[Dict[str, str]] + """ + Key-value pairs used to filter meter events by dimension values. If specified, event summaries will be generated with only matching meter events. + """ + dimension_group_by_keys: NotRequired[List[str]] + """ + List of dimension payload keys to group by. If specified, event summaries will be grouped by the given dimension payload key values. + """ end_time: int """ The timestamp from when to stop aggregating meter events (exclusive). Must be aligned with minute boundaries. diff --git a/stripe/params/billing/_meter_list_event_summaries_params.py b/stripe/params/billing/_meter_list_event_summaries_params.py index ac858160e..4b8a37d7c 100644 --- a/stripe/params/billing/_meter_list_event_summaries_params.py +++ b/stripe/params/billing/_meter_list_event_summaries_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import Dict, List from typing_extensions import Literal, NotRequired @@ -10,6 +10,14 @@ class MeterListEventSummariesParams(RequestOptions): """ The customer for which to fetch event summaries. """ + dimension_filters: NotRequired[Dict[str, str]] + """ + Key-value pairs used to filter meter events by dimension values. If specified, event summaries will be generated with only matching meter events. + """ + dimension_group_by_keys: NotRequired[List[str]] + """ + List of dimension payload keys to group by. If specified, event summaries will be grouped by the given dimension payload key values. + """ end_time: int """ The timestamp from when to stop aggregating meter events (exclusive). Must be aligned with minute boundaries. diff --git a/stripe/params/delegated_checkout/__init__.py b/stripe/params/delegated_checkout/__init__.py index 93875cfa3..1b8084bbb 100644 --- a/stripe/params/delegated_checkout/__init__.py +++ b/stripe/params/delegated_checkout/__init__.py @@ -9,18 +9,46 @@ ) from stripe.params.delegated_checkout._requested_session_create_params import ( RequestedSessionCreateParams as RequestedSessionCreateParams, + RequestedSessionCreateParamsFulfillmentDetails as RequestedSessionCreateParamsFulfillmentDetails, + RequestedSessionCreateParamsFulfillmentDetailsAddress as RequestedSessionCreateParamsFulfillmentDetailsAddress, + RequestedSessionCreateParamsLineItemDetail as RequestedSessionCreateParamsLineItemDetail, + RequestedSessionCreateParamsPaymentMethodData as RequestedSessionCreateParamsPaymentMethodData, + RequestedSessionCreateParamsPaymentMethodDataBillingDetails as RequestedSessionCreateParamsPaymentMethodDataBillingDetails, + RequestedSessionCreateParamsPaymentMethodDataBillingDetailsAddress as RequestedSessionCreateParamsPaymentMethodDataBillingDetailsAddress, + RequestedSessionCreateParamsPaymentMethodDataCard as RequestedSessionCreateParamsPaymentMethodDataCard, + RequestedSessionCreateParamsRiskDetails as RequestedSessionCreateParamsRiskDetails, + RequestedSessionCreateParamsRiskDetailsClientDeviceMetadataDetails as RequestedSessionCreateParamsRiskDetailsClientDeviceMetadataDetails, + RequestedSessionCreateParamsSellerDetails as RequestedSessionCreateParamsSellerDetails, ) from stripe.params.delegated_checkout._requested_session_expire_params import ( RequestedSessionExpireParams as RequestedSessionExpireParams, ) from stripe.params.delegated_checkout._requested_session_modify_params import ( RequestedSessionModifyParams as RequestedSessionModifyParams, + RequestedSessionModifyParamsFulfillmentDetails as RequestedSessionModifyParamsFulfillmentDetails, + RequestedSessionModifyParamsFulfillmentDetailsAddress as RequestedSessionModifyParamsFulfillmentDetailsAddress, + RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOption as RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOption, + RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOptionShipping as RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOptionShipping, + RequestedSessionModifyParamsLineItemDetail as RequestedSessionModifyParamsLineItemDetail, + RequestedSessionModifyParamsPaymentMethodData as RequestedSessionModifyParamsPaymentMethodData, + RequestedSessionModifyParamsPaymentMethodDataBillingDetails as RequestedSessionModifyParamsPaymentMethodDataBillingDetails, + RequestedSessionModifyParamsPaymentMethodDataBillingDetailsAddress as RequestedSessionModifyParamsPaymentMethodDataBillingDetailsAddress, + RequestedSessionModifyParamsPaymentMethodDataCard as RequestedSessionModifyParamsPaymentMethodDataCard, ) from stripe.params.delegated_checkout._requested_session_retrieve_params import ( RequestedSessionRetrieveParams as RequestedSessionRetrieveParams, ) from stripe.params.delegated_checkout._requested_session_update_params import ( RequestedSessionUpdateParams as RequestedSessionUpdateParams, + RequestedSessionUpdateParamsFulfillmentDetails as RequestedSessionUpdateParamsFulfillmentDetails, + RequestedSessionUpdateParamsFulfillmentDetailsAddress as RequestedSessionUpdateParamsFulfillmentDetailsAddress, + RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOption as RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOption, + RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOptionShipping as RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOptionShipping, + RequestedSessionUpdateParamsLineItemDetail as RequestedSessionUpdateParamsLineItemDetail, + RequestedSessionUpdateParamsPaymentMethodData as RequestedSessionUpdateParamsPaymentMethodData, + RequestedSessionUpdateParamsPaymentMethodDataBillingDetails as RequestedSessionUpdateParamsPaymentMethodDataBillingDetails, + RequestedSessionUpdateParamsPaymentMethodDataBillingDetailsAddress as RequestedSessionUpdateParamsPaymentMethodDataBillingDetailsAddress, + RequestedSessionUpdateParamsPaymentMethodDataCard as RequestedSessionUpdateParamsPaymentMethodDataCard, ) # name -> (import_target, is_submodule) @@ -33,6 +61,46 @@ "stripe.params.delegated_checkout._requested_session_create_params", False, ), + "RequestedSessionCreateParamsFulfillmentDetails": ( + "stripe.params.delegated_checkout._requested_session_create_params", + False, + ), + "RequestedSessionCreateParamsFulfillmentDetailsAddress": ( + "stripe.params.delegated_checkout._requested_session_create_params", + False, + ), + "RequestedSessionCreateParamsLineItemDetail": ( + "stripe.params.delegated_checkout._requested_session_create_params", + False, + ), + "RequestedSessionCreateParamsPaymentMethodData": ( + "stripe.params.delegated_checkout._requested_session_create_params", + False, + ), + "RequestedSessionCreateParamsPaymentMethodDataBillingDetails": ( + "stripe.params.delegated_checkout._requested_session_create_params", + False, + ), + "RequestedSessionCreateParamsPaymentMethodDataBillingDetailsAddress": ( + "stripe.params.delegated_checkout._requested_session_create_params", + False, + ), + "RequestedSessionCreateParamsPaymentMethodDataCard": ( + "stripe.params.delegated_checkout._requested_session_create_params", + False, + ), + "RequestedSessionCreateParamsRiskDetails": ( + "stripe.params.delegated_checkout._requested_session_create_params", + False, + ), + "RequestedSessionCreateParamsRiskDetailsClientDeviceMetadataDetails": ( + "stripe.params.delegated_checkout._requested_session_create_params", + False, + ), + "RequestedSessionCreateParamsSellerDetails": ( + "stripe.params.delegated_checkout._requested_session_create_params", + False, + ), "RequestedSessionExpireParams": ( "stripe.params.delegated_checkout._requested_session_expire_params", False, @@ -41,6 +109,42 @@ "stripe.params.delegated_checkout._requested_session_modify_params", False, ), + "RequestedSessionModifyParamsFulfillmentDetails": ( + "stripe.params.delegated_checkout._requested_session_modify_params", + False, + ), + "RequestedSessionModifyParamsFulfillmentDetailsAddress": ( + "stripe.params.delegated_checkout._requested_session_modify_params", + False, + ), + "RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOption": ( + "stripe.params.delegated_checkout._requested_session_modify_params", + False, + ), + "RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOptionShipping": ( + "stripe.params.delegated_checkout._requested_session_modify_params", + False, + ), + "RequestedSessionModifyParamsLineItemDetail": ( + "stripe.params.delegated_checkout._requested_session_modify_params", + False, + ), + "RequestedSessionModifyParamsPaymentMethodData": ( + "stripe.params.delegated_checkout._requested_session_modify_params", + False, + ), + "RequestedSessionModifyParamsPaymentMethodDataBillingDetails": ( + "stripe.params.delegated_checkout._requested_session_modify_params", + False, + ), + "RequestedSessionModifyParamsPaymentMethodDataBillingDetailsAddress": ( + "stripe.params.delegated_checkout._requested_session_modify_params", + False, + ), + "RequestedSessionModifyParamsPaymentMethodDataCard": ( + "stripe.params.delegated_checkout._requested_session_modify_params", + False, + ), "RequestedSessionRetrieveParams": ( "stripe.params.delegated_checkout._requested_session_retrieve_params", False, @@ -49,6 +153,42 @@ "stripe.params.delegated_checkout._requested_session_update_params", False, ), + "RequestedSessionUpdateParamsFulfillmentDetails": ( + "stripe.params.delegated_checkout._requested_session_update_params", + False, + ), + "RequestedSessionUpdateParamsFulfillmentDetailsAddress": ( + "stripe.params.delegated_checkout._requested_session_update_params", + False, + ), + "RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOption": ( + "stripe.params.delegated_checkout._requested_session_update_params", + False, + ), + "RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOptionShipping": ( + "stripe.params.delegated_checkout._requested_session_update_params", + False, + ), + "RequestedSessionUpdateParamsLineItemDetail": ( + "stripe.params.delegated_checkout._requested_session_update_params", + False, + ), + "RequestedSessionUpdateParamsPaymentMethodData": ( + "stripe.params.delegated_checkout._requested_session_update_params", + False, + ), + "RequestedSessionUpdateParamsPaymentMethodDataBillingDetails": ( + "stripe.params.delegated_checkout._requested_session_update_params", + False, + ), + "RequestedSessionUpdateParamsPaymentMethodDataBillingDetailsAddress": ( + "stripe.params.delegated_checkout._requested_session_update_params", + False, + ), + "RequestedSessionUpdateParamsPaymentMethodDataCard": ( + "stripe.params.delegated_checkout._requested_session_update_params", + False, + ), } if not TYPE_CHECKING: diff --git a/stripe/params/delegated_checkout/_requested_session_create_params.py b/stripe/params/delegated_checkout/_requested_session_create_params.py index 8ac8a3ff8..7dcbfa596 100644 --- a/stripe/params/delegated_checkout/_requested_session_create_params.py +++ b/stripe/params/delegated_checkout/_requested_session_create_params.py @@ -1,12 +1,243 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List -from typing_extensions import NotRequired +from typing import Dict, List +from typing_extensions import Literal, NotRequired, TypedDict class RequestedSessionCreateParams(RequestOptions): + currency: str + """ + The currency for this requested session. + """ + customer: NotRequired[str] + """ + The customer for this requested session. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ + fulfillment_details: NotRequired[ + "RequestedSessionCreateParamsFulfillmentDetails" + ] + """ + The details of the fulfillment. + """ + line_item_details: List["RequestedSessionCreateParamsLineItemDetail"] + """ + The details of the line items. + """ + metadata: NotRequired[Dict[str, str]] + """ + The metadata for this requested session. + """ + payment_method: NotRequired[str] + """ + The payment method for this requested session. + """ + payment_method_data: NotRequired[ + "RequestedSessionCreateParamsPaymentMethodData" + ] + """ + The payment method data for this requested session. + """ + risk_details: NotRequired["RequestedSessionCreateParamsRiskDetails"] + """ + The risk details for this requested session. + """ + seller_details: "RequestedSessionCreateParamsSellerDetails" + """ + The details of the seller. + """ + setup_future_usage: NotRequired[Literal["on_session"]] + """ + The setup future usage for this requested session. + """ + shared_metadata: NotRequired[Dict[str, str]] + """ + The shared metadata for this requested session. + """ + + +class RequestedSessionCreateParamsFulfillmentDetails(TypedDict): + address: NotRequired[ + "RequestedSessionCreateParamsFulfillmentDetailsAddress" + ] + email: NotRequired[str] + """ + The customer's email address. + """ + name: NotRequired[str] + """ + The customer's name. + """ + phone: NotRequired[str] + """ + The customer's phone number. + """ + + +class RequestedSessionCreateParamsFulfillmentDetailsAddress(TypedDict): + city: str + """ + City, district, suburb, town, or village. + """ + country: str + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: str + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: str + """ + ZIP or postal code. + """ + state: str + """ + State, county, province, or region. + """ + + +class RequestedSessionCreateParamsLineItemDetail(TypedDict): + quantity: int + """ + The quantity of the line item. + """ + sku_id: str + """ + The SKU ID of the line item. + """ + + +class RequestedSessionCreateParamsPaymentMethodData(TypedDict): + billing_details: NotRequired[ + "RequestedSessionCreateParamsPaymentMethodDataBillingDetails" + ] + """ + The billing details for the payment method data. + """ + card: NotRequired["RequestedSessionCreateParamsPaymentMethodDataCard"] + """ + The card for the payment method data. + """ + type: NotRequired[Literal["card"]] + """ + The type of the payment method data. + """ + + +class RequestedSessionCreateParamsPaymentMethodDataBillingDetails(TypedDict): + address: NotRequired[ + "RequestedSessionCreateParamsPaymentMethodDataBillingDetailsAddress" + ] + """ + The address for the billing details. + """ + email: NotRequired[str] + """ + The email for the billing details. + """ + name: NotRequired[str] + """ + The name for the billing details. + """ + phone: NotRequired[str] + """ + The phone for the billing details. + """ + + +class RequestedSessionCreateParamsPaymentMethodDataBillingDetailsAddress( + TypedDict, +): + city: str + """ + City, district, suburb, town, or village. + """ + country: str + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: str + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: str + """ + ZIP or postal code. + """ + state: str + """ + State, county, province, or region. + """ + + +class RequestedSessionCreateParamsPaymentMethodDataCard(TypedDict): + cvc: NotRequired[str] + """ + The CVC of the card. + """ + exp_month: int + """ + The expiration month of the card. + """ + exp_year: int + """ + The expiration year of the card. + """ + number: str + """ + The number of the card. + """ + + +class RequestedSessionCreateParamsRiskDetails(TypedDict): + client_device_metadata_details: NotRequired[ + "RequestedSessionCreateParamsRiskDetailsClientDeviceMetadataDetails" + ] + """ + The client device metadata details for this requested session. + """ + + +class RequestedSessionCreateParamsRiskDetailsClientDeviceMetadataDetails( + TypedDict, +): + radar_session: NotRequired[str] + """ + The radar session. + """ + referrer: NotRequired[str] + """ + The referrer of the client device. + """ + remote_ip: NotRequired[str] + """ + The remote IP address of the client device. + """ + time_on_page: NotRequired[int] + """ + The time on page in seconds. + """ + user_agent: NotRequired[str] + """ + The user agent of the client device. + """ + + +class RequestedSessionCreateParamsSellerDetails(TypedDict): + network_profile: str + """ + The network profile for the seller. + """ diff --git a/stripe/params/delegated_checkout/_requested_session_modify_params.py b/stripe/params/delegated_checkout/_requested_session_modify_params.py index 1b51e8a60..01ee9e6f7 100644 --- a/stripe/params/delegated_checkout/_requested_session_modify_params.py +++ b/stripe/params/delegated_checkout/_requested_session_modify_params.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List -from typing_extensions import NotRequired +from typing import Dict, List +from typing_extensions import Literal, NotRequired, TypedDict class RequestedSessionModifyParams(RequestOptions): @@ -10,3 +10,203 @@ class RequestedSessionModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + fulfillment_details: NotRequired[ + "RequestedSessionModifyParamsFulfillmentDetails" + ] + """ + The details of the fulfillment. + """ + line_item_details: NotRequired[ + List["RequestedSessionModifyParamsLineItemDetail"] + ] + """ + The details of the line items. + """ + metadata: NotRequired[Dict[str, str]] + """ + The metadata for this requested session. + """ + payment_method: NotRequired[str] + """ + The payment method for this requested session. + """ + payment_method_data: NotRequired[ + "RequestedSessionModifyParamsPaymentMethodData" + ] + """ + The payment method data for this requested session. + """ + shared_metadata: NotRequired[Dict[str, str]] + """ + The shared metadata for this requested session. + """ + + +class RequestedSessionModifyParamsFulfillmentDetails(TypedDict): + address: NotRequired[ + "RequestedSessionModifyParamsFulfillmentDetailsAddress" + ] + email: NotRequired[str] + """ + The customer's email address. + """ + name: NotRequired[str] + """ + The customer's name. + """ + phone: NotRequired[str] + """ + The customer's phone number. + """ + selected_fulfillment_option: NotRequired[ + "RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOption" + ] + """ + The fulfillment option to select. + """ + + +class RequestedSessionModifyParamsFulfillmentDetailsAddress(TypedDict): + city: str + """ + City, district, suburb, town, or village. + """ + country: str + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: str + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: str + """ + ZIP or postal code. + """ + state: str + """ + State, county, province, or region. + """ + + +class RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOption( + TypedDict, +): + shipping: "RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOptionShipping" + """ + The shipping fulfillment option. + """ + type: str + """ + The type of fulfillment option. + """ + + +class RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOptionShipping( + TypedDict, +): + shipping_option: str + """ + The shipping option identifer. + """ + + +class RequestedSessionModifyParamsLineItemDetail(TypedDict): + key: str + """ + The key of the line item. + """ + quantity: NotRequired[int] + """ + The quantity of the line item. + """ + + +class RequestedSessionModifyParamsPaymentMethodData(TypedDict): + billing_details: NotRequired[ + "RequestedSessionModifyParamsPaymentMethodDataBillingDetails" + ] + """ + The billing details for the payment method data. + """ + card: NotRequired["RequestedSessionModifyParamsPaymentMethodDataCard"] + """ + The card for the payment method data. + """ + type: NotRequired[Literal["card"]] + """ + The type of the payment method data. + """ + + +class RequestedSessionModifyParamsPaymentMethodDataBillingDetails(TypedDict): + address: NotRequired[ + "RequestedSessionModifyParamsPaymentMethodDataBillingDetailsAddress" + ] + """ + The address for the billing details. + """ + email: NotRequired[str] + """ + The email for the billing details. + """ + name: NotRequired[str] + """ + The name for the billing details. + """ + phone: NotRequired[str] + """ + The phone for the billing details. + """ + + +class RequestedSessionModifyParamsPaymentMethodDataBillingDetailsAddress( + TypedDict, +): + city: str + """ + City, district, suburb, town, or village. + """ + country: str + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: str + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: str + """ + ZIP or postal code. + """ + state: str + """ + State, county, province, or region. + """ + + +class RequestedSessionModifyParamsPaymentMethodDataCard(TypedDict): + cvc: NotRequired[str] + """ + The CVC of the card. + """ + exp_month: int + """ + The expiration month of the card. + """ + exp_year: int + """ + The expiration year of the card. + """ + number: str + """ + The number of the card. + """ diff --git a/stripe/params/delegated_checkout/_requested_session_update_params.py b/stripe/params/delegated_checkout/_requested_session_update_params.py index 824ea69e4..2be0a2aaf 100644 --- a/stripe/params/delegated_checkout/_requested_session_update_params.py +++ b/stripe/params/delegated_checkout/_requested_session_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List -from typing_extensions import NotRequired, TypedDict +from typing import Dict, List +from typing_extensions import Literal, NotRequired, TypedDict class RequestedSessionUpdateParams(TypedDict): @@ -9,3 +9,203 @@ class RequestedSessionUpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + fulfillment_details: NotRequired[ + "RequestedSessionUpdateParamsFulfillmentDetails" + ] + """ + The details of the fulfillment. + """ + line_item_details: NotRequired[ + List["RequestedSessionUpdateParamsLineItemDetail"] + ] + """ + The details of the line items. + """ + metadata: NotRequired[Dict[str, str]] + """ + The metadata for this requested session. + """ + payment_method: NotRequired[str] + """ + The payment method for this requested session. + """ + payment_method_data: NotRequired[ + "RequestedSessionUpdateParamsPaymentMethodData" + ] + """ + The payment method data for this requested session. + """ + shared_metadata: NotRequired[Dict[str, str]] + """ + The shared metadata for this requested session. + """ + + +class RequestedSessionUpdateParamsFulfillmentDetails(TypedDict): + address: NotRequired[ + "RequestedSessionUpdateParamsFulfillmentDetailsAddress" + ] + email: NotRequired[str] + """ + The customer's email address. + """ + name: NotRequired[str] + """ + The customer's name. + """ + phone: NotRequired[str] + """ + The customer's phone number. + """ + selected_fulfillment_option: NotRequired[ + "RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOption" + ] + """ + The fulfillment option to select. + """ + + +class RequestedSessionUpdateParamsFulfillmentDetailsAddress(TypedDict): + city: str + """ + City, district, suburb, town, or village. + """ + country: str + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: str + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: str + """ + ZIP or postal code. + """ + state: str + """ + State, county, province, or region. + """ + + +class RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOption( + TypedDict, +): + shipping: "RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOptionShipping" + """ + The shipping fulfillment option. + """ + type: str + """ + The type of fulfillment option. + """ + + +class RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOptionShipping( + TypedDict, +): + shipping_option: str + """ + The shipping option identifer. + """ + + +class RequestedSessionUpdateParamsLineItemDetail(TypedDict): + key: str + """ + The key of the line item. + """ + quantity: NotRequired[int] + """ + The quantity of the line item. + """ + + +class RequestedSessionUpdateParamsPaymentMethodData(TypedDict): + billing_details: NotRequired[ + "RequestedSessionUpdateParamsPaymentMethodDataBillingDetails" + ] + """ + The billing details for the payment method data. + """ + card: NotRequired["RequestedSessionUpdateParamsPaymentMethodDataCard"] + """ + The card for the payment method data. + """ + type: NotRequired[Literal["card"]] + """ + The type of the payment method data. + """ + + +class RequestedSessionUpdateParamsPaymentMethodDataBillingDetails(TypedDict): + address: NotRequired[ + "RequestedSessionUpdateParamsPaymentMethodDataBillingDetailsAddress" + ] + """ + The address for the billing details. + """ + email: NotRequired[str] + """ + The email for the billing details. + """ + name: NotRequired[str] + """ + The name for the billing details. + """ + phone: NotRequired[str] + """ + The phone for the billing details. + """ + + +class RequestedSessionUpdateParamsPaymentMethodDataBillingDetailsAddress( + TypedDict, +): + city: str + """ + City, district, suburb, town, or village. + """ + country: str + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: str + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: str + """ + ZIP or postal code. + """ + state: str + """ + State, county, province, or region. + """ + + +class RequestedSessionUpdateParamsPaymentMethodDataCard(TypedDict): + cvc: NotRequired[str] + """ + The CVC of the card. + """ + exp_month: int + """ + The expiration month of the card. + """ + exp_year: int + """ + The expiration year of the card. + """ + number: str + """ + The number of the card. + """ diff --git a/stripe/params/v2/billing/__init__.py b/stripe/params/v2/billing/__init__.py index 4f70b49e4..8f3b659ea 100644 --- a/stripe/params/v2/billing/__init__.py +++ b/stripe/params/v2/billing/__init__.py @@ -9,6 +9,7 @@ collection_settings as collection_settings, intents as intents, license_fees as license_fees, + pricing_plan_subscriptions as pricing_plan_subscriptions, pricing_plans as pricing_plans, rate_cards as rate_cards, ) @@ -321,6 +322,10 @@ ), "intents": ("stripe.params.v2.billing.intents", True), "license_fees": ("stripe.params.v2.billing.license_fees", True), + "pricing_plan_subscriptions": ( + "stripe.params.v2.billing.pricing_plan_subscriptions", + True, + ), "pricing_plans": ("stripe.params.v2.billing.pricing_plans", True), "rate_cards": ("stripe.params.v2.billing.rate_cards", True), "BillSettingCreateParams": ( diff --git a/stripe/params/v2/billing/_collection_setting_create_params.py b/stripe/params/v2/billing/_collection_setting_create_params.py index aac0b70bb..ed39245df 100644 --- a/stripe/params/v2/billing/_collection_setting_create_params.py +++ b/stripe/params/v2/billing/_collection_setting_create_params.py @@ -43,7 +43,7 @@ class CollectionSettingCreateParamsEmailDelivery(TypedDict): "CollectionSettingCreateParamsEmailDeliveryPaymentDue" ] """ - Controls emails for when the payment is due. For example after the invoice is finilized and transition to Open state. + Controls emails for when the payment is due. For example after the invoice is finalized and transitions to Open state. """ @@ -54,7 +54,7 @@ class CollectionSettingCreateParamsEmailDeliveryPaymentDue(TypedDict): """ include_payment_link: bool """ - If true the payment link to hosted invocie page would be included in email and PDF of the invoice. + If true the payment link to hosted invoice page would be included in email and PDF of the invoice. """ diff --git a/stripe/params/v2/billing/_collection_setting_update_params.py b/stripe/params/v2/billing/_collection_setting_update_params.py index 70c3b861c..5faa7ad6e 100644 --- a/stripe/params/v2/billing/_collection_setting_update_params.py +++ b/stripe/params/v2/billing/_collection_setting_update_params.py @@ -49,7 +49,7 @@ class CollectionSettingUpdateParamsEmailDelivery(TypedDict): "CollectionSettingUpdateParamsEmailDeliveryPaymentDue" ] """ - Controls emails for when the payment is due. For example after the invoice is finilized and transition to Open state. + Controls emails for when the payment is due. For example after the invoice is finalized and transitions to Open state. """ @@ -60,7 +60,7 @@ class CollectionSettingUpdateParamsEmailDeliveryPaymentDue(TypedDict): """ include_payment_link: bool """ - If true the payment link to hosted invocie page would be included in email and PDF of the invoice. + If true the payment link to hosted invoice page would be included in email and PDF of the invoice. """ diff --git a/stripe/params/v2/billing/pricing_plan_subscriptions/__init__.py b/stripe/params/v2/billing/pricing_plan_subscriptions/__init__.py new file mode 100644 index 000000000..45a99a19f --- /dev/null +++ b/stripe/params/v2/billing/pricing_plan_subscriptions/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.billing.pricing_plan_subscriptions._component_retrieve_params import ( + ComponentRetrieveParams as ComponentRetrieveParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "ComponentRetrieveParams": ( + "stripe.params.v2.billing.pricing_plan_subscriptions._component_retrieve_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/billing/pricing_plan_subscriptions/_component_retrieve_params.py b/stripe/params/v2/billing/pricing_plan_subscriptions/_component_retrieve_params.py new file mode 100644 index 000000000..8b2ee5530 --- /dev/null +++ b/stripe/params/v2/billing/pricing_plan_subscriptions/_component_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ComponentRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/core/__init__.py b/stripe/params/v2/core/__init__.py index 913ecbb88..74a1ac03a 100644 --- a/stripe/params/v2/core/__init__.py +++ b/stripe/params/v2/core/__init__.py @@ -101,6 +101,7 @@ AccountCreateParamsConfigurationStorerCapabilitiesFinancialAddressesBankAccounts as AccountCreateParamsConfigurationStorerCapabilitiesFinancialAddressesBankAccounts, AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrencies as AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrencies, AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrenciesGbp as AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrenciesGbp, + AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrenciesUsd as AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrenciesUsd, AccountCreateParamsConfigurationStorerCapabilitiesInboundTransfers as AccountCreateParamsConfigurationStorerCapabilitiesInboundTransfers, AccountCreateParamsConfigurationStorerCapabilitiesInboundTransfersBankAccounts as AccountCreateParamsConfigurationStorerCapabilitiesInboundTransfersBankAccounts, AccountCreateParamsConfigurationStorerCapabilitiesOutboundPayments as AccountCreateParamsConfigurationStorerCapabilitiesOutboundPayments, @@ -118,6 +119,7 @@ AccountCreateParamsIdentityAttestationsDirectorshipDeclaration as AccountCreateParamsIdentityAttestationsDirectorshipDeclaration, AccountCreateParamsIdentityAttestationsOwnershipDeclaration as AccountCreateParamsIdentityAttestationsOwnershipDeclaration, AccountCreateParamsIdentityAttestationsPersonsProvided as AccountCreateParamsIdentityAttestationsPersonsProvided, + AccountCreateParamsIdentityAttestationsRepresentativeDeclaration as AccountCreateParamsIdentityAttestationsRepresentativeDeclaration, AccountCreateParamsIdentityAttestationsTermsOfService as AccountCreateParamsIdentityAttestationsTermsOfService, AccountCreateParamsIdentityAttestationsTermsOfServiceAccount as AccountCreateParamsIdentityAttestationsTermsOfServiceAccount, AccountCreateParamsIdentityAttestationsTermsOfServiceCardCreator as AccountCreateParamsIdentityAttestationsTermsOfServiceCardCreator, @@ -294,6 +296,7 @@ AccountUpdateParamsConfigurationStorerCapabilitiesFinancialAddressesBankAccounts as AccountUpdateParamsConfigurationStorerCapabilitiesFinancialAddressesBankAccounts, AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrencies as AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrencies, AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrenciesGbp as AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrenciesGbp, + AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrenciesUsd as AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrenciesUsd, AccountUpdateParamsConfigurationStorerCapabilitiesInboundTransfers as AccountUpdateParamsConfigurationStorerCapabilitiesInboundTransfers, AccountUpdateParamsConfigurationStorerCapabilitiesInboundTransfersBankAccounts as AccountUpdateParamsConfigurationStorerCapabilitiesInboundTransfersBankAccounts, AccountUpdateParamsConfigurationStorerCapabilitiesOutboundPayments as AccountUpdateParamsConfigurationStorerCapabilitiesOutboundPayments, @@ -311,6 +314,7 @@ AccountUpdateParamsIdentityAttestationsDirectorshipDeclaration as AccountUpdateParamsIdentityAttestationsDirectorshipDeclaration, AccountUpdateParamsIdentityAttestationsOwnershipDeclaration as AccountUpdateParamsIdentityAttestationsOwnershipDeclaration, AccountUpdateParamsIdentityAttestationsPersonsProvided as AccountUpdateParamsIdentityAttestationsPersonsProvided, + AccountUpdateParamsIdentityAttestationsRepresentativeDeclaration as AccountUpdateParamsIdentityAttestationsRepresentativeDeclaration, AccountUpdateParamsIdentityAttestationsTermsOfService as AccountUpdateParamsIdentityAttestationsTermsOfService, AccountUpdateParamsIdentityAttestationsTermsOfServiceAccount as AccountUpdateParamsIdentityAttestationsTermsOfServiceAccount, AccountUpdateParamsIdentityAttestationsTermsOfServiceCardCreator as AccountUpdateParamsIdentityAttestationsTermsOfServiceCardCreator, @@ -797,6 +801,10 @@ "stripe.params.v2.core._account_create_params", False, ), + "AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrenciesUsd": ( + "stripe.params.v2.core._account_create_params", + False, + ), "AccountCreateParamsConfigurationStorerCapabilitiesInboundTransfers": ( "stripe.params.v2.core._account_create_params", False, @@ -865,6 +873,10 @@ "stripe.params.v2.core._account_create_params", False, ), + "AccountCreateParamsIdentityAttestationsRepresentativeDeclaration": ( + "stripe.params.v2.core._account_create_params", + False, + ), "AccountCreateParamsIdentityAttestationsTermsOfService": ( "stripe.params.v2.core._account_create_params", False, @@ -1534,6 +1546,10 @@ "stripe.params.v2.core._account_update_params", False, ), + "AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrenciesUsd": ( + "stripe.params.v2.core._account_update_params", + False, + ), "AccountUpdateParamsConfigurationStorerCapabilitiesInboundTransfers": ( "stripe.params.v2.core._account_update_params", False, @@ -1602,6 +1618,10 @@ "stripe.params.v2.core._account_update_params", False, ), + "AccountUpdateParamsIdentityAttestationsRepresentativeDeclaration": ( + "stripe.params.v2.core._account_update_params", + False, + ), "AccountUpdateParamsIdentityAttestationsTermsOfService": ( "stripe.params.v2.core._account_update_params", False, diff --git a/stripe/params/v2/core/_account_create_params.py b/stripe/params/v2/core/_account_create_params.py index c2b08dacf..426fb708b 100644 --- a/stripe/params/v2/core/_account_create_params.py +++ b/stripe/params/v2/core/_account_create_params.py @@ -259,7 +259,12 @@ class AccountCreateParamsConfigurationCustomerAutomaticIndirectTax(TypedDict): A recent IP address of the customer used for tax reporting and tax location inference. """ location_source: NotRequired[ - Literal["identity_address", "ip_address", "shipping_address"] + Literal[ + "identity_address", + "ip_address", + "payment_method", + "shipping_address", + ] ] """ The data source used to identify the customer's tax location - defaults to 'identity_address'. Will only be used for automatic tax calculation on the customer's Invoices and Subscriptions. @@ -1383,6 +1388,12 @@ class AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrencies( """ Can hold storage-type funds on Stripe in GBP. """ + usd: NotRequired[ + "AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrenciesUsd" + ] + """ + Can hold storage-type funds on Stripe in USD. + """ class AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrenciesGbp( @@ -1394,6 +1405,15 @@ class AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrenciesGbp( """ +class AccountCreateParamsConfigurationStorerCapabilitiesHoldsCurrenciesUsd( + TypedDict, +): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class AccountCreateParamsConfigurationStorerCapabilitiesInboundTransfers( TypedDict, ): @@ -1625,7 +1645,9 @@ class AccountCreateParamsDefaultsProfile(TypedDict): class AccountCreateParamsDefaultsResponsibilities(TypedDict): - fees_collector: Literal["application", "stripe"] + fees_collector: Literal[ + "application", "application_custom", "application_express", "stripe" + ] """ A value indicating the party responsible for collecting fees from this account. """ @@ -1638,7 +1660,7 @@ class AccountCreateParamsDefaultsResponsibilities(TypedDict): class AccountCreateParamsIdentity(TypedDict): attestations: NotRequired["AccountCreateParamsIdentityAttestations"] """ - Attestations from the identity's key people, e.g. owners, executives, directors. + Attestations from the identity's key people, e.g. owners, executives, directors, representatives. """ business_details: NotRequired["AccountCreateParamsIdentityBusinessDetails"] """ @@ -1679,6 +1701,12 @@ class AccountCreateParamsIdentityAttestations(TypedDict): """ Attestation that all Persons with a specific Relationship value have been provided. """ + representative_declaration: NotRequired[ + "AccountCreateParamsIdentityAttestationsRepresentativeDeclaration" + ] + """ + This hash is used to attest that the representative is authorized to act as the representative of their legal entity. + """ terms_of_service: NotRequired[ "AccountCreateParamsIdentityAttestationsTermsOfService" ] @@ -1743,6 +1771,23 @@ class AccountCreateParamsIdentityAttestationsPersonsProvided(TypedDict): """ +class AccountCreateParamsIdentityAttestationsRepresentativeDeclaration( + TypedDict, +): + date: NotRequired[str] + """ + The time marking when the representative attestation was made. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: NotRequired[str] + """ + The IP address from which the representative attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the representative attestation was made. + """ + + class AccountCreateParamsIdentityAttestationsTermsOfService(TypedDict): account: NotRequired[ "AccountCreateParamsIdentityAttestationsTermsOfServiceAccount" diff --git a/stripe/params/v2/core/_account_list_params.py b/stripe/params/v2/core/_account_list_params.py index 18b4dee2d..3b1c551fe 100644 --- a/stripe/params/v2/core/_account_list_params.py +++ b/stripe/params/v2/core/_account_list_params.py @@ -9,6 +9,10 @@ class AccountListParams(TypedDict): """ Filter only accounts that have all of the configurations specified. If omitted, returns all accounts regardless of which configurations they have. """ + closed: NotRequired[bool] + """ + Filter by whether the account is closed. If omitted, returns only Accounts that are not closed. + """ limit: NotRequired[int] """ The upper limit on the number of accounts returned by the List Account request. diff --git a/stripe/params/v2/core/_account_update_params.py b/stripe/params/v2/core/_account_update_params.py index 8e2c56e57..a7e5cec8d 100644 --- a/stripe/params/v2/core/_account_update_params.py +++ b/stripe/params/v2/core/_account_update_params.py @@ -267,7 +267,12 @@ class AccountUpdateParamsConfigurationCustomerAutomaticIndirectTax(TypedDict): A recent IP address of the customer used for tax reporting and tax location inference. """ location_source: NotRequired[ - Literal["identity_address", "ip_address", "shipping_address"] + Literal[ + "identity_address", + "ip_address", + "payment_method", + "shipping_address", + ] ] """ The data source used to identify the customer's tax location - defaults to 'identity_address'. Will only be used for automatic tax calculation on the customer's Invoices and Subscriptions. @@ -1415,6 +1420,12 @@ class AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrencies( """ Can hold storage-type funds on Stripe in GBP. """ + usd: NotRequired[ + "AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrenciesUsd" + ] + """ + Can hold storage-type funds on Stripe in USD. + """ class AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrenciesGbp( @@ -1426,6 +1437,15 @@ class AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrenciesGbp( """ +class AccountUpdateParamsConfigurationStorerCapabilitiesHoldsCurrenciesUsd( + TypedDict, +): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class AccountUpdateParamsConfigurationStorerCapabilitiesInboundTransfers( TypedDict, ): @@ -1657,7 +1677,9 @@ class AccountUpdateParamsDefaultsProfile(TypedDict): class AccountUpdateParamsDefaultsResponsibilities(TypedDict): - fees_collector: Literal["application", "stripe"] + fees_collector: Literal[ + "application", "application_custom", "application_express", "stripe" + ] """ A value indicating the party responsible for collecting fees from this account. """ @@ -1670,7 +1692,7 @@ class AccountUpdateParamsDefaultsResponsibilities(TypedDict): class AccountUpdateParamsIdentity(TypedDict): attestations: NotRequired["AccountUpdateParamsIdentityAttestations"] """ - Attestations from the identity's key people, e.g. owners, executives, directors. + Attestations from the identity's key people, e.g. owners, executives, directors, representatives. """ business_details: NotRequired["AccountUpdateParamsIdentityBusinessDetails"] """ @@ -1711,6 +1733,12 @@ class AccountUpdateParamsIdentityAttestations(TypedDict): """ Attestation that all Persons with a specific Relationship value have been provided. """ + representative_declaration: NotRequired[ + "AccountUpdateParamsIdentityAttestationsRepresentativeDeclaration" + ] + """ + This hash is used to attest that the representative is authorized to act as the representative of their legal entity. + """ terms_of_service: NotRequired[ "AccountUpdateParamsIdentityAttestationsTermsOfService" ] @@ -1775,6 +1803,23 @@ class AccountUpdateParamsIdentityAttestationsPersonsProvided(TypedDict): """ +class AccountUpdateParamsIdentityAttestationsRepresentativeDeclaration( + TypedDict, +): + date: NotRequired[str] + """ + The time marking when the representative attestation was made. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: NotRequired[str] + """ + The IP address from which the representative attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the representative attestation was made. + """ + + class AccountUpdateParamsIdentityAttestationsTermsOfService(TypedDict): account: NotRequired[ "AccountUpdateParamsIdentityAttestationsTermsOfServiceAccount" diff --git a/stripe/params/v2/core/_event_list_params.py b/stripe/params/v2/core/_event_list_params.py index 364815d48..da7f96049 100644 --- a/stripe/params/v2/core/_event_list_params.py +++ b/stripe/params/v2/core/_event_list_params.py @@ -1,14 +1,35 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from typing import List from typing_extensions import NotRequired, TypedDict class EventListParams(TypedDict): + gt: NotRequired[str] + """ + Filter for events created after the specified timestamp. + """ + gte: NotRequired[str] + """ + Filter for events created at or after the specified timestamp. + """ limit: NotRequired[int] """ The page size. """ - object_id: str + lt: NotRequired[str] + """ + Filter for events created before the specified timestamp. + """ + lte: NotRequired[str] + """ + Filter for events created at or before the specified timestamp. + """ + object_id: NotRequired[str] """ Primary object ID used to retrieve related events. """ + types: NotRequired[List[str]] + """ + An array of up to 20 strings containing specific event names. + """ diff --git a/stripe/params/v2/core/vault/__init__.py b/stripe/params/v2/core/vault/__init__.py index d2f17e133..cb6115ae9 100644 --- a/stripe/params/v2/core/vault/__init__.py +++ b/stripe/params/v2/core/vault/__init__.py @@ -17,18 +17,30 @@ from stripe.params.v2.core.vault._gb_bank_account_initiate_confirmation_of_payee_params import ( GbBankAccountInitiateConfirmationOfPayeeParams as GbBankAccountInitiateConfirmationOfPayeeParams, ) + from stripe.params.v2.core.vault._gb_bank_account_list_params import ( + GbBankAccountListParams as GbBankAccountListParams, + ) from stripe.params.v2.core.vault._gb_bank_account_retrieve_params import ( GbBankAccountRetrieveParams as GbBankAccountRetrieveParams, ) from stripe.params.v2.core.vault._us_bank_account_archive_params import ( UsBankAccountArchiveParams as UsBankAccountArchiveParams, ) + from stripe.params.v2.core.vault._us_bank_account_confirm_microdeposits_params import ( + UsBankAccountConfirmMicrodepositsParams as UsBankAccountConfirmMicrodepositsParams, + ) from stripe.params.v2.core.vault._us_bank_account_create_params import ( UsBankAccountCreateParams as UsBankAccountCreateParams, ) + from stripe.params.v2.core.vault._us_bank_account_list_params import ( + UsBankAccountListParams as UsBankAccountListParams, + ) from stripe.params.v2.core.vault._us_bank_account_retrieve_params import ( UsBankAccountRetrieveParams as UsBankAccountRetrieveParams, ) + from stripe.params.v2.core.vault._us_bank_account_send_microdeposits_params import ( + UsBankAccountSendMicrodepositsParams as UsBankAccountSendMicrodepositsParams, + ) from stripe.params.v2.core.vault._us_bank_account_update_params import ( UsBankAccountUpdateParams as UsBankAccountUpdateParams, ) @@ -55,6 +67,10 @@ "stripe.params.v2.core.vault._gb_bank_account_initiate_confirmation_of_payee_params", False, ), + "GbBankAccountListParams": ( + "stripe.params.v2.core.vault._gb_bank_account_list_params", + False, + ), "GbBankAccountRetrieveParams": ( "stripe.params.v2.core.vault._gb_bank_account_retrieve_params", False, @@ -63,14 +79,26 @@ "stripe.params.v2.core.vault._us_bank_account_archive_params", False, ), + "UsBankAccountConfirmMicrodepositsParams": ( + "stripe.params.v2.core.vault._us_bank_account_confirm_microdeposits_params", + False, + ), "UsBankAccountCreateParams": ( "stripe.params.v2.core.vault._us_bank_account_create_params", False, ), + "UsBankAccountListParams": ( + "stripe.params.v2.core.vault._us_bank_account_list_params", + False, + ), "UsBankAccountRetrieveParams": ( "stripe.params.v2.core.vault._us_bank_account_retrieve_params", False, ), + "UsBankAccountSendMicrodepositsParams": ( + "stripe.params.v2.core.vault._us_bank_account_send_microdeposits_params", + False, + ), "UsBankAccountUpdateParams": ( "stripe.params.v2.core.vault._us_bank_account_update_params", False, diff --git a/stripe/params/v2/core/vault/_gb_bank_account_list_params.py b/stripe/params/v2/core/vault/_gb_bank_account_list_params.py new file mode 100644 index 000000000..9d7f61736 --- /dev/null +++ b/stripe/params/v2/core/vault/_gb_bank_account_list_params.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class GbBankAccountListParams(TypedDict): + limit: NotRequired[int] + """ + Optionally set the maximum number of results per page. Defaults to 10. + """ diff --git a/stripe/params/v2/core/vault/_us_bank_account_confirm_microdeposits_params.py b/stripe/params/v2/core/vault/_us_bank_account_confirm_microdeposits_params.py new file mode 100644 index 000000000..89622c350 --- /dev/null +++ b/stripe/params/v2/core/vault/_us_bank_account_confirm_microdeposits_params.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class UsBankAccountConfirmMicrodepositsParams(TypedDict): + amounts: NotRequired[List[int]] + """ + Two amounts received through Send Microdeposits must match the input to Confirm Microdeposits to verify US Bank Account. + """ + descriptor_code: NotRequired[str] + """ + Descriptor code received through Send Microdeposits must match the input to Confirm Microdeposits to verify US Bank Account. + """ diff --git a/stripe/params/v2/core/vault/_us_bank_account_list_params.py b/stripe/params/v2/core/vault/_us_bank_account_list_params.py new file mode 100644 index 000000000..38a0aa68f --- /dev/null +++ b/stripe/params/v2/core/vault/_us_bank_account_list_params.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class UsBankAccountListParams(TypedDict): + limit: NotRequired[int] + """ + Optionally set the maximum number of results per page. Defaults to 10. + """ + verification_status: NotRequired[str] + """ + Optionally filter by verification status. Mutually exclusive with `unverified`, `verified`, `awaiting_verification`, and `verification_failed`. + """ diff --git a/stripe/params/v2/core/vault/_us_bank_account_send_microdeposits_params.py b/stripe/params/v2/core/vault/_us_bank_account_send_microdeposits_params.py new file mode 100644 index 000000000..e16ba1f63 --- /dev/null +++ b/stripe/params/v2/core/vault/_us_bank_account_send_microdeposits_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class UsBankAccountSendMicrodepositsParams(TypedDict): + pass diff --git a/stripe/params/v2/money_management/__init__.py b/stripe/params/v2/money_management/__init__.py index 900555832..a7c1be27c 100644 --- a/stripe/params/v2/money_management/__init__.py +++ b/stripe/params/v2/money_management/__init__.py @@ -24,6 +24,9 @@ from stripe.params.v2.money_management._financial_account_retrieve_params import ( FinancialAccountRetrieveParams as FinancialAccountRetrieveParams, ) + from stripe.params.v2.money_management._financial_account_update_params import ( + FinancialAccountUpdateParams as FinancialAccountUpdateParams, + ) from stripe.params.v2.money_management._financial_address_create_params import ( FinancialAddressCreateParams as FinancialAddressCreateParams, FinancialAddressCreateParamsSepaBankAccount as FinancialAddressCreateParamsSepaBankAccount, @@ -191,6 +194,10 @@ "stripe.params.v2.money_management._financial_account_retrieve_params", False, ), + "FinancialAccountUpdateParams": ( + "stripe.params.v2.money_management._financial_account_update_params", + False, + ), "FinancialAddressCreateParams": ( "stripe.params.v2.money_management._financial_address_create_params", False, diff --git a/stripe/params/v2/money_management/_financial_account_update_params.py b/stripe/params/v2/money_management/_financial_account_update_params.py new file mode 100644 index 000000000..80b9a02b2 --- /dev/null +++ b/stripe/params/v2/money_management/_financial_account_update_params.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class FinancialAccountUpdateParams(TypedDict): + display_name: NotRequired[str] + """ + A descriptive name for the FinancialAccount, up to 50 characters long. This name will be used in the Stripe Dashboard and embedded components. + """ + metadata: NotRequired[Dict[str, Optional[str]]] + """ + Metadata associated with the FinancialAccount. + """ diff --git a/stripe/params/v2/test_helpers/_money_management_recipient_verifications_params.py b/stripe/params/v2/test_helpers/_money_management_recipient_verifications_params.py index 10c5b179d..6e6374b2c 100644 --- a/stripe/params/v2/test_helpers/_money_management_recipient_verifications_params.py +++ b/stripe/params/v2/test_helpers/_money_management_recipient_verifications_params.py @@ -7,6 +7,7 @@ class MoneyManagementRecipientVerificationsParams(TypedDict): match_result: Literal["close_match", "match", "no_match", "unavailable"] """ Expected match level of the RecipientVerification to be created: `match`, `close_match`, `no_match`, `unavailable`. + For `close_match`, the simulated response appends "close_match" to the provided name in match_result_details.matched_name. """ payout_method: str """ diff --git a/stripe/v2/billing/__init__.py b/stripe/v2/billing/__init__.py index 403cae0a3..b12001bac 100644 --- a/stripe/v2/billing/__init__.py +++ b/stripe/v2/billing/__init__.py @@ -9,6 +9,7 @@ collection_settings as collection_settings, intents as intents, license_fees as license_fees, + pricing_plan_subscriptions as pricing_plan_subscriptions, pricing_plans as pricing_plans, rate_cards as rate_cards, ) @@ -93,6 +94,9 @@ from stripe.v2.billing._pricing_plan_subscription import ( PricingPlanSubscription as PricingPlanSubscription, ) + from stripe.v2.billing._pricing_plan_subscription_components import ( + PricingPlanSubscriptionComponents as PricingPlanSubscriptionComponents, + ) from stripe.v2.billing._pricing_plan_subscription_service import ( PricingPlanSubscriptionService as PricingPlanSubscriptionService, ) @@ -130,6 +134,10 @@ "collection_settings": ("stripe.v2.billing.collection_settings", True), "intents": ("stripe.v2.billing.intents", True), "license_fees": ("stripe.v2.billing.license_fees", True), + "pricing_plan_subscriptions": ( + "stripe.v2.billing.pricing_plan_subscriptions", + True, + ), "pricing_plans": ("stripe.v2.billing.pricing_plans", True), "rate_cards": ("stripe.v2.billing.rate_cards", True), "BillSetting": ("stripe.v2.billing._bill_setting", False), @@ -198,6 +206,10 @@ "stripe.v2.billing._pricing_plan_subscription", False, ), + "PricingPlanSubscriptionComponents": ( + "stripe.v2.billing._pricing_plan_subscription_components", + False, + ), "PricingPlanSubscriptionService": ( "stripe.v2.billing._pricing_plan_subscription_service", False, diff --git a/stripe/v2/billing/_cadence.py b/stripe/v2/billing/_cadence.py index 77523d0d5..32e74273b 100644 --- a/stripe/v2/billing/_cadence.py +++ b/stripe/v2/billing/_cadence.py @@ -305,12 +305,12 @@ class PaymentDue(StripeObject): """ include_payment_link: bool """ - If true the payment link to hosted invocie page would be included in email and PDF of the invoice. + If true the payment link to hosted invoice page would be included in email and PDF of the invoice. """ payment_due: Optional[PaymentDue] """ - Controls emails for when the payment is due. For example after the invoice is finilized and transition to Open state. + Controls emails for when the payment is due. For example after the invoice is finalized and transitions to Open state. """ _inner_class_types = {"payment_due": PaymentDue} diff --git a/stripe/v2/billing/_collection_setting.py b/stripe/v2/billing/_collection_setting.py index 60339141c..1538d6dfd 100644 --- a/stripe/v2/billing/_collection_setting.py +++ b/stripe/v2/billing/_collection_setting.py @@ -25,12 +25,12 @@ class PaymentDue(StripeObject): """ include_payment_link: bool """ - If true the payment link to hosted invocie page would be included in email and PDF of the invoice. + If true the payment link to hosted invoice page would be included in email and PDF of the invoice. """ payment_due: Optional[PaymentDue] """ - Controls emails for when the payment is due. For example after the invoice is finilized and transition to Open state. + Controls emails for when the payment is due. For example after the invoice is finalized and transitions to Open state. """ _inner_class_types = {"payment_due": PaymentDue} diff --git a/stripe/v2/billing/_collection_setting_version.py b/stripe/v2/billing/_collection_setting_version.py index 8c9fd572d..8a2131009 100644 --- a/stripe/v2/billing/_collection_setting_version.py +++ b/stripe/v2/billing/_collection_setting_version.py @@ -21,12 +21,12 @@ class PaymentDue(StripeObject): """ include_payment_link: bool """ - If true the payment link to hosted invocie page would be included in email and PDF of the invoice. + If true the payment link to hosted invoice page would be included in email and PDF of the invoice. """ payment_due: Optional[PaymentDue] """ - Controls emails for when the payment is due. For example after the invoice is finilized and transition to Open state. + Controls emails for when the payment is due. For example after the invoice is finalized and transitions to Open state. """ _inner_class_types = {"payment_due": PaymentDue} diff --git a/stripe/v2/billing/_pricing_plan_subscription_components.py b/stripe/v2/billing/_pricing_plan_subscription_components.py new file mode 100644 index 000000000..9ddc8ba69 --- /dev/null +++ b/stripe/v2/billing/_pricing_plan_subscription_components.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class PricingPlanSubscriptionComponents(StripeObject): + """ + A set of component subscriptions for a Pricing Plan Subscription. + """ + + OBJECT_NAME: ClassVar[ + Literal["v2.billing.pricing_plan_subscription_components"] + ] = "v2.billing.pricing_plan_subscription_components" + + class Component(StripeObject): + license_fee_subscription: Optional[str] + """ + The ID of the License Fee Subscription. + """ + pricing_plan_component: str + """ + The Pricing Plan Component associated with this component subscription. + """ + rate_card_subscription: Optional[str] + """ + The ID of the Rate Card Subscription. + """ + type: Literal["license_fee_subscription", "rate_card_subscription"] + """ + The type of subscription. + """ + + components: List[Component] + """ + The component subscriptions of the Pricing Plan Subscription. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.billing.pricing_plan_subscription_components"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + _inner_class_types = {"components": Component} diff --git a/stripe/v2/billing/_pricing_plan_subscription_service.py b/stripe/v2/billing/_pricing_plan_subscription_service.py index 0f7a333d2..a35205fd7 100644 --- a/stripe/v2/billing/_pricing_plan_subscription_service.py +++ b/stripe/v2/billing/_pricing_plan_subscription_service.py @@ -3,6 +3,7 @@ from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Optional, cast +from importlib import import_module from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: @@ -20,9 +21,40 @@ from stripe.v2.billing._pricing_plan_subscription import ( PricingPlanSubscription, ) + from stripe.v2.billing.pricing_plan_subscriptions._component_service import ( + ComponentService, + ) + +_subservices = { + "components": [ + "stripe.v2.billing.pricing_plan_subscriptions._component_service", + "ComponentService", + ], +} class PricingPlanSubscriptionService(StripeService): + components: "ComponentService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() + def list( self, params: Optional["PricingPlanSubscriptionListParams"] = None, diff --git a/stripe/v2/billing/pricing_plan_subscriptions/__init__.py b/stripe/v2/billing/pricing_plan_subscriptions/__init__.py new file mode 100644 index 000000000..369c338fd --- /dev/null +++ b/stripe/v2/billing/pricing_plan_subscriptions/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.billing.pricing_plan_subscriptions._component_service import ( + ComponentService as ComponentService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "ComponentService": ( + "stripe.v2.billing.pricing_plan_subscriptions._component_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/billing/pricing_plan_subscriptions/_component_service.py b/stripe/v2/billing/pricing_plan_subscriptions/_component_service.py new file mode 100644 index 000000000..688f22bae --- /dev/null +++ b/stripe/v2/billing/pricing_plan_subscriptions/_component_service.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.billing.pricing_plan_subscriptions._component_retrieve_params import ( + ComponentRetrieveParams, + ) + from stripe.v2.billing._pricing_plan_subscription_components import ( + PricingPlanSubscriptionComponents, + ) + + +class ComponentService(StripeService): + def retrieve( + self, + id: str, + params: Optional["ComponentRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "PricingPlanSubscriptionComponents": + """ + Retrieve a Pricing Plan Subscription's components. + """ + return cast( + "PricingPlanSubscriptionComponents", + self._request( + "get", + "/v2/billing/pricing_plan_subscriptions/{id}/components".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["ComponentRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "PricingPlanSubscriptionComponents": + """ + Retrieve a Pricing Plan Subscription's components. + """ + return cast( + "PricingPlanSubscriptionComponents", + await self._request_async( + "get", + "/v2/billing/pricing_plan_subscriptions/{id}/components".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/_account.py b/stripe/v2/core/_account.py index 2348f24ff..4fc5e8927 100644 --- a/stripe/v2/core/_account.py +++ b/stripe/v2/core/_account.py @@ -383,7 +383,10 @@ class Location(StripeObject): """ location_source: Optional[ Literal[ - "identity_address", "ip_address", "shipping_address" + "identity_address", + "ip_address", + "payment_method", + "shipping_address", ] ] """ @@ -3085,11 +3088,54 @@ class StatusDetail(StripeObject): """ _inner_class_types = {"status_details": StatusDetail} + class Usd(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + "unsupported_entity_type", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", + "no_resolution", + "provide_info", + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + gbp: Optional[Gbp] """ Can hold storage-type funds on Stripe in GBP. """ - _inner_class_types = {"gbp": Gbp} + usd: Optional[Usd] + """ + Can hold storage-type funds on Stripe in USD. + """ + _inner_class_types = {"gbp": Gbp, "usd": Usd} class InboundTransfers(StripeObject): class BankAccounts(StripeObject): @@ -3447,7 +3493,12 @@ class Profile(StripeObject): """ class Responsibilities(StripeObject): - fees_collector: Literal["application", "stripe"] + fees_collector: Literal[ + "application", + "application_custom", + "application_express", + "stripe", + ] """ A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this Account. """ @@ -3619,6 +3670,20 @@ class PersonsProvided(StripeObject): Reason for why the company is exempt from providing ownership information. """ + class RepresentativeDeclaration(StripeObject): + date: Optional[str] + """ + The time marking when the representative attestation was made. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: Optional[str] + """ + The IP address from which the representative attestation was made. + """ + user_agent: Optional[str] + """ + The user agent of the browser from which the representative attestation was made. + """ + class TermsOfService(StripeObject): class Account(StripeObject): date: Optional[str] @@ -4048,6 +4113,10 @@ class Storer(StripeObject): """ Attestation that all Persons with a specific Relationship value have been provided. """ + representative_declaration: Optional[RepresentativeDeclaration] + """ + This hash is used to attest that the representative is authorized to act as the representative of their legal entity. + """ terms_of_service: Optional[TermsOfService] """ Attestations of accepted terms of service agreements. @@ -4056,6 +4125,7 @@ class Storer(StripeObject): "directorship_declaration": DirectorshipDeclaration, "ownership_declaration": OwnershipDeclaration, "persons_provided": PersonsProvided, + "representative_declaration": RepresentativeDeclaration, "terms_of_service": TermsOfService, } @@ -5040,7 +5110,7 @@ class Kanji(StripeObject): attestations: Optional[Attestations] """ - Attestations from the identity's key people, e.g. owners, executives, directors. + Attestations from the identity's key people, e.g. owners, executives, directors, representatives. """ business_details: Optional[BusinessDetails] """ @@ -5217,6 +5287,7 @@ class Deadline(StripeObject): "gb_bank_transfer_payments", "grabpay_payments", "holds_currencies.gbp", + "holds_currencies.usd", "ideal_payments", "inbound_transfers.financial_accounts", "jcb_payments", @@ -5382,6 +5453,10 @@ class MinimumDeadline(StripeObject): """ Filter only accounts that have all of the configurations specified. If omitted, returns all accounts regardless of which configurations they have. """ + closed: Optional[bool] + """ + A value indicating if the Account has been closed. + """ configuration: Optional[Configuration] """ An Account Configuration which allows the Account to take on a key persona across Stripe products. diff --git a/stripe/v2/core/_account_service.py b/stripe/v2/core/_account_service.py index f6989a466..27d89401c 100644 --- a/stripe/v2/core/_account_service.py +++ b/stripe/v2/core/_account_service.py @@ -213,7 +213,7 @@ def close( options: Optional["RequestOptions"] = None, ) -> "Account": """ - Removes access to the Account and its associated resources. + Removes access to the Account and its associated resources. Closed Accounts can no longer be operated on, but limited information can still be retrieved through the API in order to be able to track their history. """ return cast( "Account", @@ -233,7 +233,7 @@ async def close_async( options: Optional["RequestOptions"] = None, ) -> "Account": """ - Removes access to the Account and its associated resources. + Removes access to the Account and its associated resources. Closed Accounts can no longer be operated on, but limited information can still be retrieved through the API in order to be able to track their history. """ return cast( "Account", diff --git a/stripe/v2/core/_event_service.py b/stripe/v2/core/_event_service.py index f52f3eccc..38da51e63 100644 --- a/stripe/v2/core/_event_service.py +++ b/stripe/v2/core/_event_service.py @@ -18,7 +18,7 @@ class EventService(StripeService): def list( self, - params: "EventListParams", + params: Optional["EventListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Event]": """ @@ -37,7 +37,7 @@ def list( async def list_async( self, - params: "EventListParams", + params: Optional["EventListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Event]": """ diff --git a/stripe/v2/core/vault/_gb_bank_account_service.py b/stripe/v2/core/vault/_gb_bank_account_service.py index 5992ac155..2ebaf2ff7 100644 --- a/stripe/v2/core/vault/_gb_bank_account_service.py +++ b/stripe/v2/core/vault/_gb_bank_account_service.py @@ -19,13 +19,55 @@ from stripe.params.v2.core.vault._gb_bank_account_initiate_confirmation_of_payee_params import ( GbBankAccountInitiateConfirmationOfPayeeParams, ) + from stripe.params.v2.core.vault._gb_bank_account_list_params import ( + GbBankAccountListParams, + ) from stripe.params.v2.core.vault._gb_bank_account_retrieve_params import ( GbBankAccountRetrieveParams, ) + from stripe.v2._list_object import ListObject from stripe.v2.core.vault._gb_bank_account import GbBankAccount class GbBankAccountService(StripeService): + def list( + self, + params: Optional["GbBankAccountListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[GbBankAccount]": + """ + List objects that can be used as destinations for outbound money movement via OutboundPayment. + """ + return cast( + "ListObject[GbBankAccount]", + self._request( + "get", + "/v2/core/vault/gb_bank_accounts", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["GbBankAccountListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[GbBankAccount]": + """ + List objects that can be used as destinations for outbound money movement via OutboundPayment. + """ + return cast( + "ListObject[GbBankAccount]", + await self._request_async( + "get", + "/v2/core/vault/gb_bank_accounts", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "GbBankAccountCreateParams", diff --git a/stripe/v2/core/vault/_us_bank_account.py b/stripe/v2/core/vault/_us_bank_account.py index a35d95100..fa2c1ad61 100644 --- a/stripe/v2/core/vault/_us_bank_account.py +++ b/stripe/v2/core/vault/_us_bank_account.py @@ -13,6 +13,41 @@ class UsBankAccount(StripeObject): OBJECT_NAME: ClassVar[Literal["v2.core.vault.us_bank_account"]] = ( "v2.core.vault.us_bank_account" ) + + class Verification(StripeObject): + class MicrodepositVerificationDetails(StripeObject): + expires: str + """ + Time when microdeposits will expire and have to be re-sent. + """ + microdeposit_type: Literal["amounts", "descriptor_code"] + """ + Microdeposit type can be amounts or descriptor_type. + """ + sent: str + """ + Time when microdeposits were sent. + """ + + microdeposit_verification_details: Optional[ + MicrodepositVerificationDetails + ] + """ + The microdeposit verification details if the status is awaiting verification. + """ + status: Literal[ + "awaiting_verification", + "unverified", + "verification_failed", + "verified", + ] + """ + The bank account verification status. + """ + _inner_class_types = { + "microdeposit_verification_details": MicrodepositVerificationDetails, + } + archived: bool """ Whether this USBankAccount object was archived. @@ -53,3 +88,8 @@ class UsBankAccount(StripeObject): """ The ACH routing number of the bank account. """ + verification: Verification + """ + The bank account verification details. + """ + _inner_class_types = {"verification": Verification} diff --git a/stripe/v2/core/vault/_us_bank_account_service.py b/stripe/v2/core/vault/_us_bank_account_service.py index 7faa9ae91..3674515a6 100644 --- a/stripe/v2/core/vault/_us_bank_account_service.py +++ b/stripe/v2/core/vault/_us_bank_account_service.py @@ -10,19 +10,67 @@ from stripe.params.v2.core.vault._us_bank_account_archive_params import ( UsBankAccountArchiveParams, ) + from stripe.params.v2.core.vault._us_bank_account_confirm_microdeposits_params import ( + UsBankAccountConfirmMicrodepositsParams, + ) from stripe.params.v2.core.vault._us_bank_account_create_params import ( UsBankAccountCreateParams, ) + from stripe.params.v2.core.vault._us_bank_account_list_params import ( + UsBankAccountListParams, + ) from stripe.params.v2.core.vault._us_bank_account_retrieve_params import ( UsBankAccountRetrieveParams, ) + from stripe.params.v2.core.vault._us_bank_account_send_microdeposits_params import ( + UsBankAccountSendMicrodepositsParams, + ) from stripe.params.v2.core.vault._us_bank_account_update_params import ( UsBankAccountUpdateParams, ) + from stripe.v2._list_object import ListObject from stripe.v2.core.vault._us_bank_account import UsBankAccount class UsBankAccountService(StripeService): + def list( + self, + params: Optional["UsBankAccountListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[UsBankAccount]": + """ + List USBankAccount objects. Optionally filter by verification status. + """ + return cast( + "ListObject[UsBankAccount]", + self._request( + "get", + "/v2/core/vault/us_bank_accounts", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["UsBankAccountListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[UsBankAccount]": + """ + List USBankAccount objects. Optionally filter by verification status. + """ + return cast( + "ListObject[UsBankAccount]", + await self._request_async( + "get", + "/v2/core/vault/us_bank_accounts", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "UsBankAccountCreateParams", @@ -196,3 +244,91 @@ async def archive_async( options=options, ), ) + + def confirm_microdeposits( + self, + id: str, + params: Optional["UsBankAccountConfirmMicrodepositsParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "UsBankAccount": + """ + Confirm microdeposits amounts or descriptor code that you have received from the Send Microdeposits request. Once you correctly confirm this, this US Bank Account will be verified and eligible to transfer funds with. + """ + return cast( + "UsBankAccount", + self._request( + "post", + "/v2/core/vault/us_bank_accounts/{id}/confirm_microdeposits".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def confirm_microdeposits_async( + self, + id: str, + params: Optional["UsBankAccountConfirmMicrodepositsParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "UsBankAccount": + """ + Confirm microdeposits amounts or descriptor code that you have received from the Send Microdeposits request. Once you correctly confirm this, this US Bank Account will be verified and eligible to transfer funds with. + """ + return cast( + "UsBankAccount", + await self._request_async( + "post", + "/v2/core/vault/us_bank_accounts/{id}/confirm_microdeposits".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def send_microdeposits( + self, + id: str, + params: Optional["UsBankAccountSendMicrodepositsParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "UsBankAccount": + """ + Send microdeposits in order to verify your US Bank Account so it is eligible to transfer funds. This will start the verification process and you must Confirm Microdeposits to successfully verify your US Bank Account. + """ + return cast( + "UsBankAccount", + self._request( + "post", + "/v2/core/vault/us_bank_accounts/{id}/send_microdeposits".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def send_microdeposits_async( + self, + id: str, + params: Optional["UsBankAccountSendMicrodepositsParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "UsBankAccount": + """ + Send microdeposits in order to verify your US Bank Account so it is eligible to transfer funds. This will start the verification process and you must Confirm Microdeposits to successfully verify your US Bank Account. + """ + return cast( + "UsBankAccount", + await self._request_async( + "post", + "/v2/core/vault/us_bank_accounts/{id}/send_microdeposits".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_financial_account_service.py b/stripe/v2/money_management/_financial_account_service.py index bd81d11b0..c5a114c64 100644 --- a/stripe/v2/money_management/_financial_account_service.py +++ b/stripe/v2/money_management/_financial_account_service.py @@ -19,6 +19,9 @@ from stripe.params.v2.money_management._financial_account_retrieve_params import ( FinancialAccountRetrieveParams, ) + from stripe.params.v2.money_management._financial_account_update_params import ( + FinancialAccountUpdateParams, + ) from stripe.v2._list_object import ListObject from stripe.v2.money_management._financial_account import FinancialAccount @@ -144,6 +147,50 @@ async def retrieve_async( ), ) + def update( + self, + id: str, + params: Optional["FinancialAccountUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "FinancialAccount": + """ + Updates an existing FinancialAccount. + """ + return cast( + "FinancialAccount", + self._request( + "post", + "/v2/money_management/financial_accounts/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: Optional["FinancialAccountUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "FinancialAccount": + """ + Updates an existing FinancialAccount. + """ + return cast( + "FinancialAccount", + await self._request_async( + "post", + "/v2/money_management/financial_accounts/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + def close( self, id: str, diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index c36b3682d..0fbefd93b 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -44998,6 +44998,28 @@ def test_v2_billing_pricing_plan_subscription_post_service( is_json=True, ) + def test_v2_billing_pricing_plan_subscriptions_component_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/billing/pricing_plan_subscriptions/id_123/components", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.pricing_plan_subscriptions.components.retrieve( + "id_123", + ) + http_client_mock.assert_requested( + "get", + path="/v2/billing/pricing_plan_subscriptions/id_123/components", + query_string="", + api_base="https://api.stripe.com", + ) + def test_v2_billing_profile_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -45810,18 +45832,17 @@ def test_v2_core_event_get_service( http_client_mock.stub_request( "get", "/v2/core/events", - "object_id=object_id", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.events.list({"object_id": "object_id"}) + client.v2.core.events.list() http_client_mock.assert_requested( "get", path="/v2/core/events", - query_string="object_id=object_id", + query_string="", api_base="https://api.stripe.com", ) @@ -46022,6 +46043,26 @@ def test_v2_core_event_destination_post_5_service( is_json=True, ) + def test_v2_core_vault_gb_bank_account_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/vault/gb_bank_accounts", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.gb_bank_accounts.list() + http_client_mock.assert_requested( + "get", + path="/v2/core/vault/gb_bank_accounts", + query_string="", + api_base="https://api.stripe.com", + ) + def test_v2_core_vault_gb_bank_account_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -46049,7 +46090,7 @@ def test_v2_core_vault_gb_bank_account_post_service( is_json=True, ) - def test_v2_core_vault_gb_bank_account_get_service( + def test_v2_core_vault_gb_bank_account_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -46139,6 +46180,26 @@ def test_v2_core_vault_gb_bank_account_post_4_service( is_json=True, ) + def test_v2_core_vault_us_bank_account_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/vault/us_bank_accounts", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.us_bank_accounts.list() + http_client_mock.assert_requested( + "get", + path="/v2/core/vault/us_bank_accounts", + query_string="", + api_base="https://api.stripe.com", + ) + def test_v2_core_vault_us_bank_account_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -46165,7 +46226,7 @@ def test_v2_core_vault_us_bank_account_post_service( is_json=True, ) - def test_v2_core_vault_us_bank_account_get_service( + def test_v2_core_vault_us_bank_account_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -46229,6 +46290,50 @@ def test_v2_core_vault_us_bank_account_post_3_service( is_json=True, ) + def test_v2_core_vault_us_bank_account_post_4_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.us_bank_accounts.confirm_microdeposits("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_vault_us_bank_account_post_5_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts/id_123/send_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.us_bank_accounts.send_microdeposits("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts/id_123/send_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + def test_v2_money_management_adjustment_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -46337,6 +46442,28 @@ def test_v2_money_management_financial_account_get_2_service( def test_v2_money_management_financial_account_post_2_service( self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/financial_accounts/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.financial_accounts.update("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/money_management/financial_accounts/id_123", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_money_management_financial_account_post_3_service( + self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", @@ -47613,7 +47740,7 @@ def test_feature_not_enabled_error_service( http_client_mock.stub_request( "post", "/v2/money_management/financial_accounts", - rbody='{"error":{"type":"feature_not_enabled","code":"recipient_feature_not_active"}}', + rbody='{"error":{"type":"feature_not_enabled","code":"outbound_flow_from_closed_financial_account_unsupported"}}', rcode=400, ) client = StripeClient(