diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffa250852..b87e62c21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,6 +87,7 @@ jobs: - "3.11" - "3.12" - "3.13" + - "3.14" - "pypy-3.7" - "pypy-3.8" - "pypy-3.9" diff --git a/API_VERSION b/API_VERSION index e48768f4a..a06021491 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -3602014a6583f6c0fbfdde3c575839ac7d0b4e9c \ No newline at end of file +3602014a6583f6c0fbfdde3c575839ac7d0b4e9c diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c1ea8db7..4147d4b44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,27 +39,47 @@ * Add support for event notifications `V2PaymentsSettlementAllocationIntentSplitCanceledEvent`, `V2PaymentsSettlementAllocationIntentSplitCreatedEvent`, and `V2PaymentsSettlementAllocationIntentSplitSettledEvent` with related object `v2.payments.SettlementAllocationIntentSplit` * Remove support for error code `account_rate_limit_exceeded` on `RateLimitError` -## 14.1.0a4 - 2025-12-04 -* [#1691](https://github.com/stripe/stripe-python/pull/1691) Update generated code for private-preview - * Add support for event notifications `V2IamApiKeyCreatedEvent`, `V2IamApiKeyDefaultSecretRevealedEvent`, `V2IamApiKeyExpiredEvent`, `V2IamApiKeyPermissionsUpdatedEvent`, `V2IamApiKeyRotatedEvent`, and `V2IamApiKeyUpdatedEvent` -* [#1686](https://github.com/stripe/stripe-python/pull/1686) Update generated code for private-preview - * Add support for `check_scanning` on `AccountSession.Component` - * Add support for `client` on `V2.Core.Event.Reason.Request` - * Add support for `stripe_balance_payment` on `V2.MoneyManagement.ReceivedCredit` and `V2.MoneyManagement.ReceivedDebit` - * Add support for new value `stripe_balance_payment` on enum `V2.MoneyManagement.ReceivedCredit.type` - * Add support for `balance_transfer` on `V2.MoneyManagement.ReceivedDebit` - * Add support for new values `balance_transfer` and `stripe_balance_payment` on enum `V2.MoneyManagement.ReceivedDebit.type` - * Add support for `include` on `v2.core.EventListParams` and `v2.core.EventRetrieveParams` +## 14.1.0 - 2025-12-16 +This release changes the pinned API version to `2025-12-15.clover`. -## 14.1.0a3 - 2025-11-24 -* [#1685](https://github.com/stripe/stripe-python/pull/1685) Update generated code for private-preview - * Add support for new resource `product_catalog.TrialOffer` - * Add support for `create` method on resource `product_catalog.TrialOffer` - * Remove support for `amount_subtotal_after_discount` on `DelegatedCheckout.RequestedSession.LineItemDetail` and `DelegatedCheckout.RequestedSession.TotalDetail` - * Remove support for `amount_total`, `unit_amount_after_discount`, and `unit_discount` on `DelegatedCheckout.RequestedSession.LineItemDetail` - * Add support for `amount_cart_discount` and `amount_items_discount` on `DelegatedCheckout.RequestedSession.TotalDetail` - * Remove support for `amount_discount` on `DelegatedCheckout.RequestedSession.TotalDetail` - * Add support for `payments_orchestration` on `PaymentIntentCreateParams` and `PaymentIntent` +* [#1696](https://github.com/stripe/stripe-python/pull/1696) Update generated code + * Add support for new resources `v2.core.AccountLink`, `v2.core.AccountPersonToken`, `v2.core.AccountPerson`, `v2.core.AccountToken`, and `v2.core.Account` + * Add support for `create` and `retrieve` methods on resources `v2.core.AccountPersonToken` and `v2.core.AccountToken` + * Add support for `create` method on resource `v2.core.AccountLink` + * Add support for `close`, `create`, `list`, `modify`, and `retrieve` methods on resource `v2.core.Account` + * Add support for `create`, `delete`, `list`, `modify`, and `retrieve` methods on resource `v2.core.AccountPerson` + * Add support for `customer_account` on `Billing.CreditBalanceSummary`, `Billing.CreditGrant`, `BillingPortal.Session`, `CashBalance`, `Checkout.Session`, `ConfirmationToken.PaymentMethodPreview`, `CreditNoteListParams`, `CreditNote`, `CustomerBalanceTransaction`, `CustomerCashBalanceTransaction`, `CustomerSessionCreateParams`, `CustomerSession`, `Customer`, `Discount`, `FinancialConnections.Account.AccountHolder`, `FinancialConnections.Session.AccountHolder`, `InvoiceCreateParams`, `InvoiceCreatePreviewParams`, `InvoiceItemCreateParams`, `InvoiceItemListParams`, `InvoiceItem`, `InvoiceListParams`, `Invoice`, `PaymentIntentCreateParams`, `PaymentIntentListParams`, `PaymentIntentModifyParams`, `PaymentIntent`, `PaymentMethodAttachParams`, `PaymentMethodListParams`, `PaymentMethod`, `PromotionCodeCreateParams`, `PromotionCodeListParams`, `PromotionCode`, `QuoteCreateParams`, `QuoteListParams`, `QuoteModifyParams`, `Quote`, `SetupAttempt`, `SetupIntentCreateParams`, `SetupIntentListParams`, `SetupIntentModifyParams`, `SetupIntent`, `SubscriptionCreateParams`, `SubscriptionListParams`, `SubscriptionScheduleCreateParams`, `SubscriptionScheduleListParams`, `SubscriptionSchedule`, `Subscription`, `TaxId.Owner`, `TaxIdCreateParamsOwner`, `TaxIdListParamsOwner`, `TaxId`, `billing.CreditBalanceSummaryRetrieveParams`, `billing.CreditBalanceTransactionListParams`, `billing.CreditGrantCreateParams`, `billing.CreditGrantListParams`, `billing_portal.SessionCreateParams`, `checkout.SessionCreateParams`, `checkout.SessionListParams`, `financial_connections.AccountListParamsAccountHolder`, and `financial_connections.SessionCreateParamsAccountHolder` + * Add support for `metadata` on `LineItem` and `checkout.SessionCreateParamsLineItem` + * Add support for `payto_payments` on `Account.Capability`, `AccountCreateParamsCapability`, and `AccountModifyParamsCapability` + * Add support for `signer` on `AccountCreateParamsDocumentProofOfRegistration`, `AccountCreateParamsDocumentProofOfUltimateBeneficialOwnership`, `AccountModifyParamsDocumentProofOfRegistration`, and `AccountModifyParamsDocumentProofOfUltimateBeneficialOwnership` + * Change `CustomerSessionCreateParams.customer`, `InvoiceItemCreateParams.customer`, `PaymentMethodAttachParams.customer`, `SubscriptionCreateParams.customer`, `billing.CreditBalanceSummaryRetrieveParams.customer`, `billing.CreditBalanceTransactionListParams.customer`, `billing.CreditGrantCreateParams.customer`, and `billing_portal.SessionCreateParams.customer` to be optional + * Add support for `billing_cycle_anchor` on `BillingPortal.Configuration.Feature.SubscriptionUpdate`, `billing_portal.ConfigurationCreateParamsFeatureSubscriptionUpdate`, and `billing_portal.ConfigurationModifyParamsFeatureSubscriptionUpdate` + * Add support for `payto` on `Charge.PaymentMethodDetail`, `Checkout.Session.PaymentMethodOption`, `ConfirmationToken.PaymentMethodPreview`, `ConfirmationTokenCreateParamsPaymentMethodDatum`, `Invoice.PaymentSetting.PaymentMethodOption`, `InvoiceCreateParamsPaymentSettingPaymentMethodOption`, `InvoiceModifyParamsPaymentSettingPaymentMethodOption`, `Mandate.PaymentMethodDetail`, `PaymentAttemptRecord.PaymentMethodDetail`, `PaymentIntent.PaymentMethodOption`, `PaymentIntentConfirmParamsPaymentMethodDatum`, `PaymentIntentConfirmParamsPaymentMethodOption`, `PaymentIntentCreateParamsPaymentMethodDatum`, `PaymentIntentCreateParamsPaymentMethodOption`, `PaymentIntentModifyParamsPaymentMethodDatum`, `PaymentIntentModifyParamsPaymentMethodOption`, `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationModifyParams`, `PaymentMethodConfiguration`, `PaymentMethodCreateParams`, `PaymentMethodModifyParams`, `PaymentMethod`, `PaymentRecord.PaymentMethodDetail`, `SetupAttempt.PaymentMethodDetail`, `SetupIntent.PaymentMethodOption`, `SetupIntentConfirmParamsPaymentMethodDatum`, `SetupIntentConfirmParamsPaymentMethodOption`, `SetupIntentCreateParamsPaymentMethodDatum`, `SetupIntentCreateParamsPaymentMethodOption`, `SetupIntentModifyParamsPaymentMethodDatum`, `SetupIntentModifyParamsPaymentMethodOption`, `Subscription.PaymentSetting.PaymentMethodOption`, `SubscriptionCreateParamsPaymentSettingPaymentMethodOption`, `SubscriptionModifyParamsPaymentSettingPaymentMethodOption`, and `checkout.SessionCreateParamsPaymentMethodOption` + * Add support for `expected_debit_date` on `Charge.PaymentMethodDetail.AcssDebit`, `Charge.PaymentMethodDetail.AuBecsDebit`, `Charge.PaymentMethodDetail.BacsDebit`, `Charge.PaymentMethodDetail.NzBankAccount`, `Charge.PaymentMethodDetail.SepaDebit`, `Charge.PaymentMethodDetail.UsBankAccount`, `PaymentAttemptRecord.PaymentMethodDetail.AcssDebit`, `PaymentAttemptRecord.PaymentMethodDetail.AuBecsDebit`, `PaymentAttemptRecord.PaymentMethodDetail.BacsDebit`, `PaymentAttemptRecord.PaymentMethodDetail.NzBankAccount`, `PaymentAttemptRecord.PaymentMethodDetail.SepaDebit`, `PaymentAttemptRecord.PaymentMethodDetail.UsBankAccount`, `PaymentRecord.PaymentMethodDetail.AcssDebit`, `PaymentRecord.PaymentMethodDetail.AuBecsDebit`, `PaymentRecord.PaymentMethodDetail.BacsDebit`, `PaymentRecord.PaymentMethodDetail.NzBankAccount`, `PaymentRecord.PaymentMethodDetail.SepaDebit`, and `PaymentRecord.PaymentMethodDetail.UsBankAccount` + * Add support for new value `mollie` on enums `Charge.PaymentMethodDetail.Ideal.bank`, `ConfirmationToken.PaymentMethodPreview.Ideal.bank`, `ConfirmationTokenCreateParamsPaymentMethodDatumIdeal.bank`, `PaymentAttemptRecord.PaymentMethodDetail.Ideal.bank`, `PaymentIntentConfirmParamsPaymentMethodDatumIdeal.bank`, `PaymentIntentCreateParamsPaymentMethodDatumIdeal.bank`, `PaymentIntentModifyParamsPaymentMethodDatumIdeal.bank`, `PaymentMethod.Ideal.bank`, `PaymentMethodCreateParamsIdeal.bank`, `PaymentRecord.PaymentMethodDetail.Ideal.bank`, `SetupAttempt.PaymentMethodDetail.Ideal.bank`, `SetupIntentConfirmParamsPaymentMethodDatumIdeal.bank`, `SetupIntentCreateParamsPaymentMethodDatumIdeal.bank`, and `SetupIntentModifyParamsPaymentMethodDatumIdeal.bank` + * Add support for new value `MLLENL2A` on enums `Charge.PaymentMethodDetail.Ideal.bic`, `ConfirmationToken.PaymentMethodPreview.Ideal.bic`, `PaymentAttemptRecord.PaymentMethodDetail.Ideal.bic`, `PaymentMethod.Ideal.bic`, `PaymentRecord.PaymentMethodDetail.Ideal.bic`, and `SetupAttempt.PaymentMethodDetail.Ideal.bic` + * Add support for new value `payto` on enums `PaymentIntent.excluded_payment_method_types`, `PaymentIntentConfirmParams.excluded_payment_method_types`, `PaymentIntentCreateParams.excluded_payment_method_types`, `PaymentIntentModifyParams.excluded_payment_method_types`, `SetupIntent.excluded_payment_method_types`, `SetupIntentCreateParams.excluded_payment_method_types`, `SetupIntentModifyParams.excluded_payment_method_types`, and `checkout.SessionCreateParams.excluded_payment_method_types` + * Add support for new value `payto` on enum `checkout.SessionCreateParams.payment_method_types` + * Add support for `line_items` on `checkout.SessionModifyParams` + * Add support for new value `payto` on enums `ConfirmationTokenCreateParamsPaymentMethodDatum.type`, `PaymentIntentConfirmParamsPaymentMethodDatum.type`, `PaymentIntentCreateParamsPaymentMethodDatum.type`, `PaymentIntentModifyParamsPaymentMethodDatum.type`, `SetupIntentConfirmParamsPaymentMethodDatum.type`, `SetupIntentCreateParamsPaymentMethodDatum.type`, and `SetupIntentModifyParamsPaymentMethodDatum.type` + * Add support for new value `payto` on enums `ConfirmationToken.PaymentMethodPreview.type` and `PaymentMethod.type` + * Add support for new value `payto` on enums `CustomerListPaymentMethodsParams.type`, `PaymentMethodCreateParams.type`, and `PaymentMethodListParams.type` + * Add support for `invoice` on `CustomerListCustomerBalanceTransactionParams` + * Add support for `related_customer_account` on `Identity.VerificationSession`, `identity.VerificationSessionCreateParams`, and `identity.VerificationSessionListParams` + * Change type of `InvoiceItem.Pricing.PriceDetail.price` and `InvoiceLineItem.Pricing.PriceDetail.price` from `string` to `expandable($Price)` + * Add support for new value `payto` on enums `Invoice.PaymentSetting.payment_method_types`, `InvoiceCreateParamsPaymentSetting.payment_method_types`, `InvoiceModifyParamsPaymentSetting.payment_method_types`, `Subscription.PaymentSetting.payment_method_types`, `SubscriptionCreateParamsPaymentSetting.payment_method_types`, and `SubscriptionModifyParamsPaymentSetting.payment_method_types` + * Add support for `subtotal` on `InvoiceLineItem` + * Add support for `authorization_code`, `description`, `iin`, `installments`, `issuer`, `network_advice_code`, `network_decline_code`, and `stored_credential_usage` on `PaymentAttemptRecord.PaymentMethodDetail.Card` and `PaymentRecord.PaymentMethodDetail.Card` + * Change `PaymentIntent.transfer_data` to be optional + * Add support for new value `payto` on enums `PaymentLink.payment_method_types`, `PaymentLinkCreateParams.payment_method_types`, and `PaymentLinkModifyParams.payment_method_types` + * Add support for `allow_redisplay` on `PaymentMethodListParams` + * Add support for `reported_by` on `PaymentRecord` + * Change `Product.tax_code` to be optional + * Add support for new values `2025-12-15.clover` and `2026-01-28.clover` on enum `WebhookEndpointCreateParams.api_version` + * Add support for `changes` on `V2.Core.Event` + * Add support for error code `account_token_required_for_v2_account` on `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `SetupAttempt.SetupError`, `SetupIntent.LastSetupError`, and `StripeError` +* [#1692](https://github.com/stripe/stripe-python/pull/1692) Updated bundled CA certificates +* [#1676](https://github.com/stripe/stripe-python/pull/1676) Add create_async method to EphemeralKey ## 14.1.0b1 - 2025-11-18 This release changes the pinned API version to `2025-11-17.preview`. @@ -96,6 +116,28 @@ This release changes the pinned API version to `2025-11-17.preview`. * Add support for thin event `V2CoreHealthEventGenerationFailureResolvedEvent` * Remove support for thin events `V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent`, `V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent`, `V2PaymentsOffSessionPaymentCanceledEvent`, `V2PaymentsOffSessionPaymentCreatedEvent`, `V2PaymentsOffSessionPaymentFailedEvent`, `V2PaymentsOffSessionPaymentRequiresCaptureEvent`, and `V2PaymentsOffSessionPaymentSucceededEvent` with related object `v2.payments.OffSessionPayment` +## 14.1.0a4 - 2025-12-04 +* [#1691](https://github.com/stripe/stripe-python/pull/1691) Update generated code for private-preview + * Add support for event notifications `V2IamApiKeyCreatedEvent`, `V2IamApiKeyDefaultSecretRevealedEvent`, `V2IamApiKeyExpiredEvent`, `V2IamApiKeyPermissionsUpdatedEvent`, `V2IamApiKeyRotatedEvent`, and `V2IamApiKeyUpdatedEvent` +* [#1686](https://github.com/stripe/stripe-python/pull/1686) Update generated code for private-preview + * Add support for `check_scanning` on `AccountSession.Component` + * Add support for `client` on `V2.Core.Event.Reason.Request` + * Add support for `stripe_balance_payment` on `V2.MoneyManagement.ReceivedCredit` and `V2.MoneyManagement.ReceivedDebit` + * Add support for new value `stripe_balance_payment` on enum `V2.MoneyManagement.ReceivedCredit.type` + * Add support for `balance_transfer` on `V2.MoneyManagement.ReceivedDebit` + * Add support for new values `balance_transfer` and `stripe_balance_payment` on enum `V2.MoneyManagement.ReceivedDebit.type` + * Add support for `include` on `v2.core.EventListParams` and `v2.core.EventRetrieveParams` + +## 14.1.0a3 - 2025-11-24 +* [#1685](https://github.com/stripe/stripe-python/pull/1685) Update generated code for private-preview + * Add support for new resource `product_catalog.TrialOffer` + * Add support for `create` method on resource `product_catalog.TrialOffer` + * Remove support for `amount_subtotal_after_discount` on `DelegatedCheckout.RequestedSession.LineItemDetail` and `DelegatedCheckout.RequestedSession.TotalDetail` + * Remove support for `amount_total`, `unit_amount_after_discount`, and `unit_discount` on `DelegatedCheckout.RequestedSession.LineItemDetail` + * Add support for `amount_cart_discount` and `amount_items_discount` on `DelegatedCheckout.RequestedSession.TotalDetail` + * Remove support for `amount_discount` on `DelegatedCheckout.RequestedSession.TotalDetail` + * Add support for `payments_orchestration` on `PaymentIntentCreateParams` and `PaymentIntent` + ## 14.1.0a2 - 2025-11-20 This release changes the pinned API version to `2025-11-17.preview`. @@ -245,7 +287,7 @@ This release changes the pinned API version to `2025-11-17.preview`. ## 14.0.1 - 2025-11-21 * [#1684](https://github.com/stripe/stripe-python/pull/1684) Update generated code - * `stripe.error` module is now accessible globally. Fixes [#1682](https://github.com/stripe/stripe-python/issues/1682) + * `stripe.error` module is now accessible globally. Fixes [#1682](https://github.com/stripe/stripe-python/issues/1682) * [#1681](https://github.com/stripe/stripe-python/pull/1681) Throw a specific error when accessing `payment_intent` property on `Invoice` object to ease debugging. ## 14.0.0 - 2025-11-18 diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 4e4ca8e5b..2adc4cb8c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2141 \ No newline at end of file +v2141 diff --git a/stripe/_charge.py b/stripe/_charge.py index 2e6392ac3..f3d100d68 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1895,6 +1895,24 @@ class Payto(StripeObject): The PayID alias for the bank account. """ + class Payto(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + pay_id: Optional[str] + """ + The PayID alias for the bank account. + """ + class Pix(StripeObject): bank_transaction_id: Optional[str] """ diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 543bec0eb..fe5b51b75 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -1301,6 +1301,20 @@ class Payto(StripeObject): The PayID alias for the bank account. """ + class Payto(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + pay_id: Optional[str] + """ + The PayID alias for the bank account. + """ + class Pix(StripeObject): pass diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 9639a3400..d2d8535a0 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -165,7 +165,7 @@ class LicenseFeeDetails(StripeObject): """ class PriceDetails(StripeObject): - price: str + price: ExpandableField["Price"] """ The ID of the price this item is associated with. """ diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 53b0de24b..10964290f 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -262,7 +262,7 @@ class LicenseFeeDetails(StripeObject): """ class PriceDetails(StripeObject): - price: str + price: ExpandableField["Price"] """ The ID of the price this item is associated with. """ diff --git a/stripe/_mandate.py b/stripe/_mandate.py index cbc41da01..8c87092ea 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -238,6 +238,59 @@ class Pix(StripeObject): Start date of the mandate, in `YYYY-MM-DD`. """ + class Payto(StripeObject): + amount: Optional[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: Literal["fixed", "maximum"] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: Optional[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: Optional[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: Optional[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + start_date: Optional[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ + class RevolutPay(StripeObject): pass diff --git a/stripe/_payment_attempt_record.py b/stripe/_payment_attempt_record.py index 894acec32..98b34056a 100644 --- a/stripe/_payment_attempt_record.py +++ b/stripe/_payment_attempt_record.py @@ -1610,6 +1610,24 @@ class Payto(StripeObject): The PayID alias for the bank account. """ + class Payto(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + pay_id: Optional[str] + """ + The PayID alias for the bank account. + """ + class Pix(StripeObject): bank_transaction_id: Optional[str] """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index a02f45746..f3e99e04f 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -148,7 +148,7 @@ class Tip(StripeObject): """ line_items: Optional[ListObject["PaymentIntentAmountDetailsLineItem"]] """ - A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 100 line items. + A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 200 line items. """ shipping: Optional[Shipping] tax: Optional[Tax] @@ -2853,6 +2853,71 @@ class MandateOptions(StripeObject): """ _inner_class_types = {"mandate_options": MandateOptions} + class Payto(StripeObject): + class MandateOptions(StripeObject): + amount: Optional[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: Optional[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: Optional[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: Optional[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: Optional[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: Optional[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + + mandate_options: Optional[MandateOptions] + 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://docs.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://docs.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://docs.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://docs.stripe.com/strong-customer-authentication). + """ + _inner_class_types = {"mandate_options": MandateOptions} + class Pix(StripeObject): class MandateOptions(StripeObject): amount: Optional[int] diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 73767de8e..cf61adbdb 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1275,6 +1275,20 @@ class Payto(StripeObject): The PayID alias for the bank account. """ + class Payto(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + pay_id: Optional[str] + """ + The PayID alias for the bank account. + """ + class Pix(StripeObject): pass diff --git a/stripe/_payment_record.py b/stripe/_payment_record.py index fbf12dc78..ffb93bbac 100644 --- a/stripe/_payment_record.py +++ b/stripe/_payment_record.py @@ -1626,6 +1626,24 @@ class Payto(StripeObject): The PayID alias for the bank account. """ + class Payto(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + pay_id: Optional[str] + """ + The PayID alias for the bank account. + """ + class Pix(StripeObject): bank_transaction_id: Optional[str] """ diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index a13782815..e1b7ffb6d 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -749,6 +749,65 @@ class MandateOptions(StripeObject): mandate_options: Optional[MandateOptions] _inner_class_types = {"mandate_options": MandateOptions} + class Payto(StripeObject): + class MandateOptions(StripeObject): + amount: Optional[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: Optional[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: Optional[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: Optional[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: Optional[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: Optional[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + start_date: Optional[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ + + mandate_options: Optional[MandateOptions] + _inner_class_types = {"mandate_options": MandateOptions} + class SepaDebit(StripeObject): class MandateOptions(StripeObject): reference_prefix: Optional[str] diff --git a/stripe/params/_payment_intent_capture_params.py b/stripe/params/_payment_intent_capture_params.py index e6a4a2e67..0996155e8 100644 --- a/stripe/params/_payment_intent_capture_params.py +++ b/stripe/params/_payment_intent_capture_params.py @@ -68,7 +68,7 @@ class PaymentIntentCaptureParamsAmountDetails(TypedDict): "Literal['']|List[PaymentIntentCaptureParamsAmountDetailsLineItem]" ] """ - A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 100 line items. + A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 200 line items. """ shipping: NotRequired[ "Literal['']|PaymentIntentCaptureParamsAmountDetailsShipping" diff --git a/stripe/params/_payment_intent_confirm_params.py b/stripe/params/_payment_intent_confirm_params.py index a8858dd3f..da28ee7db 100644 --- a/stripe/params/_payment_intent_confirm_params.py +++ b/stripe/params/_payment_intent_confirm_params.py @@ -154,7 +154,7 @@ class PaymentIntentConfirmParamsAmountDetails(TypedDict): "Literal['']|List[PaymentIntentConfirmParamsAmountDetailsLineItem]" ] """ - A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 100 line items. + A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 200 line items. """ shipping: NotRequired[ "Literal['']|PaymentIntentConfirmParamsAmountDetailsShipping" @@ -6090,6 +6090,62 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions( """ +class PaymentIntentConfirmParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` + """ + setup_future_usage: NotRequired[ + "Literal['']|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://docs.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://docs.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://docs.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://docs.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 PaymentIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions( + TypedDict, +): + amount: NotRequired["Literal['']|int"] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: NotRequired["Literal['']|int"] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + + class PaymentIntentConfirmParamsPaymentMethodOptionsPix(TypedDict): amount_includes_iof: NotRequired[Literal["always", "never"]] """ diff --git a/stripe/params/_payment_intent_create_params.py b/stripe/params/_payment_intent_create_params.py index 192a4ffeb..7b5f3a585 100644 --- a/stripe/params/_payment_intent_create_params.py +++ b/stripe/params/_payment_intent_create_params.py @@ -292,7 +292,7 @@ class PaymentIntentCreateParamsAmountDetails(TypedDict): "Literal['']|List[PaymentIntentCreateParamsAmountDetailsLineItem]" ] """ - A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 100 line items. + A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 200 line items. """ shipping: NotRequired[ "Literal['']|PaymentIntentCreateParamsAmountDetailsShipping" @@ -6213,6 +6213,62 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions( """ +class PaymentIntentCreateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` + """ + setup_future_usage: NotRequired[ + "Literal['']|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://docs.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://docs.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://docs.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://docs.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 PaymentIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions( + TypedDict, +): + amount: NotRequired["Literal['']|int"] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: NotRequired["Literal['']|int"] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + + class PaymentIntentCreateParamsPaymentMethodOptionsPix(TypedDict): amount_includes_iof: NotRequired[Literal["always", "never"]] """ diff --git a/stripe/params/_payment_intent_increment_authorization_params.py b/stripe/params/_payment_intent_increment_authorization_params.py index 3bbd5982b..a8fbb7b9a 100644 --- a/stripe/params/_payment_intent_increment_authorization_params.py +++ b/stripe/params/_payment_intent_increment_authorization_params.py @@ -72,7 +72,7 @@ class PaymentIntentIncrementAuthorizationParamsAmountDetails(TypedDict): "Literal['']|List[PaymentIntentIncrementAuthorizationParamsAmountDetailsLineItem]" ] """ - A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 100 line items. + A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 200 line items. """ shipping: NotRequired[ "Literal['']|PaymentIntentIncrementAuthorizationParamsAmountDetailsShipping" diff --git a/stripe/params/_payment_intent_modify_params.py b/stripe/params/_payment_intent_modify_params.py index 2d2afa5ab..76be8dfe0 100644 --- a/stripe/params/_payment_intent_modify_params.py +++ b/stripe/params/_payment_intent_modify_params.py @@ -169,7 +169,7 @@ class PaymentIntentModifyParamsAmountDetails(TypedDict): "Literal['']|List[PaymentIntentModifyParamsAmountDetailsLineItem]" ] """ - A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 100 line items. + A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 200 line items. """ shipping: NotRequired[ "Literal['']|PaymentIntentModifyParamsAmountDetailsShipping" @@ -6061,6 +6061,62 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions( """ +class PaymentIntentModifyParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` + """ + setup_future_usage: NotRequired[ + "Literal['']|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://docs.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://docs.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://docs.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://docs.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 PaymentIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions( + TypedDict, +): + amount: NotRequired["Literal['']|int"] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: NotRequired["Literal['']|int"] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + + class PaymentIntentModifyParamsPaymentMethodOptionsPix(TypedDict): amount_includes_iof: NotRequired[Literal["always", "never"]] """ diff --git a/stripe/params/_payment_intent_update_params.py b/stripe/params/_payment_intent_update_params.py index 1a68fd31a..07ffe155e 100644 --- a/stripe/params/_payment_intent_update_params.py +++ b/stripe/params/_payment_intent_update_params.py @@ -168,7 +168,7 @@ class PaymentIntentUpdateParamsAmountDetails(TypedDict): "Literal['']|List[PaymentIntentUpdateParamsAmountDetailsLineItem]" ] """ - A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 100 line items. + A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 200 line items. """ shipping: NotRequired[ "Literal['']|PaymentIntentUpdateParamsAmountDetailsShipping" @@ -6060,6 +6060,62 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions( """ +class PaymentIntentUpdateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` + """ + setup_future_usage: NotRequired[ + "Literal['']|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://docs.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://docs.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://docs.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://docs.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 PaymentIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions( + TypedDict, +): + amount: NotRequired["Literal['']|int"] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: NotRequired["Literal['']|int"] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + + class PaymentIntentUpdateParamsPaymentMethodOptionsPix(TypedDict): amount_includes_iof: NotRequired[Literal["always", "never"]] """ diff --git a/stripe/params/_setup_intent_confirm_params.py b/stripe/params/_setup_intent_confirm_params.py index bb064441e..fe0a6a486 100644 --- a/stripe/params/_setup_intent_confirm_params.py +++ b/stripe/params/_setup_intent_confirm_params.py @@ -1545,6 +1545,52 @@ class SetupIntentConfirmParamsPaymentMethodOptionsPixMandateOptions(TypedDict): """ +class SetupIntentConfirmParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SetupIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. + """ + + +class SetupIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions( + TypedDict, +): + amount: NotRequired["Literal['']|int"] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: NotRequired["Literal['']|int"] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + start_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ + + class SetupIntentConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "SetupIntentConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions" diff --git a/stripe/params/_setup_intent_create_params.py b/stripe/params/_setup_intent_create_params.py index 2ec3611c0..3891a01a1 100644 --- a/stripe/params/_setup_intent_create_params.py +++ b/stripe/params/_setup_intent_create_params.py @@ -1672,6 +1672,52 @@ class SetupIntentCreateParamsPaymentMethodOptionsPixMandateOptions(TypedDict): """ +class SetupIntentCreateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SetupIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. + """ + + +class SetupIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions( + TypedDict +): + amount: NotRequired["Literal['']|int"] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: NotRequired["Literal['']|int"] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + start_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ + + class SetupIntentCreateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "SetupIntentCreateParamsPaymentMethodOptionsSepaDebitMandateOptions" diff --git a/stripe/params/_setup_intent_modify_params.py b/stripe/params/_setup_intent_modify_params.py index 29077eac6..a19d4941f 100644 --- a/stripe/params/_setup_intent_modify_params.py +++ b/stripe/params/_setup_intent_modify_params.py @@ -1513,6 +1513,52 @@ class SetupIntentModifyParamsPaymentMethodOptionsPixMandateOptions(TypedDict): """ +class SetupIntentModifyParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SetupIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. + """ + + +class SetupIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions( + TypedDict +): + amount: NotRequired["Literal['']|int"] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: NotRequired["Literal['']|int"] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + start_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ + + class SetupIntentModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "SetupIntentModifyParamsPaymentMethodOptionsSepaDebitMandateOptions" diff --git a/stripe/params/_setup_intent_update_params.py b/stripe/params/_setup_intent_update_params.py index c48fb66ec..79eb0a665 100644 --- a/stripe/params/_setup_intent_update_params.py +++ b/stripe/params/_setup_intent_update_params.py @@ -1512,6 +1512,52 @@ class SetupIntentUpdateParamsPaymentMethodOptionsPixMandateOptions(TypedDict): """ +class SetupIntentUpdateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SetupIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. + """ + + +class SetupIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions( + TypedDict +): + amount: NotRequired["Literal['']|int"] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: NotRequired["Literal['']|int"] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + start_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ + + class SetupIntentUpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "SetupIntentUpdateParamsPaymentMethodOptionsSepaDebitMandateOptions" diff --git a/stripe/params/checkout/_session_create_params.py b/stripe/params/checkout/_session_create_params.py index 5b565925a..6a1316c9c 100644 --- a/stripe/params/checkout/_session_create_params.py +++ b/stripe/params/checkout/_session_create_params.py @@ -2259,6 +2259,60 @@ class SessionCreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): """ +class SessionCreateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SessionCreateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + 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://docs.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://docs.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://docs.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://docs.stripe.com/strong-customer-authentication). + """ + + +class SessionCreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired["Literal['']|int"] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. + """ + end_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + ] + """ + The periodicity at which payments will be collected. Defaults to `adhoc`. + """ + payments_per_period: NotRequired["Literal['']|int"] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + ] + """ + The purpose for which payments are made. Has a default value based on your merchant category code. + """ + start_date: NotRequired["Literal['']|str"] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ + + class SessionCreateParamsPaymentMethodOptionsPix(TypedDict): amount_includes_iof: NotRequired[Literal["always", "never"]] """ diff --git a/tests/test_integration.py b/tests/test_integration.py index a84ddf1c6..cc558a4b9 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -335,7 +335,6 @@ def do_request(self, req_num): usage = telemetry["last_request_metrics"]["usage"] assert usage == ["stripe_client", "async"] - @pytest.mark.anyio @pytest.fixture(params=["aiohttp", "httpx"]) async def async_http_client(self, request, anyio_backend): if request.param == "httpx":