diff --git a/CHANGELOG.md b/CHANGELOG.md index 47888ab3f..882360323 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,39 @@ # Changelog +## 11.2.0 - 2024-10-29 +* [#1411](https://github.com/stripe/stripe-python/pull/1411) Update generated code + * Add support for resource `stripe.v2.EventDestinations` + * Add support for `create`, `retrieve`, `update`, `list`, `delete`, `disable`, `enable` and `ping` methods on resource `V2.EventDestinations` + * Add support for `alma_payments`, `kakao_pay_payments`, `kr_card_payments`, `naver_pay_payments`, `payco_payments`, `samsung_pay_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `groups` on parameter class `stripe.Account.CreateParams` and resource `stripe.Account` + * Add support for `disable_stripe_user_authentication` on resource classes `stripe.AccountSession.Components.AccountManagement.Features`, `stripe.AccountSession.Components.AccountOnboarding.Features`, `stripe.AccountSession.Components.Balances.Features`, `stripe.AccountSession.Components.NotificationBanner.Features`, and `stripe.AccountSession.Components.Payouts.Features` and parameter classes `stripe.AccountSession.CreateParamsComponentsAccountManagementFeatures`, `stripe.AccountSession.CreateParamsComponentsAccountOnboardingFeatures`, `stripe.AccountSession.CreateParamsComponentsBalancesFeatures`, `stripe.AccountSession.CreateParamsComponentsNotificationBannerFeatures`, and `stripe.AccountSession.CreateParamsComponentsPayoutsFeatures` + * Add support for `alma` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.Refund.DestinationDetails`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `kakao_pay`, `kr_card` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.Mandate.PaymentMethodDetails`, `stripe.PaymentIntent.PaymentMethodOptions`, `stripe.SetupAttempt.PaymentMethodDetails`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` + * Add support for `naver_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` + * Add support for `payco`, `samsung_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resource `stripe.PaymentMethod` + * Add support for `enhanced_evidence` on resource class `stripe.Dispute.Evidence` and parameter class `stripe.Dispute.ModifyParamsEvidence` + * Add support for `enhanced_eligibility` on resource class `stripe.Dispute.EvidenceDetails` + * Add support for `enhanced_eligibility_types` on resource `stripe.Dispute` + * Add support for `automatically_finalizes_at` on parameter classes `stripe.Invoice.CreateParams` and `stripe.Invoice.ModifyParams` + * Add support for `amazon_pay` on resource `stripe.PaymentMethodDomain` + * Add support for `flat_amount`, `rate_type` on resource `stripe.TaxRate` and resource class `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails` + * Add support for `schedule_at_period_end` on parameter classes `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionUpdate` and `stripe.billing_portal.Configuration.ModifyParamsFeaturesSubscriptionUpdate` and resource class `stripe.billing_portal.Configuration.Features.SubscriptionUpdate` + * Add support for `metadata` on parameter class `stripe.forwarding.Request.CreateParams` and resource `stripe.forwarding.Request` + * Add support for `_cls_submit_card` on resource `stripe.issuing.Card` + * Add support for `submit_card` on resource `stripe.issuing.Card` + * Add support for `by`, `cr`, `ec`, `ma`, `md`, `rs`, `ru`, `tz`, `uz` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `pln` on parameter classes `stripe.terminal.Configuration.CreateParamsTipping` and `stripe.terminal.Configuration.ModifyParamsTipping` and resource class `stripe.terminal.Configuration.Tipping` + * Change type of `business_profile` on `stripe.billing_portal.Configuration.CreateParams` from `Configuration.CreateParamsBusinessProfile` to `NotRequired[Configuration.CreateParamsBusinessProfile]` + * Add support for `by_tin`, `ma_vat`, `md_vat`, `tz_vat`, `uz_tin`, `uz_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `alma`, `kakao_pay`, `kr_card`, `naver_pay`, `payco` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `samsung_pay` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `auto` on enum `stripe.Customer.ModifyParamsTax.validate_location` + * Add support for `issuing_transaction.purchase_details_receipt_updated`, `refund.failed` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `jp_credit_transfer` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `retail_delivery_fee` on enums `stripe.Invoice.AddLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.Invoice.UpdateLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.InvoiceLineItem.ModifyParamsTaxAmountTaxRateData.tax_type`, `stripe.tax.Calculation.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.CalculationLineItem.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Transaction.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.TaxRate.tax_type`, `stripe.TaxRate.CreateParams.tax_type`, and `stripe.TaxRate.ModifyParams.tax_type` + * Add support for `state_retail_delivery_fee` on enums `stripe.tax.Registration.CountryOptions.Us.type` and `stripe.tax.Registration.CreateParamsCountryOptionsUs.type` + * Add support for `2024-10-28.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` + ## 11.2.0b3 - 2024-10-18 * [#1413](https://github.com/stripe/stripe-python/pull/1413) Update generated code for beta * Add support for `alma_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` @@ -70,7 +104,7 @@ * Add support for `payout_statement_descriptor_profanity` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.QuotePreviewInvoice.LastFinalizationError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` * Add support for `retail_delivery_fee` on enums `stripe.Invoice.AddLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.Invoice.UpdateLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.InvoiceLineItem.ModifyParamsTaxAmountTaxRateData.tax_type`, `stripe.tax.Calculation.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.CalculationLineItem.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Transaction.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.TaxRate.tax_type`, `stripe.TaxRate.CreateParams.tax_type`, and `stripe.TaxRate.ModifyParams.tax_type` * Add support for `expired` on enums `stripe.issuing.Authorization.status` and `stripe.issuing.Authorization.ListParams.status` - * Add support for `state_retail_delivery_fee` on enums `stripe.tax.Registration.CountryOptions.Us.type` and `stripe.tax.Registration.CreateParamsCountryOptionsUs.type` + * Add support for `state_retail_delivery_fee` on enums `stripe.tax.Registration.CountryOptions.Us.type` and `stripe.tax.Registration.CreateParamsCountryOptionsUs.type` ## 11.2.0b1 - 2024-10-03 * [#1407](https://github.com/stripe/stripe-python/pull/1407) Updates beta branch with changes in master & update generated code @@ -81,6 +115,14 @@ * Move `raw_request` and related methods from `_raw_request` module to the `StripeClient` class * Remove `_preview` module; use raw request methods in the `StripeClient` class instead +## 11.1.1 - 2024-10-18 +* [#1414](https://github.com/stripe/stripe-python/pull/1414) Deserialize into correct v2 EventData types + * Fixes a bug where v2 EventData was not being deserialized into the appropriate type for `V1BillingMeterErrorReportTriggeredEvent` and `V1BillingMeterNoMeterFoundEvent` +* [#1415](https://github.com/stripe/stripe-python/pull/1415) update object tags for meter-related classes + + - fixes a bug where the `object` property of the `MeterEvent`, `MeterEventAdjustment`, and `MeterEventSession` didn't match the server. +* [#1412](https://github.com/stripe/stripe-python/pull/1412) Clean up examples + ## 11.1.0 - 2024-10-03 * [#1409](https://github.com/stripe/stripe-python/pull/1409) Update the class for `ThinEvent` to include `livemode` * [#1408](https://github.com/stripe/stripe-python/pull/1408) Update generated code diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 622f80766..c626f7dd8 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1314 \ No newline at end of file +v1319 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 8ebbe632e..dd71ba373 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -250,6 +250,18 @@ class Capabilities(StripeObject): """ The status of the GrabPay payments capability of the account, or whether the account can directly process GrabPay charges. """ + id_bank_transfer_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the Indonesia Bank Transfer payments capability of the account, or whether the account can directly process Indonesia Bank Transfer charges. + """ + id_bank_transfer_payments_bca: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of Bank BCA onboarding of the account. + """ ideal_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the iDEAL payments capability of the account, or whether the account can directly process iDEAL charges. @@ -1073,6 +1085,16 @@ class BacsDebitPayments(StripeObject): The Bacs Direct Debit Service user number for this account. For payments made with Bacs Direct Debit, this number is a unique identifier of the account with our banking partners. """ + class BankBcaOnboarding(StripeObject): + account_holder_name: Optional[str] + """ + Bank BCA business account holder name. + """ + business_account_number: Optional[str] + """ + Bank BCA business account number. + """ + class Branding(StripeObject): icon: Optional[ExpandableField["File"]] """ @@ -1244,6 +1266,7 @@ class TosAcceptance(StripeObject): _inner_class_types = {"tos_acceptance": TosAcceptance} bacs_debit_payments: Optional[BacsDebitPayments] + bank_bca_onboarding: Optional[BankBcaOnboarding] branding: Branding capital: Optional[Capital] card_issuing: Optional[CardIssuing] @@ -1257,6 +1280,7 @@ class TosAcceptance(StripeObject): treasury: Optional[Treasury] _inner_class_types = { "bacs_debit_payments": BacsDebitPayments, + "bank_bca_onboarding": BankBcaOnboarding, "branding": Branding, "capital": Capital, "card_issuing": CardIssuing, @@ -1715,6 +1739,18 @@ class CreateParamsCapabilities(TypedDict): """ The grabpay_payments capability. """ + id_bank_transfer_payments: NotRequired[ + "Account.CreateParamsCapabilitiesIdBankTransferPayments" + ] + """ + The id_bank_transfer_payments capability. + """ + id_bank_transfer_payments_bca: NotRequired[ + "Account.CreateParamsCapabilitiesIdBankTransferPaymentsBca" + ] + """ + The id_bank_transfer_payments_bca capability. + """ ideal_payments: NotRequired[ "Account.CreateParamsCapabilitiesIdealPayments" ] @@ -2090,6 +2126,18 @@ class CreateParamsCapabilitiesGrabpayPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesIdBankTransferPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesIdBankTransferPaymentsBca(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesIdealPayments(TypedDict): requested: NotRequired[bool] """ @@ -3036,6 +3084,12 @@ class CreateParamsSettings(TypedDict): """ Settings specific to Bacs Direct Debit. """ + bank_bca_onboarding: NotRequired[ + "Account.CreateParamsSettingsBankBcaOnboarding" + ] + """ + Settings specific to bank BCA onboarding for Indonesia bank transfers payments method. + """ branding: NotRequired["Account.CreateParamsSettingsBranding"] """ Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. @@ -3075,6 +3129,16 @@ class CreateParamsSettingsBacsDebitPayments(TypedDict): The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ + class CreateParamsSettingsBankBcaOnboarding(TypedDict): + account_holder_name: NotRequired[str] + """ + Bank BCA business account holder name + """ + business_account_number: NotRequired[str] + """ + Bank BCA business account number + """ + class CreateParamsSettingsBranding(TypedDict): icon: NotRequired[str] """ @@ -5215,7 +5279,7 @@ def create_login_link( cls, account: str, **params: Unpack["Account.CreateLoginLinkParams"] ) -> "LoginLink": """ - Creates a single-use login link for a connected account to access the Express Dashboard. + Creates a login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ @@ -5235,7 +5299,7 @@ async def create_login_link_async( cls, account: str, **params: Unpack["Account.CreateLoginLinkParams"] ) -> "LoginLink": """ - Creates a single-use login link for a connected account to access the Express Dashboard. + Creates a login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ diff --git a/stripe/_account_login_link_service.py b/stripe/_account_login_link_service.py index aa3d3dc7d..0d1d0a30c 100644 --- a/stripe/_account_login_link_service.py +++ b/stripe/_account_login_link_service.py @@ -22,7 +22,7 @@ def create( options: RequestOptions = {}, ) -> LoginLink: """ - Creates a single-use login link for a connected account to access the Express Dashboard. + Creates a login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ @@ -46,7 +46,7 @@ async def create_async( options: RequestOptions = {}, ) -> LoginLink: """ - Creates a single-use login link for a connected account to access the Express Dashboard. + Creates a login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 5c6776432..ef7f56188 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -372,6 +372,18 @@ class CreateParamsCapabilities(TypedDict): """ The grabpay_payments capability. """ + id_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesIdBankTransferPayments" + ] + """ + The id_bank_transfer_payments capability. + """ + id_bank_transfer_payments_bca: NotRequired[ + "AccountService.CreateParamsCapabilitiesIdBankTransferPaymentsBca" + ] + """ + The id_bank_transfer_payments_bca capability. + """ ideal_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesIdealPayments" ] @@ -751,6 +763,18 @@ class CreateParamsCapabilitiesGrabpayPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesIdBankTransferPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesIdBankTransferPaymentsBca(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesIdealPayments(TypedDict): requested: NotRequired[bool] """ @@ -1715,6 +1739,12 @@ class CreateParamsSettings(TypedDict): """ Settings specific to Bacs Direct Debit. """ + bank_bca_onboarding: NotRequired[ + "AccountService.CreateParamsSettingsBankBcaOnboarding" + ] + """ + Settings specific to bank BCA onboarding for Indonesia bank transfers payments method. + """ branding: NotRequired["AccountService.CreateParamsSettingsBranding"] """ Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. @@ -1758,6 +1788,16 @@ class CreateParamsSettingsBacsDebitPayments(TypedDict): The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ + class CreateParamsSettingsBankBcaOnboarding(TypedDict): + account_holder_name: NotRequired[str] + """ + Bank BCA business account holder name + """ + business_account_number: NotRequired[str] + """ + Bank BCA business account number + """ + class CreateParamsSettingsBranding(TypedDict): icon: NotRequired[str] """ @@ -2344,6 +2384,18 @@ class UpdateParamsCapabilities(TypedDict): """ The grabpay_payments capability. """ + id_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesIdBankTransferPayments" + ] + """ + The id_bank_transfer_payments capability. + """ + id_bank_transfer_payments_bca: NotRequired[ + "AccountService.UpdateParamsCapabilitiesIdBankTransferPaymentsBca" + ] + """ + The id_bank_transfer_payments_bca capability. + """ ideal_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesIdealPayments" ] @@ -2723,6 +2775,18 @@ class UpdateParamsCapabilitiesGrabpayPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesIdBankTransferPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class UpdateParamsCapabilitiesIdBankTransferPaymentsBca(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesIdealPayments(TypedDict): requested: NotRequired[bool] """ @@ -3617,6 +3681,12 @@ class UpdateParamsSettings(TypedDict): """ Settings specific to Bacs Direct Debit payments. """ + bank_bca_onboarding: NotRequired[ + "AccountService.UpdateParamsSettingsBankBcaOnboarding" + ] + """ + Settings specific to bank BCA onboarding for Indonesia bank transfers payments method. + """ branding: NotRequired["AccountService.UpdateParamsSettingsBranding"] """ Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. @@ -3664,6 +3734,16 @@ class UpdateParamsSettingsBacsDebitPayments(TypedDict): The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ + class UpdateParamsSettingsBankBcaOnboarding(TypedDict): + account_holder_name: NotRequired[str] + """ + Bank BCA business account holder name + """ + business_account_number: NotRequired[str] + """ + Bank BCA business account number + """ + class UpdateParamsSettingsBranding(TypedDict): icon: NotRequired[str] """ diff --git a/stripe/_account_session.py b/stripe/_account_session.py index fd3ef93bf..0371696eb 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -427,6 +427,9 @@ class CreateParamsComponents(TypedDict): recipients: NotRequired[ "AccountSession.CreateParamsComponentsRecipients" ] + """ + Configuration for the recipients component. + """ reporting_chart: NotRequired[ "AccountSession.CreateParamsComponentsReportingChart" ] @@ -643,6 +646,9 @@ class CreateParamsComponentsFinancialAccount(TypedDict): features: NotRequired[ "AccountSession.CreateParamsComponentsFinancialAccountFeatures" ] + """ + The list of features enabled in the embedded component. + """ class CreateParamsComponentsFinancialAccountFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] @@ -882,12 +888,12 @@ class CreateParamsComponentsRecipients(TypedDict): features: NotRequired[ "AccountSession.CreateParamsComponentsRecipientsFeatures" ] - """ - The list of features enabled in the embedded component. - """ class CreateParamsComponentsRecipientsFeatures(TypedDict): - pass + send_money: NotRequired[bool] + """ + Whether to allow sending money. + """ class CreateParamsComponentsReportingChart(TypedDict): enabled: bool diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 18ac2f516..e7b3c3963 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -146,6 +146,9 @@ class CreateParamsComponents(TypedDict): recipients: NotRequired[ "AccountSessionService.CreateParamsComponentsRecipients" ] + """ + Configuration for the recipients component. + """ reporting_chart: NotRequired[ "AccountSessionService.CreateParamsComponentsReportingChart" ] @@ -362,6 +365,9 @@ class CreateParamsComponentsFinancialAccount(TypedDict): features: NotRequired[ "AccountSessionService.CreateParamsComponentsFinancialAccountFeatures" ] + """ + The list of features enabled in the embedded component. + """ class CreateParamsComponentsFinancialAccountFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] @@ -601,12 +607,12 @@ class CreateParamsComponentsRecipients(TypedDict): features: NotRequired[ "AccountSessionService.CreateParamsComponentsRecipientsFeatures" ] - """ - The list of features enabled in the embedded component. - """ class CreateParamsComponentsRecipientsFeatures(TypedDict): - pass + send_money: NotRequired[bool] + """ + Whether to allow sending money. + """ class CreateParamsComponentsReportingChart(TypedDict): enabled: bool diff --git a/stripe/_api_version.py b/stripe/_api_version.py index e23615373..16c42a5c5 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2024-09-30.acacia" + CURRENT = "2024-10-28.acacia" diff --git a/stripe/_charge.py b/stripe/_charge.py index 2249a8eb1..da11064c5 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1108,6 +1108,28 @@ class Grabpay(StripeObject): Unique transaction id generated by GrabPay """ + class IdBankTransfer(StripeObject): + account_number: str + """ + Account number of the bank account to transfer funds to. + """ + bank: Literal["bca", "bni", "bri", "cimb", "permata"] + """ + Bank where the account is located. + """ + bank_code: Optional[str] + """ + Local bank code of the bank. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + display_name: Optional[str] + """ + Merchant name and billing details name, for the customer to check for the correct merchant when performing the bank transfer. + """ + class Ideal(StripeObject): bank: Optional[ Literal[ @@ -1846,6 +1868,7 @@ class Zip(StripeObject): giropay: Optional[Giropay] gopay: Optional[Gopay] grabpay: Optional[Grabpay] + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] kakao_pay: Optional[KakaoPay] @@ -1909,6 +1932,7 @@ class Zip(StripeObject): "giropay": Giropay, "gopay": Gopay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "interac_present": InteracPresent, "kakao_pay": KakaoPay, diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 99516b8c5..5faa2f01e 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -904,6 +904,12 @@ class Gopay(StripeObject): class Grabpay(StripeObject): pass + class IdBankTransfer(StripeObject): + bank: Optional[Literal["bca", "bni", "bri", "cimb", "permata"]] + bank_code: Optional[str] + bank_name: Optional[str] + display_name: Optional[str] + class Ideal(StripeObject): bank: Optional[ Literal[ @@ -1411,6 +1417,7 @@ class Zip(StripeObject): giropay: Optional[Giropay] gopay: Optional[Gopay] grabpay: Optional[Grabpay] + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] kakao_pay: Optional[KakaoPay] @@ -1460,6 +1467,7 @@ class Zip(StripeObject): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "interac_present", "kakao_pay", @@ -1520,6 +1528,7 @@ class Zip(StripeObject): "giropay": Giropay, "gopay": Gopay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "interac_present": InteracPresent, "kakao_pay": KakaoPay, @@ -1738,6 +1747,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataIdeal" ] @@ -1931,6 +1946,7 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -2174,6 +2190,12 @@ class CreateParamsPaymentMethodDataGopay(TypedDict): class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ diff --git a/stripe/_customer.py b/stripe/_customer.py index d23ce3add..89abd699b 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -872,6 +872,7 @@ class ListPaymentMethodsParams(RequestOptions): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 695b8beea..6c115b6be 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -54,6 +54,7 @@ class ListParams(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 4405d33ec..22f5c33e1 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -233,7 +233,7 @@ class ShippingAddress(StripeObject): """ The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. """ - enhanced_evidence: Optional[EnhancedEvidence] + enhanced_evidence: EnhancedEvidence product_description: Optional[str] """ A description of the product or service that was sold. @@ -323,7 +323,7 @@ class VisaCompellingEvidence3(StripeObject): """ Date by which evidence must be submitted in order to successfully challenge dispute. Will be 0 if the customer's bank or credit card company doesn't allow a response for this particular dispute. """ - enhanced_eligibility: Optional[EnhancedEligibility] + enhanced_eligibility: EnhancedEligibility has_evidence: bool """ Whether evidence has been staged for this dispute. @@ -764,9 +764,7 @@ class RetrieveParams(RequestOptions): """ 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). """ - enhanced_eligibility_types: Optional[ - List[Literal["visa_compelling_evidence_3"]] - ] + enhanced_eligibility_types: List[Literal["visa_compelling_evidence_3"]] """ List of eligibility types that are included in `enhanced_evidence`. """ diff --git a/stripe/_event.py b/stripe/_event.py index 4ececa531..71fb89f70 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -348,6 +348,7 @@ class RetrieveParams(RequestOptions): "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 4a254d6bb..702bb8956 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -495,7 +495,6 @@ class LastFinalizationError(StripeObject): "payment_method_unexpected_state", "payment_method_unsupported_type", "payout_reconciliation_not_ready", - "payout_statement_descriptor_profanity", "payouts_limit_exceeded", "payouts_not_allowed", "platform_account_required", @@ -694,6 +693,9 @@ class EuBankTransfer(StripeObject): """ _inner_class_types = {"bank_transfer": BankTransfer} + class IdBankTransfer(StripeObject): + pass + class Konbini(StripeObject): pass @@ -770,6 +772,10 @@ class Filters(StripeObject): """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: Optional[IdBankTransfer] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: Optional[Konbini] """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. @@ -787,6 +793,7 @@ class Filters(StripeObject): "bancontact": Bancontact, "card": Card, "customer_balance": CustomerBalance, + "id_bank_transfer": IdBankTransfer, "konbini": Konbini, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, @@ -818,6 +825,7 @@ class Filters(StripeObject): "fpx", "giropay", "grabpay", + "id_bank_transfer", "ideal", "jp_credit_transfer", "kakao_pay", @@ -1462,6 +1470,10 @@ class CreateParams(RequestOptions): """ Settings for automatic tax lookup for this invoice. """ + automatically_finalizes_at: NotRequired[int] + """ + The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. + """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -1707,7 +1719,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -1738,6 +1750,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -1869,6 +1887,11 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -4156,6 +4179,10 @@ class ModifyParams(RequestOptions): """ Settings for automatic tax lookup for this invoice. """ + automatically_finalizes_at: NotRequired[int] + """ + The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. To turn off automatic finalization, set `auto_advance` to false. + """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -4375,7 +4402,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -4406,6 +4433,12 @@ class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -4537,6 +4570,11 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class ModifyParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 28a888272..9b9565499 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -349,6 +349,10 @@ class CreateParams(TypedDict): """ Settings for automatic tax lookup for this invoice. """ + automatically_finalizes_at: NotRequired[int] + """ + The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. + """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -602,7 +606,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -633,6 +637,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -764,6 +774,11 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -5395,6 +5410,10 @@ class UpdateParams(TypedDict): """ Settings for automatic tax lookup for this invoice. """ + automatically_finalizes_at: NotRequired[int] + """ + The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. To turn off automatic finalization, set `auto_advance` to false. + """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] @@ -5620,7 +5639,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -5651,6 +5670,12 @@ class UpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -5782,6 +5807,11 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class UpdateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 813c40768..cec059ede 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -175,5 +175,6 @@ stripe.v2.billing.MeterEventAdjustment.OBJECT_NAME: stripe.v2.billing.MeterEventAdjustment, stripe.v2.billing.MeterEventSession.OBJECT_NAME: stripe.v2.billing.MeterEventSession, stripe.v2.Event.OBJECT_NAME: stripe.v2.Event, + stripe.v2.EventDestination.OBJECT_NAME: stripe.v2.EventDestination, # V2 Object classes: The end of the section generated from our OpenAPI spec } diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 0d0fc5fed..7dde40b7f 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -239,7 +239,6 @@ class LastPaymentError(StripeObject): "payment_method_unexpected_state", "payment_method_unsupported_type", "payout_reconciliation_not_ready", - "payout_statement_descriptor_profanity", "payouts_limit_exceeded", "payouts_not_allowed", "platform_account_required", @@ -1861,6 +1860,26 @@ class Grabpay(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class IdBankTransfer(StripeObject): + expires_after: Optional[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now till 2678400 seconds (31 days) from now. + """ + expires_at: Optional[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + """ + class Ideal(StripeObject): setup_future_usage: Optional[Literal["none", "off_session"]] """ @@ -2506,6 +2525,7 @@ class Zip(StripeObject): giropay: Optional[Giropay] gopay: Optional[Gopay] grabpay: Optional[Grabpay] + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] kakao_pay: Optional[KakaoPay] @@ -2558,6 +2578,7 @@ class Zip(StripeObject): "giropay": Giropay, "gopay": Gopay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "interac_present": InteracPresent, "kakao_pay": KakaoPay, @@ -4369,6 +4390,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -4546,6 +4573,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -4789,6 +4817,12 @@ class ConfirmParamsPaymentMethodDataGopay(TypedDict): class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): pass + class ConfirmParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -5138,6 +5172,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsIdBankTransfer" + ] + """ + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. + """ ideal: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsIdeal" ] @@ -6073,6 +6113,28 @@ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. + """ + expires_at: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -7985,6 +8047,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -8160,6 +8228,7 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -8403,6 +8472,12 @@ class CreateParamsPaymentMethodDataGopay(TypedDict): class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -8752,6 +8827,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsIdBankTransfer" + ] + """ + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. + """ ideal: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsIdeal" ] @@ -9687,6 +9768,28 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. + """ + expires_at: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -11709,6 +11812,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -11884,6 +11993,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -12127,6 +12237,12 @@ class ModifyParamsPaymentMethodDataGopay(TypedDict): class ModifyParamsPaymentMethodDataGrabpay(TypedDict): pass + class ModifyParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class ModifyParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -12476,6 +12592,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsIdBankTransfer" + ] + """ + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. + """ ideal: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsIdeal" ] @@ -13411,6 +13533,28 @@ class ModifyParamsPaymentMethodOptionsGrabpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. + """ + expires_at: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -14341,6 +14485,28 @@ class SearchParams(RequestOptions): The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents). """ + class TriggerActionParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + scan_qr_code: NotRequired[ + "PaymentIntent.TriggerActionParamsScanQrCode" + ] + """ + True to simulate success, false to simulate failure. + """ + type: Literal["expire", "fund"] + """ + The type of action to be simulated. + """ + + class TriggerActionParamsScanQrCode(TypedDict): + result: NotRequired[Literal["failure", "success"]] + """ + Whether the QR Code scan's payment should succeed or fail. + """ + class VerifyMicrodepositsParams(RequestOptions): amounts: NotRequired[List[int]] """ @@ -15963,6 +16129,116 @@ async def retrieve_async( await instance.refresh_async() return instance + @classmethod + def _cls_trigger_action( + cls, intent: str, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + "PaymentIntent", + cls._static_request( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + def trigger_action( + intent: str, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + ... + + @overload + def trigger_action( + self, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + ... + + @class_method_variant("_cls_trigger_action") + def trigger_action( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + "PaymentIntent", + self._request( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_trigger_action_async( + cls, intent: str, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + "PaymentIntent", + await cls._static_request_async( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def trigger_action_async( + intent: str, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + ... + + @overload + async def trigger_action_async( + self, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + ... + + @class_method_variant("_cls_trigger_action_async") + async def trigger_action_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + "PaymentIntent", + await self._request_async( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_verify_microdeposits( cls, diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index f25e0c257..f8698edd4 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -1745,6 +1745,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataIdeal" ] @@ -1942,6 +1948,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -2187,6 +2194,12 @@ class ConfirmParamsPaymentMethodDataGopay(TypedDict): class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): pass + class ConfirmParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -2536,6 +2549,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsIdBankTransfer" + ] + """ + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. + """ ideal: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsIdeal" ] @@ -3471,6 +3490,28 @@ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. + """ + expires_at: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -5413,6 +5454,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataIdeal" ] @@ -5610,6 +5657,7 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -5855,6 +5903,12 @@ class CreateParamsPaymentMethodDataGopay(TypedDict): class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -6204,6 +6258,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsIdBankTransfer" + ] + """ + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. + """ ideal: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsIdeal" ] @@ -7139,6 +7199,28 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. + """ + expires_at: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -8262,6 +8344,28 @@ class SearchParams(TypedDict): The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents). """ + class TriggerActionParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + scan_qr_code: NotRequired[ + "PaymentIntentService.TriggerActionParamsScanQrCode" + ] + """ + True to simulate success, false to simulate failure. + """ + type: Literal["expire", "fund"] + """ + The type of action to be simulated. + """ + + class TriggerActionParamsScanQrCode(TypedDict): + result: NotRequired[Literal["failure", "success"]] + """ + Whether the QR Code scan's payment should succeed or fail. + """ + class UpdateParams(TypedDict): amount: NotRequired[int] """ @@ -9221,6 +9325,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataIdeal" ] @@ -9418,6 +9528,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -9663,6 +9774,12 @@ class UpdateParamsPaymentMethodDataGopay(TypedDict): class UpdateParamsPaymentMethodDataGrabpay(TypedDict): pass + class UpdateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class UpdateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -10012,6 +10129,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsIdBankTransfer" + ] + """ + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. + """ ideal: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsIdeal" ] @@ -10947,6 +11070,28 @@ class UpdateParamsPaymentMethodOptionsGrabpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. + """ + expires_at: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class UpdateParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -12556,3 +12701,47 @@ async def verify_microdeposits_async( options=options, ), ) + + def trigger_action( + self, + intent: str, + params: "PaymentIntentService.TriggerActionParams", + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + PaymentIntent, + self._request( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(intent), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def trigger_action_async( + self, + intent: str, + params: "PaymentIntentService.TriggerActionParams", + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + PaymentIntent, + await self._request_async( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(intent), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index bcb7f4f22..158e4a51b 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -859,6 +859,12 @@ class Gopay(StripeObject): class Grabpay(StripeObject): pass + class IdBankTransfer(StripeObject): + bank: Optional[Literal["bca", "bni", "bri", "cimb", "permata"]] + bank_code: Optional[str] + bank_name: Optional[str] + display_name: Optional[str] + class Ideal(StripeObject): bank: Optional[ Literal[ @@ -1454,6 +1460,12 @@ class CreateParams(RequestOptions): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentMethod.CreateParamsIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["PaymentMethod.CreateParamsIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -1601,6 +1613,7 @@ class CreateParams(RequestOptions): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -1875,6 +1888,12 @@ class CreateParamsGopay(TypedDict): class CreateParamsGrabpay(TypedDict): pass + class CreateParamsIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -2149,6 +2168,7 @@ class ListParams(RequestOptions): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -2371,6 +2391,7 @@ class RetrieveParams(RequestOptions): """ Unique identifier for the object. """ + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] kakao_pay: Optional[KakaoPay] @@ -2436,6 +2457,7 @@ class RetrieveParams(RequestOptions): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "interac_present", "kakao_pay", @@ -2953,6 +2975,7 @@ async def retrieve_async( "giropay": Giropay, "gopay": Gopay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "interac_present": InteracPresent, "kakao_pay": KakaoPay, diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 1b708fa1c..1ecc32bb1 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -477,6 +477,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Gopay(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Literal["none", "off", "on"] + """ + The account's display preference. + """ + value: Literal["off", "on"] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class Grabpay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -499,6 +521,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class IdBankTransfer(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Literal["none", "off", "on"] + """ + The account's display preference. + """ + value: Literal["off", "on"] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class Ideal(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -785,6 +829,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Qris(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Literal["none", "off", "on"] + """ + The account's display preference. + """ + value: Literal["off", "on"] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class RevolutPay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -829,6 +895,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Shopeepay(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Literal["none", "off", "on"] + """ + The account's display preference. + """ + value: Literal["off", "on"] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class Sofort(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -1072,10 +1160,20 @@ class CreateParams(RequestOptions): """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ + gopay: NotRequired["PaymentMethodConfiguration.CreateParamsGopay"] + """ + GoPay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Gojek app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Gojek app to confirm payment. + """ grabpay: NotRequired["PaymentMethodConfiguration.CreateParamsGrabpay"] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ + id_bank_transfer: NotRequired[ + "PaymentMethodConfiguration.CreateParamsIdBankTransfer" + ] + """ + Stripe users in Indonesia can receive bank transfers from customers in Indonesia. Bank transfers are a popular B2C and B2B payment method in Indonesia. + """ ideal: NotRequired["PaymentMethodConfiguration.CreateParamsIdeal"] """ iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. Check this [page](https://stripe.com/docs/payments/ideal) for more details. @@ -1142,6 +1240,10 @@ class CreateParams(RequestOptions): """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ + qris: NotRequired["PaymentMethodConfiguration.CreateParamsQris"] + """ + QRIS is a [real-time](https://docs.stripe.com/payments/real-time) payment method popular in Indonesia. When paying with QRIS, customers authenticate and approve payments by scanning a QR code in their preferred digital wallet app. + """ revolut_pay: NotRequired[ "PaymentMethodConfiguration.CreateParamsRevolutPay" ] @@ -1154,6 +1256,12 @@ class CreateParams(RequestOptions): """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ + shopeepay: NotRequired[ + "PaymentMethodConfiguration.CreateParamsShopeepay" + ] + """ + ShopeePay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Shopee app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Shopee app to confirm payment. + """ sofort: NotRequired["PaymentMethodConfiguration.CreateParamsSofort"] """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. @@ -1477,6 +1585,20 @@ class CreateParamsGooglePayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsGopay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsGopayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsGopayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsGrabpayDisplayPreference" @@ -1491,6 +1613,20 @@ class CreateParamsGrabpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsIdBankTransfer(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsIdBankTransferDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsIdBankTransferDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsIdealDisplayPreference" @@ -1673,6 +1809,20 @@ class CreateParamsPromptpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsQris(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsQrisDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsQrisDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsRevolutPayDisplayPreference" @@ -1701,6 +1851,20 @@ class CreateParamsSepaDebitDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsShopeepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsShopeepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsShopeepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsSofortDisplayPreference" @@ -1922,10 +2086,20 @@ class ModifyParams(RequestOptions): """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ + gopay: NotRequired["PaymentMethodConfiguration.ModifyParamsGopay"] + """ + GoPay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Gojek app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Gojek app to confirm payment. + """ grabpay: NotRequired["PaymentMethodConfiguration.ModifyParamsGrabpay"] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ + id_bank_transfer: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsIdBankTransfer" + ] + """ + Stripe users in Indonesia can receive bank transfers from customers in Indonesia. Bank transfers are a popular B2C and B2B payment method in Indonesia. + """ ideal: NotRequired["PaymentMethodConfiguration.ModifyParamsIdeal"] """ iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. Check this [page](https://stripe.com/docs/payments/ideal) for more details. @@ -1988,6 +2162,10 @@ class ModifyParams(RequestOptions): """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ + qris: NotRequired["PaymentMethodConfiguration.ModifyParamsQris"] + """ + QRIS is a [real-time](https://docs.stripe.com/payments/real-time) payment method popular in Indonesia. When paying with QRIS, customers authenticate and approve payments by scanning a QR code in their preferred digital wallet app. + """ revolut_pay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsRevolutPay" ] @@ -2000,6 +2178,12 @@ class ModifyParams(RequestOptions): """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ + shopeepay: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsShopeepay" + ] + """ + ShopeePay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Shopee app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Shopee app to confirm payment. + """ sofort: NotRequired["PaymentMethodConfiguration.ModifyParamsSofort"] """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. @@ -2323,6 +2507,20 @@ class ModifyParamsGooglePayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsGopay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsGopayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsGopayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsGrabpayDisplayPreference" @@ -2337,6 +2535,20 @@ class ModifyParamsGrabpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsIdBankTransfer(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsIdBankTransferDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsIdBankTransferDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsIdealDisplayPreference" @@ -2519,6 +2731,20 @@ class ModifyParamsPromptpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsQris(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsQrisDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsQrisDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsRevolutPayDisplayPreference" @@ -2547,6 +2773,20 @@ class ModifyParamsSepaDebitDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsShopeepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsShopeepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsShopeepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsSofortDisplayPreference" @@ -2665,11 +2905,13 @@ class RetrieveParams(RequestOptions): fpx: Optional[Fpx] giropay: Optional[Giropay] google_pay: Optional[GooglePay] + gopay: Optional[Gopay] grabpay: Optional[Grabpay] id: str """ Unique identifier for the object. """ + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] is_default: bool """ @@ -2703,8 +2945,10 @@ class RetrieveParams(RequestOptions): paypal: Optional[Paypal] payto: Optional[Payto] promptpay: Optional[Promptpay] + qris: Optional[Qris] revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] + shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] swish: Optional[Swish] twint: Optional[Twint] @@ -2869,7 +3113,9 @@ async def retrieve_async( "fpx": Fpx, "giropay": Giropay, "google_pay": GooglePay, + "gopay": Gopay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "jcb": Jcb, "klarna": Klarna, @@ -2883,8 +3129,10 @@ async def retrieve_async( "paypal": Paypal, "payto": Payto, "promptpay": Promptpay, + "qris": Qris, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, + "shopeepay": Shopeepay, "sofort": Sofort, "swish": Swish, "twint": Twint, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 1107341b9..7083ea7b3 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -131,12 +131,24 @@ class CreateParams(TypedDict): """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ + gopay: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsGopay" + ] + """ + GoPay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Gojek app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Gojek app to confirm payment. + """ grabpay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsGrabpay" ] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ + id_bank_transfer: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsIdBankTransfer" + ] + """ + Stripe users in Indonesia can receive bank transfers from customers in Indonesia. Bank transfers are a popular B2C and B2B payment method in Indonesia. + """ ideal: NotRequired[ "PaymentMethodConfigurationService.CreateParamsIdeal" ] @@ -215,6 +227,10 @@ class CreateParams(TypedDict): """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ + qris: NotRequired["PaymentMethodConfigurationService.CreateParamsQris"] + """ + QRIS is a [real-time](https://docs.stripe.com/payments/real-time) payment method popular in Indonesia. When paying with QRIS, customers authenticate and approve payments by scanning a QR code in their preferred digital wallet app. + """ revolut_pay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsRevolutPay" ] @@ -227,6 +243,12 @@ class CreateParams(TypedDict): """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ + shopeepay: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsShopeepay" + ] + """ + ShopeePay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Shopee app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Shopee app to confirm payment. + """ sofort: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSofort" ] @@ -556,6 +578,20 @@ class CreateParamsGooglePayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsGopay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsGopayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsGopayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsGrabpayDisplayPreference" @@ -570,6 +606,20 @@ class CreateParamsGrabpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsIdBankTransfer(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsIdBankTransferDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsIdBankTransferDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsIdealDisplayPreference" @@ -752,6 +802,20 @@ class CreateParamsPromptpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsQris(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsQrisDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsQrisDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsRevolutPayDisplayPreference" @@ -780,6 +844,20 @@ class CreateParamsSepaDebitDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsShopeepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsShopeepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsShopeepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSofortDisplayPreference" @@ -1017,12 +1095,24 @@ class UpdateParams(TypedDict): """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ + gopay: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsGopay" + ] + """ + GoPay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Gojek app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Gojek app to confirm payment. + """ grabpay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsGrabpay" ] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ + id_bank_transfer: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsIdBankTransfer" + ] + """ + Stripe users in Indonesia can receive bank transfers from customers in Indonesia. Bank transfers are a popular B2C and B2B payment method in Indonesia. + """ ideal: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsIdeal" ] @@ -1097,6 +1187,10 @@ class UpdateParams(TypedDict): """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ + qris: NotRequired["PaymentMethodConfigurationService.UpdateParamsQris"] + """ + QRIS is a [real-time](https://docs.stripe.com/payments/real-time) payment method popular in Indonesia. When paying with QRIS, customers authenticate and approve payments by scanning a QR code in their preferred digital wallet app. + """ revolut_pay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsRevolutPay" ] @@ -1109,6 +1203,12 @@ class UpdateParams(TypedDict): """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ + shopeepay: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsShopeepay" + ] + """ + ShopeePay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Shopee app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Shopee app to confirm payment. + """ sofort: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSofort" ] @@ -1438,6 +1538,20 @@ class UpdateParamsGooglePayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsGopay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsGopayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsGopayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsGrabpayDisplayPreference" @@ -1452,6 +1566,20 @@ class UpdateParamsGrabpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsIdBankTransfer(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsIdBankTransferDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsIdBankTransferDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsIdealDisplayPreference" @@ -1634,6 +1762,20 @@ class UpdateParamsPromptpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsQris(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsQrisDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsQrisDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsRevolutPayDisplayPreference" @@ -1662,6 +1804,20 @@ class UpdateParamsSepaDebitDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsShopeepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsShopeepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsShopeepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSofortDisplayPreference" diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 6773b29da..77ad49d58 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -123,6 +123,12 @@ class CreateParams(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentMethodService.CreateParamsIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["PaymentMethodService.CreateParamsIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -272,6 +278,7 @@ class CreateParams(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -548,6 +555,12 @@ class CreateParamsGopay(TypedDict): class CreateParamsGrabpay(TypedDict): pass + class CreateParamsIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -822,6 +835,7 @@ class ListParams(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", diff --git a/stripe/_quote_preview_invoice.py b/stripe/_quote_preview_invoice.py index 056cacc5f..9ee47e569 100644 --- a/stripe/_quote_preview_invoice.py +++ b/stripe/_quote_preview_invoice.py @@ -477,7 +477,6 @@ class LastFinalizationError(StripeObject): "payment_method_unexpected_state", "payment_method_unsupported_type", "payout_reconciliation_not_ready", - "payout_statement_descriptor_profanity", "payouts_limit_exceeded", "payouts_not_allowed", "platform_account_required", @@ -676,6 +675,9 @@ class EuBankTransfer(StripeObject): """ _inner_class_types = {"bank_transfer": BankTransfer} + class IdBankTransfer(StripeObject): + pass + class Konbini(StripeObject): pass @@ -752,6 +754,10 @@ class Filters(StripeObject): """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: Optional[IdBankTransfer] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: Optional[Konbini] """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. @@ -769,6 +775,7 @@ class Filters(StripeObject): "bancontact": Bancontact, "card": Card, "customer_balance": CustomerBalance, + "id_bank_transfer": IdBankTransfer, "konbini": Konbini, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, @@ -800,6 +807,7 @@ class Filters(StripeObject): "fpx", "giropay", "grabpay", + "id_bank_transfer", "ideal", "jp_credit_transfer", "kakao_pay", diff --git a/stripe/_refund.py b/stripe/_refund.py index 2f83e695d..d8f2c74b1 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -133,6 +133,16 @@ class Giropay(StripeObject): class Grabpay(StripeObject): pass + class IdBankTransfer(StripeObject): + reference: Optional[str] + """ + The reference assigned to the refund. + """ + reference_status: Optional[str] + """ + Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + """ + class JpBankTransfer(StripeObject): reference: Optional[str] """ @@ -243,6 +253,7 @@ class Zip(StripeObject): gb_bank_transfer: Optional[GbBankTransfer] giropay: Optional[Giropay] grabpay: Optional[Grabpay] + id_bank_transfer: Optional[IdBankTransfer] jp_bank_transfer: Optional[JpBankTransfer] klarna: Optional[Klarna] multibanco: Optional[Multibanco] @@ -279,6 +290,7 @@ class Zip(StripeObject): "gb_bank_transfer": GbBankTransfer, "giropay": Giropay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "jp_bank_transfer": JpBankTransfer, "klarna": Klarna, "multibanco": Multibanco, @@ -316,9 +328,6 @@ class EmailSent(StripeObject): _inner_class_types = {"email_sent": EmailSent} display_details: Optional[DisplayDetails] - """ - Contains the refund details. - """ type: str """ Type of the next action to perform. diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index ded6259ad..0df12d4fe 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -263,6 +263,24 @@ class Offline(StripeObject): class Cashapp(StripeObject): pass + class IdBankTransfer(StripeObject): + bank: Optional[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is located. + """ + bank_code: Optional[str] + """ + Local bank code of the bank. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + display_name: Optional[str] + """ + Merchant name and billing details name, for the customer to check for the correct merchant when performing the bank transfer. + """ + class Ideal(StripeObject): bank: Optional[ Literal[ @@ -401,6 +419,7 @@ class UsBankAccount(StripeObject): card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] kakao_pay: Optional[KakaoPay] klarna: Optional[Klarna] @@ -426,6 +445,7 @@ class UsBankAccount(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "kakao_pay": KakaoPay, "klarna": Klarna, @@ -576,7 +596,6 @@ class SetupError(StripeObject): "payment_method_unexpected_state", "payment_method_unsupported_type", "payout_reconciliation_not_ready", - "payout_statement_descriptor_profanity", "payouts_limit_exceeded", "payouts_not_allowed", "platform_account_required", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index a175d2947..cd2caf958 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -210,7 +210,6 @@ class LastSetupError(StripeObject): "payment_method_unexpected_state", "payment_method_unsupported_type", "payout_reconciliation_not_ready", - "payout_statement_descriptor_profanity", "payouts_limit_exceeded", "payouts_not_allowed", "platform_account_required", @@ -940,6 +939,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -1107,6 +1112,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -1350,6 +1356,12 @@ class ConfirmParamsPaymentMethodDataGopay(TypedDict): class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): pass + class ConfirmParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -2314,6 +2326,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["SetupIntent.CreateParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -2479,6 +2497,7 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -2722,6 +2741,12 @@ class CreateParamsPaymentMethodDataGopay(TypedDict): class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -3651,6 +3676,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -3816,6 +3847,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -4059,6 +4091,12 @@ class ModifyParamsPaymentMethodDataGopay(TypedDict): class ModifyParamsPaymentMethodDataGrabpay(TypedDict): pass + class ModifyParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class ModifyParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index c8b8ab4c6..f6bcac537 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -228,6 +228,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataIdeal" ] @@ -425,6 +431,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -670,6 +677,12 @@ class ConfirmParamsPaymentMethodDataGopay(TypedDict): class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): pass + class ConfirmParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -1652,6 +1665,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataIdeal" ] @@ -1845,6 +1864,7 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -2088,6 +2108,12 @@ class CreateParamsPaymentMethodDataGopay(TypedDict): class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -3047,6 +3073,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataIdeal" ] @@ -3240,6 +3272,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -3483,6 +3516,12 @@ class UpdateParamsPaymentMethodDataGopay(TypedDict): class UpdateParamsPaymentMethodDataGrabpay(TypedDict): pass + class UpdateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class UpdateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 9b6a4fecc..d90749333 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -287,6 +287,9 @@ class EuBankTransfer(StripeObject): """ _inner_class_types = {"bank_transfer": BankTransfer} + class IdBankTransfer(StripeObject): + pass + class Konbini(StripeObject): pass @@ -363,6 +366,10 @@ class Filters(StripeObject): """ This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription. """ + id_bank_transfer: Optional[IdBankTransfer] + """ + This sub-hash contains details about the Indonesia bank transfer payment method options to pass to invoices created by the subscription. + """ konbini: Optional[Konbini] """ This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription. @@ -380,6 +387,7 @@ class Filters(StripeObject): "bancontact": Bancontact, "card": Card, "customer_balance": CustomerBalance, + "id_bank_transfer": IdBankTransfer, "konbini": Konbini, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, @@ -407,6 +415,7 @@ class Filters(StripeObject): "fpx", "giropay", "grabpay", + "id_bank_transfer", "ideal", "jp_credit_transfer", "kakao_pay", @@ -1099,7 +1108,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -1136,6 +1145,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + This sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -1268,6 +1283,11 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -2056,7 +2076,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -2093,6 +2113,12 @@ class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + This sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -2225,6 +2251,11 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class ModifyParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 0ce834ab8..992736101 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -601,7 +601,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -638,6 +638,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + This sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -770,6 +776,11 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -1614,7 +1625,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -1651,6 +1662,12 @@ class UpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + This sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -1783,6 +1800,11 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class UpdateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 81657d48b..46fdb4a29 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -135,6 +135,7 @@ class CreateParams(RequestOptions): "2024-04-10", "2024-06-20", "2024-09-30.acacia", + "2024-10-28.acacia", ] ] """ @@ -294,6 +295,7 @@ class CreateParams(RequestOptions): "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", @@ -616,6 +618,7 @@ class ModifyParams(RequestOptions): "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 6ddffd151..3e4d291e2 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -116,6 +116,7 @@ class CreateParams(TypedDict): "2024-04-10", "2024-06-20", "2024-09-30.acacia", + "2024-10-28.acacia", ] ] """ @@ -275,6 +276,7 @@ class CreateParams(TypedDict): "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", @@ -603,6 +605,7 @@ class UpdateParams(TypedDict): "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index a374fe347..c46b9a02e 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1017,6 +1017,22 @@ class Ideal(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class KakaoPay(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + """ + class Klarna(StripeObject): setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] @@ -1047,6 +1063,22 @@ class Konbini(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class KrCard(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + """ + class Link(StripeObject): setup_future_usage: Optional[Literal["none", "off_session"]] """ @@ -1083,6 +1115,12 @@ class Multibanco(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class NaverPay(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class Oxxo(StripeObject): expires_after_days: int """ @@ -1111,6 +1149,12 @@ class P24(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class Payco(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class Paynow(StripeObject): setup_future_usage: Optional[Literal["none"]] """ @@ -1238,6 +1282,12 @@ class RevolutPay(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class SamsungPay(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class SepaDebit(StripeObject): setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] @@ -1365,18 +1415,23 @@ class ManualEntry(StripeObject): giropay: Optional[Giropay] grabpay: Optional[Grabpay] ideal: Optional[Ideal] + kakao_pay: Optional[KakaoPay] klarna: Optional[Klarna] konbini: Optional[Konbini] + kr_card: Optional[KrCard] link: Optional[Link] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] + naver_pay: Optional[NaverPay] oxxo: Optional[Oxxo] p24: Optional[P24] + payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] payto: Optional[Payto] pix: Optional[Pix] revolut_pay: Optional[RevolutPay] + samsung_pay: Optional[SamsungPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] @@ -1399,18 +1454,23 @@ class ManualEntry(StripeObject): "giropay": Giropay, "grabpay": Grabpay, "ideal": Ideal, + "kakao_pay": KakaoPay, "klarna": Klarna, "konbini": Konbini, + "kr_card": KrCard, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, + "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "payco": Payco, "paynow": Paynow, "paypal": Paypal, "payto": Payto, "pix": Pix, "revolut_pay": RevolutPay, + "samsung_pay": SamsungPay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, @@ -2890,6 +2950,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Ideal payment method options. """ + kakao_pay: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsKakaoPay" + ] + """ + contains details about the Kakao Pay payment method options. + """ klarna: NotRequired["Session.CreateParamsPaymentMethodOptionsKlarna"] """ contains details about the Klarna payment method options. @@ -2898,6 +2964,10 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Konbini payment method options. """ + kr_card: NotRequired["Session.CreateParamsPaymentMethodOptionsKrCard"] + """ + contains details about the Korean card payment method options. + """ link: NotRequired["Session.CreateParamsPaymentMethodOptionsLink"] """ contains details about the Link payment method options. @@ -2914,6 +2984,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Multibanco payment method options. """ + naver_pay: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsNaverPay" + ] + """ + contains details about the Kakao Pay payment method options. + """ oxxo: NotRequired["Session.CreateParamsPaymentMethodOptionsOxxo"] """ contains details about the OXXO payment method options. @@ -2922,6 +2998,10 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the P24 payment method options. """ + payco: NotRequired["Session.CreateParamsPaymentMethodOptionsPayco"] + """ + contains details about the PAYCO payment method options. + """ paynow: NotRequired["Session.CreateParamsPaymentMethodOptionsPaynow"] """ contains details about the PayNow payment method options. @@ -2944,6 +3024,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the RevolutPay payment method options. """ + samsung_pay: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsSamsungPay" + ] + """ + contains details about the Samsung Pay payment method options. + """ sepa_debit: NotRequired[ "Session.CreateParamsPaymentMethodOptionsSepaDebit" ] @@ -3312,6 +3398,18 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -3340,6 +3438,18 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsKrCard(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsLink(TypedDict): setup_future_usage: NotRequired[Literal["none", "off_session"]] """ @@ -3376,6 +3486,18 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -3408,6 +3530,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayco(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -3575,6 +3700,9 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): + pass + class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 524d5ef3d..783ae0f9c 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -1035,6 +1035,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Ideal payment method options. """ + kakao_pay: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsKakaoPay" + ] + """ + contains details about the Kakao Pay payment method options. + """ klarna: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsKlarna" ] @@ -1047,6 +1053,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Konbini payment method options. """ + kr_card: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsKrCard" + ] + """ + contains details about the Korean card payment method options. + """ link: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsLink" ] @@ -1065,6 +1077,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Multibanco payment method options. """ + naver_pay: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsNaverPay" + ] + """ + contains details about the Kakao Pay payment method options. + """ oxxo: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsOxxo" ] @@ -1075,6 +1093,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the P24 payment method options. """ + payco: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsPayco" + ] + """ + contains details about the PAYCO payment method options. + """ paynow: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsPaynow" ] @@ -1103,6 +1127,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the RevolutPay payment method options. """ + samsung_pay: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsSamsungPay" + ] + """ + contains details about the Samsung Pay payment method options. + """ sepa_debit: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsSepaDebit" ] @@ -1475,6 +1505,18 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -1503,6 +1545,18 @@ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsKrCard(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsLink(TypedDict): setup_future_usage: NotRequired[Literal["none", "off_session"]] """ @@ -1539,6 +1593,18 @@ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): + setup_future_usage: NotRequired[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). + """ + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ @@ -1571,6 +1637,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayco(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -1738,6 +1807,9 @@ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): + pass + class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] diff --git a/stripe/events/_v1_billing_meter_error_report_triggered_event.py b/stripe/events/_v1_billing_meter_error_report_triggered_event.py index f20157177..a3af378fb 100644 --- a/stripe/events/_v1_billing_meter_error_report_triggered_event.py +++ b/stripe/events/_v1_billing_meter_error_report_triggered_event.py @@ -1,9 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse from stripe.billing._meter import Meter from stripe.v2._event import Event -from typing import List, cast +from typing import Any, Dict, List, Optional, cast from typing_extensions import Literal @@ -88,6 +91,30 @@ class Request(StripeObject): Data for the v1.billing.meter.error_report_triggered event """ + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V1BillingMeterErrorReportTriggeredEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V1BillingMeterErrorReportTriggeredEvent.V1BillingMeterErrorReportTriggeredEventData._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/events/_v1_billing_meter_no_meter_found_event.py b/stripe/events/_v1_billing_meter_no_meter_found_event.py index 680c094aa..5f8d64479 100644 --- a/stripe/events/_v1_billing_meter_no_meter_found_event.py +++ b/stripe/events/_v1_billing_meter_no_meter_found_event.py @@ -1,8 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse from stripe.v2._event import Event -from typing import List +from typing import Any, Dict, List, Optional from typing_extensions import Literal @@ -86,3 +89,27 @@ class Request(StripeObject): """ Data for the v1.billing.meter.no_meter_found event """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V1BillingMeterNoMeterFoundEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V1BillingMeterNoMeterFoundEvent.V1BillingMeterNoMeterFoundEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index fa20ebdb5..23e005ba6 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -159,6 +159,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataIdeal" ] @@ -356,6 +362,7 @@ class CreateParamsPaymentMethodData(TypedDict): "giropay", "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", @@ -601,6 +608,12 @@ class CreateParamsPaymentMethodDataGopay(TypedDict): class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ diff --git a/stripe/v2/__init__.py b/stripe/v2/__init__.py index d8a2170e1..73418d2cf 100644 --- a/stripe/v2/__init__.py +++ b/stripe/v2/__init__.py @@ -7,4 +7,5 @@ from stripe.v2._billing_service import BillingService as BillingService from stripe.v2._core_service import CoreService as CoreService from stripe.v2._event import Event as Event +from stripe.v2._event_destination import EventDestination as EventDestination # The end of the section generated from our OpenAPI spec diff --git a/stripe/v2/_core_service.py b/stripe/v2/_core_service.py index 96c4a6f2e..f8e6b1dad 100644 --- a/stripe/v2/_core_service.py +++ b/stripe/v2/_core_service.py @@ -1,10 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService +from stripe.v2.core._event_destination_service import EventDestinationService from stripe.v2.core._event_service import EventService class CoreService(StripeService): def __init__(self, requestor): super().__init__(requestor) + self.event_destinations = EventDestinationService(self._requestor) self.events = EventService(self._requestor) diff --git a/stripe/v2/_event_destination.py b/stripe/v2/_event_destination.py new file mode 100644 index 000000000..1490f0c71 --- /dev/null +++ b/stripe/v2/_event_destination.py @@ -0,0 +1,124 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict, List, Optional +from typing_extensions import Literal + + +class EventDestination(StripeObject): + OBJECT_NAME: ClassVar[Literal["v2.core.event_destination"]] = ( + "v2.core.event_destination" + ) + + class StatusDetails(StripeObject): + class Disabled(StripeObject): + reason: Literal["no_aws_event_source_exists", "user"] + """ + Reason event destination has been disabled. + """ + + disabled: Optional[Disabled] + """ + Details about why the event destination has been disabled. + """ + _inner_class_types = {"disabled": Disabled} + + class AmazonEventbridge(StripeObject): + aws_account_id: str + """ + The AWS account ID. + """ + aws_event_source_arn: str + """ + The ARN of the AWS event source. + """ + aws_event_source_status: Literal[ + "active", "deleted", "pending", "unknown" + ] + """ + The state of the AWS event source. + """ + + class WebhookEndpoint(StripeObject): + signing_secret: Optional[str] + """ + The signing secret of the webhook endpoint, only includable on creation. + """ + url: Optional[str] + """ + The URL of the webhook endpoint, includable. + """ + + created: str + """ + Time at which the object was created. + """ + description: str + """ + An optional description of what the event destination is used for. + """ + enabled_events: List[str] + """ + The list of events to enable for this endpoint. + """ + event_payload: Literal["snapshot", "thin"] + """ + Payload type of events being subscribed to. + """ + events_from: Optional[List[Literal["other_accounts", "self"]]] + """ + Where events should be routed from. + """ + id: str + """ + Unique identifier for the object. + """ + 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]] + """ + Metadata. + """ + name: str + """ + Event destination name. + """ + object: Literal["v2.core.event_destination"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + snapshot_api_version: Optional[str] + """ + If using the snapshot event payload, the API version events are rendered as. + """ + status: Literal["disabled", "enabled"] + """ + Status. It can be set to either enabled or disabled. + """ + status_details: Optional[StatusDetails] + """ + Additional information about event destination status. + """ + type: Literal["amazon_eventbridge", "webhook_endpoint"] + """ + Event destination type. + """ + updated: str + """ + Time at which the object was last updated. + """ + amazon_eventbridge: Optional[AmazonEventbridge] + """ + Amazon EventBridge configuration. + """ + webhook_endpoint: Optional[WebhookEndpoint] + """ + Webhook endpoint configuration. + """ + _inner_class_types = { + "status_details": StatusDetails, + "amazon_eventbridge": AmazonEventbridge, + "webhook_endpoint": WebhookEndpoint, + } diff --git a/stripe/v2/core/__init__.py b/stripe/v2/core/__init__.py index 5879a6c60..14173e719 100644 --- a/stripe/v2/core/__init__.py +++ b/stripe/v2/core/__init__.py @@ -1,3 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.v2.core._event_destination_service import ( + EventDestinationService as EventDestinationService, +) from stripe.v2.core._event_service import EventService as EventService diff --git a/stripe/v2/core/_event_destination_service.py b/stripe/v2/core/_event_destination_service.py new file mode 100644 index 000000000..bb888184e --- /dev/null +++ b/stripe/v2/core/_event_destination_service.py @@ -0,0 +1,478 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._event import Event +from stripe.v2._event_destination import EventDestination +from stripe.v2._list_object import ListObject +from typing import Dict, List, Optional, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class EventDestinationService(StripeService): + class CreateParams(TypedDict): + description: NotRequired[str] + """ + An optional description of what the event destination is used for. + """ + enabled_events: List[str] + """ + The list of events to enable for this endpoint. + """ + event_payload: Literal["snapshot", "thin"] + """ + Payload type of events being subscribed to. + """ + events_from: NotRequired[List[Literal["other_accounts", "self"]]] + """ + Where events should be routed from. + """ + include: NotRequired[ + List[ + Literal[ + "webhook_endpoint.signing_secret", "webhook_endpoint.url" + ] + ] + ] + """ + Additional fields to include in the response. + """ + metadata: NotRequired[Dict[str, str]] + """ + Metadata. + """ + name: str + """ + Event destination name. + """ + snapshot_api_version: NotRequired[str] + """ + If using the snapshot event payload, the API version events are rendered as. + """ + type: Literal["amazon_eventbridge", "webhook_endpoint"] + """ + Event destination type. + """ + amazon_eventbridge: NotRequired[ + "EventDestinationService.CreateParamsAmazonEventbridge" + ] + """ + Amazon EventBridge configuration. + """ + webhook_endpoint: NotRequired[ + "EventDestinationService.CreateParamsWebhookEndpoint" + ] + """ + Webhook endpoint configuration. + """ + + class CreateParamsAmazonEventbridge(TypedDict): + aws_account_id: str + """ + The AWS account ID. + """ + aws_region: str + """ + The region of the AWS event source. + """ + + class CreateParamsWebhookEndpoint(TypedDict): + url: str + """ + The URL of the webhook endpoint. + """ + + class DeleteParams(TypedDict): + pass + + class DisableParams(TypedDict): + pass + + class EnableParams(TypedDict): + pass + + class ListParams(TypedDict): + include: NotRequired[List[Literal["webhook_endpoint.url"]]] + """ + Additional fields to include in the response. Currently supports `webhook_endpoint.url`. + """ + limit: NotRequired[int] + """ + The page size. + """ + page: NotRequired[str] + """ + The requested page. + """ + + class PingParams(TypedDict): + pass + + class RetrieveParams(TypedDict): + include: NotRequired[List[Literal["webhook_endpoint.url"]]] + """ + Additional fields to include in the response. + """ + + class UpdateParams(TypedDict): + description: NotRequired[str] + """ + An optional description of what the event destination is used for. + """ + enabled_events: NotRequired[List[str]] + """ + The list of events to enable for this endpoint. + """ + include: NotRequired[List[Literal["webhook_endpoint.url"]]] + """ + Additional fields to include in the response. Currently supports `webhook_endpoint.url`. + """ + metadata: NotRequired[Dict[str, Optional[str]]] + """ + Metadata. + """ + name: NotRequired[str] + """ + Event destination name. + """ + webhook_endpoint: NotRequired[ + "EventDestinationService.UpdateParamsWebhookEndpoint" + ] + """ + Webhook endpoint configuration. + """ + + class UpdateParamsWebhookEndpoint(TypedDict): + url: str + """ + The URL of the webhook endpoint. + """ + + def create( + self, + params: "EventDestinationService.CreateParams", + options: RequestOptions = {}, + ) -> EventDestination: + """ + Create a new event destination. + """ + return cast( + EventDestination, + self._request( + "post", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "EventDestinationService.CreateParams", + options: RequestOptions = {}, + ) -> EventDestination: + """ + Create a new event destination. + """ + return cast( + EventDestination, + await self._request_async( + "post", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + + def delete( + self, + id: str, + params: "EventDestinationService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Delete an event destination. + """ + return cast( + EventDestination, + self._request( + "delete", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def delete_async( + self, + id: str, + params: "EventDestinationService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Delete an event destination. + """ + return cast( + EventDestination, + await self._request_async( + "delete", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def disable( + self, + id: str, + params: "EventDestinationService.DisableParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Disable an event destination. + """ + return cast( + EventDestination, + self._request( + "post", + "/v2/core/event_destinations/{id}/disable".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def disable_async( + self, + id: str, + params: "EventDestinationService.DisableParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Disable an event destination. + """ + return cast( + EventDestination, + await self._request_async( + "post", + "/v2/core/event_destinations/{id}/disable".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def enable( + self, + id: str, + params: "EventDestinationService.EnableParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Enable an event destination. + """ + return cast( + EventDestination, + self._request( + "post", + "/v2/core/event_destinations/{id}/enable".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def enable_async( + self, + id: str, + params: "EventDestinationService.EnableParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Enable an event destination. + """ + return cast( + EventDestination, + await self._request_async( + "post", + "/v2/core/event_destinations/{id}/enable".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "EventDestinationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[EventDestination]: + """ + Lists all event destinations. + """ + return cast( + ListObject[EventDestination], + self._request( + "get", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "EventDestinationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[EventDestination]: + """ + Lists all event destinations. + """ + return cast( + ListObject[EventDestination], + await self._request_async( + "get", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + + def ping( + self, + id: str, + params: "EventDestinationService.PingParams" = {}, + options: RequestOptions = {}, + ) -> Event: + """ + Send a `ping` event to an event destination. + """ + return cast( + Event, + self._request( + "post", + "/v2/core/event_destinations/{id}/ping".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def ping_async( + self, + id: str, + params: "EventDestinationService.PingParams" = {}, + options: RequestOptions = {}, + ) -> Event: + """ + Send a `ping` event to an event destination. + """ + return cast( + Event, + await self._request_async( + "post", + "/v2/core/event_destinations/{id}/ping".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "EventDestinationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Retrieves the details of an event destination. + """ + return cast( + EventDestination, + self._request( + "get", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "EventDestinationService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Retrieves the details of an event destination. + """ + return cast( + EventDestination, + await self._request_async( + "get", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: "EventDestinationService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Update the details of an event destination. + """ + return cast( + EventDestination, + self._request( + "post", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: "EventDestinationService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> EventDestination: + """ + Update the details of an event destination. + """ + return cast( + EventDestination, + await self._request_async( + "post", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/_event_service.py b/stripe/v2/core/_event_service.py index 999fe8471..712685824 100644 --- a/stripe/v2/core/_event_service.py +++ b/stripe/v2/core/_event_service.py @@ -21,7 +21,7 @@ class ListParams(TypedDict): """ page: NotRequired[str] """ - The requested page number. + The requested page. """ class RetrieveParams(TypedDict): diff --git a/tests/test_v2_event.py b/tests/test_v2_event.py index 9ffc910d9..32bd3fabb 100644 --- a/tests/test_v2_event.py +++ b/tests/test_v2_event.py @@ -5,6 +5,9 @@ import stripe from stripe import ThinEvent +from stripe.events._v1_billing_meter_error_report_triggered_event import ( + V1BillingMeterErrorReportTriggeredEvent, +) from tests.test_webhook import DUMMY_WEBHOOK_SECRET, generate_header EventParser = Callable[[str], ThinEvent] @@ -17,13 +20,13 @@ def v2_payload_no_data(self): { "id": "evt_234", "object": "v2.core.event", - "type": "financial_account.balance.opened", + "type": "v1.billing.meter.error_report_triggered", "livemode": True, "created": "2022-02-15T00:27:45.330Z", "related_object": { - "id": "fa_123", - "type": "financial_account", - "url": "/v2/financial_accounts/fa_123", + "id": "mtr_123", + "type": "billing.meter", + "url": "/v1/billing/meters/mtr_123", "stripe_context": "acct_123", }, "reason": { @@ -39,19 +42,19 @@ def v2_payload_with_data(self): { "id": "evt_234", "object": "v2.core.event", - "type": "financial_account.balance.opened", + "type": "v1.billing.meter.error_report_triggered", "livemode": False, "created": "2022-02-15T00:27:45.330Z", + "context": "acct_123", "related_object": { - "id": "fa_123", - "type": "financial_account", - "url": "/v2/financial_accounts/fa_123", - "stripe_context": "acct_123", + "id": "mtr_123", + "type": "billing.meter", + "url": "/v1/billing/meters/mtr_123", }, "data": { - "containing_compartment_id": "compid", - "id": "foo", - "type": "bufo", + "reason": { + "error_count": 1, + } }, } ) @@ -89,7 +92,7 @@ def test_parses_thin_event( assert event.id == "evt_234" assert event.related_object - assert event.related_object.id == "fa_123" + assert event.related_object.id == "mtr_123" assert event.reason assert event.reason.id == "foo" @@ -110,3 +113,34 @@ def test_validates_signature( stripe_client.parse_thin_event( v2_payload_no_data, "bad header", DUMMY_WEBHOOK_SECRET ) + + def test_v2_events_data_type(self, http_client_mock, v2_payload_with_data): + method = "get" + path = "/v2/core/events/evt_123" + http_client_mock.stub_request( + method, + path=path, + rbody=v2_payload_with_data, + rcode=200, + rheaders={}, + ) + client = stripe.StripeClient( + api_key="keyinfo_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + event = client.v2.core.events.retrieve("evt_123") + + http_client_mock.assert_requested( + method, + api_base=stripe.DEFAULT_API_BASE, + path=path, + api_key="keyinfo_test_123", + ) + assert event.id is not None + assert isinstance(event, V1BillingMeterErrorReportTriggeredEvent) + assert event.data is not None + assert isinstance( + event.data, + V1BillingMeterErrorReportTriggeredEvent.V1BillingMeterErrorReportTriggeredEventData, + ) + assert event.data.reason.error_count == 1