diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 794622303..883925640 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v691 \ No newline at end of file +v696 \ No newline at end of file diff --git a/stripe/_account_session.py b/stripe/_account_session.py index 614e63b64..ba922589a 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -22,13 +22,81 @@ class AccountSession(CreateableAPIResource["AccountSession"]): class Components(StripeObject): class AccountOnboarding(StripeObject): + class Features(StripeObject): + pass + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + + class PaymentDetails(StripeObject): + class Features(StripeObject): + capture_payments: bool + """ + Whether to allow capturing and cancelling payment intents. This is `true` by default. + """ + dispute_management: bool + """ + Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + """ + refund_management: bool + """ + Whether to allow sending refunds. This is `true` by default. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Optional[Features] + _inner_class_types = {"features": Features} + + class Payments(StripeObject): + class Features(StripeObject): + capture_payments: bool + """ + Whether to allow capturing and cancelling payment intents. This is `true` by default. + """ + dispute_management: bool + """ + Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + """ + refund_management: bool + """ + Whether to allow sending refunds. This is `true` by default. + """ + enabled: bool """ Whether the embedded component is enabled. """ + features: Optional[Features] + _inner_class_types = {"features": Features} + + class Payouts(StripeObject): + class Features(StripeObject): + pass + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Optional[Features] + _inner_class_types = {"features": Features} account_onboarding: AccountOnboarding - _inner_class_types = {"account_onboarding": AccountOnboarding} + payment_details: Optional[PaymentDetails] + payments: Optional[Payments] + payouts: Optional[Payouts] + _inner_class_types = { + "account_onboarding": AccountOnboarding, + "payment_details": PaymentDetails, + "payments": Payments, + "payouts": Payouts, + } class CreateParams(RequestOptions): account: str @@ -51,12 +119,102 @@ class CreateParamsComponents(TypedDict): """ Configuration for the account onboarding embedded component. """ + payment_details: NotRequired[ + "AccountSession.CreateParamsComponentsPaymentDetails" + ] + """ + Configuration for the payment details embedded component. + """ + payments: NotRequired["AccountSession.CreateParamsComponentsPayments"] + """ + Configuration for the payments embedded component. + """ + payouts: NotRequired["AccountSession.CreateParamsComponentsPayouts"] + """ + Configuration for the payouts embedded component. + """ + + class CreateParamsComponentsPayouts(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsPayoutsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsPayoutsFeatures(TypedDict): + pass + + class CreateParamsComponentsPayments(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsPaymentsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsPaymentsFeatures(TypedDict): + capture_payments: NotRequired["bool"] + """ + Whether to allow capturing and cancelling payment intents. This is `true` by default. + """ + dispute_management: NotRequired["bool"] + """ + Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + """ + refund_management: NotRequired["bool"] + """ + Whether to allow sending refunds. This is `true` by default. + """ + + class CreateParamsComponentsPaymentDetails(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsPaymentDetailsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsPaymentDetailsFeatures(TypedDict): + capture_payments: NotRequired["bool"] + """ + Whether to allow capturing and cancelling payment intents. This is `true` by default. + """ + dispute_management: NotRequired["bool"] + """ + Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + """ + refund_management: NotRequired["bool"] + """ + Whether to allow sending refunds. This is `true` by default. + """ class CreateParamsComponentsAccountOnboarding(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsAccountOnboardingFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): + pass account: str """ diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index dd1c85ac2..7a578e418 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -102,7 +102,7 @@ class ListParams(RequestOptions): """ type: NotRequired["str"] """ - Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. """ class ListParamsCreated(TypedDict): @@ -231,6 +231,8 @@ class RetrieveParams(RequestOptions): "obligation_reversal_outbound", "payment", "payment_failure_refund", + "payment_network_reserve_hold", + "payment_network_reserve_release", "payment_refund", "payment_reversal", "payment_unreconciled", @@ -252,7 +254,7 @@ class RetrieveParams(RequestOptions): "transfer_refund", ] """ - Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. + Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. """ @classmethod diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 818d2cced..1cf01c576 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -281,6 +281,20 @@ class PhoneNumberCollection(StripeObject): If `true`, a phone number will be collected during checkout. """ + class Restrictions(StripeObject): + class CompletedSessions(StripeObject): + count: int + """ + The current number of checkout sessions that have been completed on the payment link which count towards the `completed_sessions` restriction to be met. + """ + limit: int + """ + The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + """ + + completed_sessions: CompletedSessions + _inner_class_types = {"completed_sessions": CompletedSessions} + class ShippingAddressCollection(StripeObject): allowed_countries: List[ Literal[ @@ -538,6 +552,21 @@ class ShippingOption(StripeObject): """ class SubscriptionData(StripeObject): + class TrialSettings(StripeObject): + class EndBehavior(StripeObject): + missing_payment_method: Literal[ + "cancel", "create_invoice", "pause" + ] + """ + Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + """ + + end_behavior: EndBehavior + """ + Defines how a subscription behaves when a free trial ends. + """ + _inner_class_types = {"end_behavior": EndBehavior} + description: Optional[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. @@ -550,6 +579,11 @@ class SubscriptionData(StripeObject): """ Integer representing the number of trial period days before the customer is charged for the first time. """ + trial_settings: Optional[TrialSettings] + """ + Settings related to subscription trials. + """ + _inner_class_types = {"trial_settings": TrialSettings} class TaxIdCollection(StripeObject): enabled: bool @@ -620,6 +654,10 @@ class CreateParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + inactive_message: NotRequired["str"] + """ + The custom message to be displayed to a customer when a payment link is no longer active. + """ invoice_creation: NotRequired[ "PaymentLink.CreateParamsInvoiceCreation" ] @@ -668,6 +706,10 @@ class CreateParams(RequestOptions): We recommend that you review your privacy policy and check with your legal contacts. """ + restrictions: NotRequired["PaymentLink.CreateParamsRestrictions"] + """ + Settings that restrict the usage of a payment link. + """ shipping_address_collection: NotRequired[ "PaymentLink.CreateParamsShippingAddressCollection" ] @@ -733,6 +775,24 @@ class CreateParamsSubscriptionData(TypedDict): """ Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. """ + trial_settings: NotRequired[ + "PaymentLink.CreateParamsSubscriptionDataTrialSettings" + ] + """ + Settings related to subscription trials. + """ + + class CreateParamsSubscriptionDataTrialSettings(TypedDict): + end_behavior: "PaymentLink.CreateParamsSubscriptionDataTrialSettingsEndBehavior" + """ + Defines how the subscription should behave when the user's free trial ends. + """ + + class CreateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): + missing_payment_method: Literal["cancel", "create_invoice", "pause"] + """ + Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + """ class CreateParamsShippingOption(TypedDict): shipping_rate: NotRequired["str"] @@ -987,6 +1047,18 @@ class CreateParamsShippingAddressCollection(TypedDict): shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. """ + class CreateParamsRestrictions(TypedDict): + completed_sessions: "PaymentLink.CreateParamsRestrictionsCompletedSessions" + """ + Configuration for the `completed_sessions` restriction type. + """ + + class CreateParamsRestrictionsCompletedSessions(TypedDict): + limit: int + """ + The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + """ + class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ @@ -1365,6 +1437,10 @@ class ModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + inactive_message: NotRequired["Literal['']|str"] + """ + The custom message to be displayed to a customer when a payment link is no longer active. + """ invoice_creation: NotRequired[ "PaymentLink.ModifyParamsInvoiceCreation" ] @@ -1401,6 +1477,12 @@ class ModifyParams(RequestOptions): """ The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ + restrictions: NotRequired[ + "Literal['']|PaymentLink.ModifyParamsRestrictions" + ] + """ + Settings that restrict the usage of a payment link. + """ shipping_address_collection: NotRequired[ "Literal['']|PaymentLink.ModifyParamsShippingAddressCollection" ] @@ -1419,6 +1501,24 @@ class ModifyParamsSubscriptionData(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ + trial_settings: NotRequired[ + "Literal['']|PaymentLink.ModifyParamsSubscriptionDataTrialSettings" + ] + """ + Settings related to subscription trials. + """ + + class ModifyParamsSubscriptionDataTrialSettings(TypedDict): + end_behavior: "PaymentLink.ModifyParamsSubscriptionDataTrialSettingsEndBehavior" + """ + Defines how the subscription should behave when the user's free trial ends. + """ + + class ModifyParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): + missing_payment_method: Literal["cancel", "create_invoice", "pause"] + """ + Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + """ class ModifyParamsShippingAddressCollection(TypedDict): allowed_countries: List[ @@ -1667,6 +1767,18 @@ class ModifyParamsShippingAddressCollection(TypedDict): shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. """ + class ModifyParamsRestrictions(TypedDict): + completed_sessions: "PaymentLink.ModifyParamsRestrictionsCompletedSessions" + """ + Configuration for the `completed_sessions` restriction type. + """ + + class ModifyParamsRestrictionsCompletedSessions(TypedDict): + limit: int + """ + The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + """ + class ModifyParamsPaymentIntentData(TypedDict): description: NotRequired["Literal['']|str"] """ @@ -1978,6 +2090,10 @@ class RetrieveParams(RequestOptions): """ Unique identifier for the object. """ + inactive_message: Optional[str] + """ + The custom message to be displayed to a customer when a payment link is no longer active. + """ invoice_creation: Optional[InvoiceCreation] """ Configuration for creating invoice for payment mode payment links. @@ -2048,6 +2164,10 @@ class RetrieveParams(RequestOptions): The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ phone_number_collection: PhoneNumberCollection + restrictions: Optional[Restrictions] + """ + Settings that restrict the usage of a payment link. + """ shipping_address_collection: Optional[ShippingAddressCollection] """ Configuration for collecting the customer's shipping address. @@ -2244,6 +2364,7 @@ def retrieve( "invoice_creation": InvoiceCreation, "payment_intent_data": PaymentIntentData, "phone_number_collection": PhoneNumberCollection, + "restrictions": Restrictions, "shipping_address_collection": ShippingAddressCollection, "shipping_options": ShippingOption, "subscription_data": SubscriptionData, diff --git a/stripe/climate/_product.py b/stripe/climate/_product.py index a7e457852..b94367da8 100644 --- a/stripe/climate/_product.py +++ b/stripe/climate/_product.py @@ -79,7 +79,7 @@ class RetrieveParams(RequestOptions): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ - metric_tons_available: Optional[str] + metric_tons_available: str """ The quantity of metric tons available for reservation. """