From 0085a0d223745553f0009e9a5a7a7c2a722c82df Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2026 12:12:34 -0700 Subject: [PATCH] Update generated code (#2170) * Update generated code for v2189 and * Update generated code for v2189 and * Update generated code for v2202 and * Update generated code for v2202 and * Update generated code for v2203 and * Update generated code for v2204 and * Update generated code for v2204 and --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: David Brownman Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/ApiVersion.java | 4 +- .../com/stripe/exception/StripeException.java | 3 + src/main/java/com/stripe/model/Account.java | 15 +- .../java/com/stripe/model/AccountSession.java | 4 +- .../java/com/stripe/model/ApplePayDomain.java | 4 +- .../java/com/stripe/model/ApplicationFee.java | 4 +- src/main/java/com/stripe/model/Balance.java | 4 +- .../java/com/stripe/model/CashBalance.java | 4 +- src/main/java/com/stripe/model/Charge.java | 23 +- .../com/stripe/model/ConfirmationToken.java | 22 +- .../model/ConnectCollectionTransfer.java | 4 +- src/main/java/com/stripe/model/Coupon.java | 6 +- .../java/com/stripe/model/CreditNote.java | 4 +- .../com/stripe/model/CreditNoteLineItem.java | 13 +- src/main/java/com/stripe/model/Customer.java | 4 +- .../model/CustomerBalanceTransaction.java | 4 +- .../model/CustomerCashBalanceTransaction.java | 4 +- .../com/stripe/model/CustomerSession.java | 4 +- src/main/java/com/stripe/model/Dispute.java | 4 +- .../java/com/stripe/model/EphemeralKey.java | 4 +- src/main/java/com/stripe/model/Event.java | 4 +- src/main/java/com/stripe/model/FileLink.java | 4 +- .../com/stripe/model/FundingInstructions.java | 4 +- src/main/java/com/stripe/model/Invoice.java | 80 +-- .../java/com/stripe/model/InvoiceItem.java | 17 +- .../com/stripe/model/InvoiceLineItem.java | 18 +- .../java/com/stripe/model/InvoicePayment.java | 4 +- .../model/InvoiceRenderingTemplate.java | 4 +- src/main/java/com/stripe/model/Mandate.java | 38 +- .../stripe/model/PaymentAttemptRecord.java | 55 +- .../java/com/stripe/model/PaymentIntent.java | 132 +++- .../java/com/stripe/model/PaymentLink.java | 4 +- .../java/com/stripe/model/PaymentMethod.java | 25 +- .../model/PaymentMethodConfiguration.java | 59 +- .../com/stripe/model/PaymentMethodDomain.java | 4 +- .../java/com/stripe/model/PaymentRecord.java | 55 +- .../stripe/model/PaymentSourceCollection.java | 16 +- src/main/java/com/stripe/model/Payout.java | 20 +- src/main/java/com/stripe/model/Plan.java | 4 +- src/main/java/com/stripe/model/Price.java | 4 +- src/main/java/com/stripe/model/Product.java | 4 +- .../java/com/stripe/model/ProductFeature.java | 4 +- .../java/com/stripe/model/PromotionCode.java | 4 +- src/main/java/com/stripe/model/Quote.java | 4 +- src/main/java/com/stripe/model/Review.java | 4 +- .../java/com/stripe/model/SetupAttempt.java | 16 +- .../java/com/stripe/model/SetupIntent.java | 99 ++- .../java/com/stripe/model/ShippingRate.java | 4 +- src/main/java/com/stripe/model/Source.java | 4 +- .../model/SourceMandateNotification.java | 4 +- .../com/stripe/model/SourceTransaction.java | 4 +- .../java/com/stripe/model/StripeError.java | 3 +- .../java/com/stripe/model/Subscription.java | 53 +- .../stripe/model/SubscriptionSchedule.java | 4 +- src/main/java/com/stripe/model/TaxId.java | 4 +- src/main/java/com/stripe/model/TaxRate.java | 4 +- src/main/java/com/stripe/model/Token.java | 4 +- src/main/java/com/stripe/model/Topup.java | 6 +- src/main/java/com/stripe/model/Transfer.java | 4 +- .../com/stripe/model/WebhookEndpoint.java | 4 +- .../java/com/stripe/model/apps/Secret.java | 4 +- .../java/com/stripe/model/billing/Alert.java | 4 +- .../stripe/model/billing/AlertTriggered.java | 4 +- .../model/billing/CreditBalanceSummary.java | 4 +- .../billing/CreditBalanceTransaction.java | 4 +- .../com/stripe/model/billing/CreditGrant.java | 4 +- .../java/com/stripe/model/billing/Meter.java | 4 +- .../com/stripe/model/billing/MeterEvent.java | 4 +- .../model/billing/MeterEventAdjustment.java | 4 +- .../model/billing/MeterEventSummary.java | 4 +- .../model/billingportal/Configuration.java | 4 +- .../stripe/model/billingportal/Session.java | 4 +- .../com/stripe/model/checkout/Session.java | 89 ++- .../com/stripe/model/climate/Supplier.java | 4 +- .../model/entitlements/ActiveEntitlement.java | 4 +- .../ActiveEntitlementSummary.java | 4 +- .../stripe/model/entitlements/Feature.java | 4 +- .../model/financialconnections/Account.java | 4 +- .../model/financialconnections/Session.java | 4 +- .../financialconnections/Transaction.java | 4 +- .../com/stripe/model/forwarding/Request.java | 4 +- .../model/identity/VerificationReport.java | 4 +- .../model/identity/VerificationSession.java | 4 +- .../stripe/model/issuing/Authorization.java | 4 +- .../java/com/stripe/model/issuing/Card.java | 42 +- .../com/stripe/model/issuing/Cardholder.java | 4 +- .../com/stripe/model/issuing/Dispute.java | 4 +- .../model/issuing/PersonalizationDesign.java | 4 +- .../stripe/model/issuing/PhysicalBundle.java | 4 +- .../java/com/stripe/model/issuing/Token.java | 4 +- .../com/stripe/model/issuing/Transaction.java | 4 +- .../stripe/model/radar/EarlyFraudWarning.java | 4 +- .../stripe/model/radar/PaymentEvaluation.java | 96 +-- .../com/stripe/model/radar/ValueList.java | 9 +- .../com/stripe/model/radar/ValueListItem.java | 4 +- .../stripe/model/reporting/ReportType.java | 4 +- .../java/com/stripe/model/reserve/Hold.java | 4 +- .../java/com/stripe/model/reserve/Plan.java | 4 +- .../com/stripe/model/reserve/Release.java | 4 +- .../stripe/model/sigma/ScheduledQueryRun.java | 4 +- .../com/stripe/model/tax/Calculation.java | 20 +- .../stripe/model/tax/CalculationLineItem.java | 12 +- .../com/stripe/model/tax/Registration.java | 4 +- .../java/com/stripe/model/tax/Settings.java | 4 +- .../com/stripe/model/tax/Transaction.java | 14 +- .../stripe/model/tax/TransactionLineItem.java | 8 +- .../stripe/model/terminal/Configuration.java | 4 +- .../com/stripe/model/terminal/Location.java | 4 +- .../com/stripe/model/terminal/Reader.java | 4 +- .../stripe/model/testhelpers/TestClock.java | 4 +- .../stripe/model/treasury/CreditReversal.java | 4 +- .../stripe/model/treasury/DebitReversal.java | 4 +- .../model/treasury/FinancialAccount.java | 4 +- .../model/treasury/InboundTransfer.java | 4 +- .../model/treasury/OutboundPayment.java | 4 +- .../model/treasury/OutboundTransfer.java | 4 +- .../stripe/model/treasury/ReceivedCredit.java | 4 +- .../stripe/model/treasury/ReceivedDebit.java | 4 +- .../stripe/model/treasury/Transaction.java | 4 +- .../model/treasury/TransactionEntry.java | 4 +- .../com/stripe/model/v2/core/Account.java | 46 +- .../model/v2/core/EventDestination.java | 9 +- .../com/stripe/param/AccountCreateParams.java | 94 +++ .../com/stripe/param/AccountUpdateParams.java | 94 +++ .../param/ConfirmationTokenCreateParams.java | 247 +++++++ .../stripe/param/CreditNoteCreateParams.java | 40 ++ .../CreditNotePreviewLinesListParams.java | 40 ++ .../stripe/param/CreditNotePreviewParams.java | 40 ++ .../CustomerListPaymentMethodsParams.java | 3 + .../CustomerPaymentMethodListParams.java | 3 + .../stripe/param/InvoiceAddLinesParams.java | 32 +- .../param/InvoiceCreatePreviewParams.java | 33 +- .../stripe/param/InvoiceItemCreateParams.java | 33 +- .../stripe/param/InvoiceItemUpdateParams.java | 39 +- .../param/InvoiceLineItemUpdateParams.java | 66 +- .../param/InvoiceUpdateLinesParams.java | 32 +- .../param/PaymentIntentConfirmParams.java | 597 +++++++++++++++-- .../param/PaymentIntentCreateParams.java | 597 +++++++++++++++-- .../param/PaymentIntentUpdateParams.java | 615 ++++++++++++++++-- .../stripe/param/PaymentLinkCreateParams.java | 3 + .../stripe/param/PaymentLinkUpdateParams.java | 3 + ...aymentMethodConfigurationCreateParams.java | 184 ++++++ ...aymentMethodConfigurationUpdateParams.java | 184 ++++++ .../param/PaymentMethodCreateParams.java | 239 +++++++ .../stripe/param/PaymentMethodListParams.java | 3 + .../param/SetupIntentConfirmParams.java | 546 +++++++++++++++- .../stripe/param/SetupIntentCreateParams.java | 549 +++++++++++++++- .../stripe/param/SetupIntentUpdateParams.java | 567 +++++++++++++++- .../param/SubscriptionCreateParams.java | 16 +- .../param/SubscriptionItemCreateParams.java | 4 +- .../param/SubscriptionItemDeleteParams.java | 4 +- .../param/SubscriptionItemUpdateParams.java | 4 +- .../param/SubscriptionUpdateParams.java | 20 +- .../param/WebhookEndpointCreateParams.java | 5 +- .../param/checkout/SessionCreateParams.java | 602 ++++++++++++++++- .../issuing/AuthorizationCreateParams.java | 45 +- .../param/issuing/CardCreateParams.java | 172 +++++ .../param/issuing/CardholderCreateParams.java | 20 +- .../param/issuing/CardholderUpdateParams.java | 25 +- .../param/radar/ValueListCreateParams.java | 16 +- .../param/tax/CalculationCreateParams.java | 15 +- .../tax/TransactionCreateReversalParams.java | 27 +- .../param/v2/core/AccountCreateParams.java | 212 +----- .../v2/core/AccountTokenCreateParams.java | 213 +----- .../param/v2/core/AccountUpdateParams.java | 232 +------ .../v2/core/EventDestinationCreateParams.java | 34 +- .../service/CustomerPaymentSourceService.java | 8 +- .../com/stripe/service/InvoiceService.java | 52 +- .../stripe/service/PaymentIntentService.java | 24 +- .../com/stripe/service/PayoutService.java | 8 +- .../stripe/service/SubscriptionService.java | 24 +- .../service/v2/core/AccountLinkService.java | 6 +- .../service/v2/core/AccountService.java | 50 +- .../service/v2/core/AccountTokenService.java | 15 +- .../v2/core/accounts/PersonService.java | 40 +- .../v2/core/accounts/PersonTokenService.java | 14 +- .../stripe/functional/GeneratedExamples.java | 25 + 179 files changed, 6761 insertions(+), 1537 deletions(-) diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 17557a68f28..1992b4523bf 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -e65e48569f6dfad2d5f1b58018017856520c3ae6 \ No newline at end of file +273184f052dd3c191b1993098365d0c2437d2cb4 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 58dae793582..ad0b5d45105 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2186 \ No newline at end of file +v2204 \ No newline at end of file diff --git a/src/main/java/com/stripe/ApiVersion.java b/src/main/java/com/stripe/ApiVersion.java index ea101df091f..87fc548b515 100644 --- a/src/main/java/com/stripe/ApiVersion.java +++ b/src/main/java/com/stripe/ApiVersion.java @@ -2,6 +2,6 @@ package com.stripe; final class ApiVersion { - public static final String CURRENT = "2026-02-25.clover"; - public static final String CURRENT_MAJOR = "clover"; + public static final String CURRENT = "2026-03-25.dahlia"; + public static final String CURRENT_MAJOR = "dahlia"; } diff --git a/src/main/java/com/stripe/exception/StripeException.java b/src/main/java/com/stripe/exception/StripeException.java index ba7bf85ff83..65a8ea43e97 100644 --- a/src/main/java/com/stripe/exception/StripeException.java +++ b/src/main/java/com/stripe/exception/StripeException.java @@ -110,6 +110,9 @@ public static StripeException parseV2Exception( StripeResponseGetter responseGetter) { switch (type) { // The beginning of the section generated from our OpenAPI spec + case "rate_limit": + return com.stripe.exception.RateLimitException.parse( + body, statusCode, requestId, responseGetter); case "temporary_session_expired": return com.stripe.exception.TemporarySessionExpiredException.parse( body, statusCode, requestId, responseGetter); diff --git a/src/main/java/com/stripe/model/Account.java b/src/main/java/com/stripe/model/Account.java index de1986186f9..e3667b54ef6 100644 --- a/src/main/java/com/stripe/model/Account.java +++ b/src/main/java/com/stripe/model/Account.java @@ -24,7 +24,11 @@ import lombok.Setter; /** - * This is an object representing a Stripe account. You can retrieve it to see properties on the + * For new integrations, we recommend using the Accounts v2 API, in place of /v1/accounts and + * /v1/customers to represent a user. + * + *

This is an object representing a Stripe account. You can retrieve it to see properties on the * account like its current requirements or if the account is enabled to make live charges or * receive payouts. * @@ -1375,6 +1379,15 @@ public static class Capabilities extends StripeObject { @SerializedName("twint_payments") String twintPayments; + /** + * The status of the upi payments capability of the account, or whether the account can directly + * process upi charges. + * + *

One of {@code active}, {@code inactive}, or {@code pending}. + */ + @SerializedName("upi_payments") + String upiPayments; + /** * The status of the US bank account ACH payments capability of the account, or whether the * account can directly process US bank account charges. diff --git a/src/main/java/com/stripe/model/AccountSession.java b/src/main/java/com/stripe/model/AccountSession.java index 3c3d6afa5d6..68e087e8dc2 100644 --- a/src/main/java/com/stripe/model/AccountSession.java +++ b/src/main/java/com/stripe/model/AccountSession.java @@ -58,8 +58,8 @@ public class AccountSession extends ApiResource { Long expiresAt; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/ApplePayDomain.java b/src/main/java/com/stripe/model/ApplePayDomain.java index ca690b5f1e4..503b8b55b7d 100644 --- a/src/main/java/com/stripe/model/ApplePayDomain.java +++ b/src/main/java/com/stripe/model/ApplePayDomain.java @@ -37,8 +37,8 @@ public class ApplePayDomain extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/ApplicationFee.java b/src/main/java/com/stripe/model/ApplicationFee.java index bac7b223119..0f4996b6172 100644 --- a/src/main/java/com/stripe/model/ApplicationFee.java +++ b/src/main/java/com/stripe/model/ApplicationFee.java @@ -82,8 +82,8 @@ public class ApplicationFee extends ApiResource implements BalanceTransactionSou String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Balance.java b/src/main/java/com/stripe/model/Balance.java index 0f4a9b3e8b3..9f30955461a 100644 --- a/src/main/java/com/stripe/model/Balance.java +++ b/src/main/java/com/stripe/model/Balance.java @@ -57,8 +57,8 @@ public class Balance extends ApiResource { Issuing issuing; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/CashBalance.java b/src/main/java/com/stripe/model/CashBalance.java index 1421ac2af88..333fb8d9120 100644 --- a/src/main/java/com/stripe/model/CashBalance.java +++ b/src/main/java/com/stripe/model/CashBalance.java @@ -42,8 +42,8 @@ public class CashBalance extends ApiResource { String customerAccount; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 4cdabae123a..7696e6f7d72 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -171,8 +171,8 @@ public class Charge extends ApiResource implements MetadataStore, Balanc Level3 level3; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -1319,6 +1319,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -2725,7 +2728,8 @@ public static class Crypto extends StripeObject { /** * The blockchain network that the transaction was sent on. * - *

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. + *

One of {@code base}, {@code ethereum}, {@code polygon}, {@code solana}, or {@code + * tempo}. */ @SerializedName("network") String network; @@ -3999,6 +4003,19 @@ public static class Swish extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Twint extends StripeObject {} + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Customer's unique Virtual Payment Address. */ + @SerializedName("vpa") + String vpa; + } + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/ConfirmationToken.java b/src/main/java/com/stripe/model/ConfirmationToken.java index a88f65376d0..9c8650a9fe6 100644 --- a/src/main/java/com/stripe/model/ConfirmationToken.java +++ b/src/main/java/com/stripe/model/ConfirmationToken.java @@ -48,8 +48,8 @@ public class ConfirmationToken extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -455,11 +455,14 @@ public static class PaymentMethodPreview extends StripeObject { * nz_bank_account}, {@code oxxo}, {@code p24}, {@code pay_by_bank}, {@code payco}, {@code * paynow}, {@code paypal}, {@code payto}, {@code pix}, {@code promptpay}, {@code revolut_pay}, * {@code samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code sofort}, {@code swish}, - * {@code twint}, {@code us_bank_account}, {@code wechat_pay}, or {@code zip}. + * {@code twint}, {@code upi}, {@code us_bank_account}, {@code wechat_pay}, or {@code zip}. */ @SerializedName("type") String type; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -2289,6 +2292,19 @@ public static class Swish extends StripeObject {} @EqualsAndHashCode(callSuper = false) public static class Twint extends StripeObject {} + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Customer's unique Virtual Payment Address. */ + @SerializedName("vpa") + String vpa; + } + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/ConnectCollectionTransfer.java b/src/main/java/com/stripe/model/ConnectCollectionTransfer.java index ad68da667ee..b0db6fbf75e 100644 --- a/src/main/java/com/stripe/model/ConnectCollectionTransfer.java +++ b/src/main/java/com/stripe/model/ConnectCollectionTransfer.java @@ -34,8 +34,8 @@ public class ConnectCollectionTransfer extends StripeObject implements BalanceTr String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Coupon.java b/src/main/java/com/stripe/model/Coupon.java index af4892d5f42..5e03288f847 100644 --- a/src/main/java/com/stripe/model/Coupon.java +++ b/src/main/java/com/stripe/model/Coupon.java @@ -27,7 +27,7 @@ * href="https://api.stripe.com#invoices">invoices, checkout sessions, quotes, and more. Coupons do not work with conventional - * one-off charges or charges or payment intents. */ @Getter @@ -88,8 +88,8 @@ public class Coupon extends ApiResource implements HasId, MetadataStore String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/CreditNote.java b/src/main/java/com/stripe/model/CreditNote.java index a1394ad15cd..15de92bdeec 100644 --- a/src/main/java/com/stripe/model/CreditNote.java +++ b/src/main/java/com/stripe/model/CreditNote.java @@ -105,8 +105,8 @@ public class CreditNote extends ApiResource implements HasId, MetadataStorekey-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + /** * String representing the object's type. Objects of the same type share the same value. * diff --git a/src/main/java/com/stripe/model/Customer.java b/src/main/java/com/stripe/model/Customer.java index 309c0dadb5d..73e5995eba7 100644 --- a/src/main/java/com/stripe/model/Customer.java +++ b/src/main/java/com/stripe/model/Customer.java @@ -157,8 +157,8 @@ public class Customer extends ApiResource implements HasId, MetadataStore invoice; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java b/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java index e2f606bfa66..a5dae90649f 100644 --- a/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java +++ b/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java @@ -65,8 +65,8 @@ public class CustomerCashBalanceTransaction extends StripeObject String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/CustomerSession.java b/src/main/java/com/stripe/model/CustomerSession.java index a69b1af5b58..af911fd0350 100644 --- a/src/main/java/com/stripe/model/CustomerSession.java +++ b/src/main/java/com/stripe/model/CustomerSession.java @@ -66,8 +66,8 @@ public class CustomerSession extends ApiResource { Long expiresAt; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Dispute.java b/src/main/java/com/stripe/model/Dispute.java index 0a7eb6eb085..81c63c24437 100644 --- a/src/main/java/com/stripe/model/Dispute.java +++ b/src/main/java/com/stripe/model/Dispute.java @@ -85,8 +85,8 @@ public class Dispute extends ApiResource Boolean isChargeRefundable; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/EphemeralKey.java b/src/main/java/com/stripe/model/EphemeralKey.java index 4c08df80bbb..15f830e636c 100644 --- a/src/main/java/com/stripe/model/EphemeralKey.java +++ b/src/main/java/com/stripe/model/EphemeralKey.java @@ -33,8 +33,8 @@ public class EphemeralKey extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Event.java b/src/main/java/com/stripe/model/Event.java index b210dad8075..07e35ad21e7 100644 --- a/src/main/java/com/stripe/model/Event.java +++ b/src/main/java/com/stripe/model/Event.java @@ -72,8 +72,8 @@ public class Event extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/FileLink.java b/src/main/java/com/stripe/model/FileLink.java index 91bb8e94440..af577446b2d 100644 --- a/src/main/java/com/stripe/model/FileLink.java +++ b/src/main/java/com/stripe/model/FileLink.java @@ -51,8 +51,8 @@ public class FileLink extends ApiResource implements HasId, MetadataStorefinalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public static Invoice create(Map params) throws StripeException { @@ -987,8 +987,8 @@ public static Invoice create(Map params) throws StripeException /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public static Invoice create(Map params, RequestOptions options) @@ -1001,8 +1001,8 @@ public static Invoice create(Map params, RequestOptions options) /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public static Invoice create(InvoiceCreateParams params) throws StripeException { @@ -1011,8 +1011,8 @@ public static Invoice create(InvoiceCreateParams params) throws StripeException /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public static Invoice create(InvoiceCreateParams params, RequestOptions options) @@ -1215,7 +1215,7 @@ public static Invoice createPreview(InvoiceCreatePreviewParams params, RequestOp * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete() throws StripeException { return delete((Map) null, (RequestOptions) null); @@ -1225,7 +1225,7 @@ public Invoice delete() throws StripeException { * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete(RequestOptions options) throws StripeException { return delete((Map) null, options); @@ -1235,7 +1235,7 @@ public Invoice delete(RequestOptions options) throws StripeException { * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete(Map params) throws StripeException { return delete(params, (RequestOptions) null); @@ -1245,7 +1245,7 @@ public Invoice delete(Map params) throws StripeException { * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete(Map params, RequestOptions options) throws StripeException { String path = String.format("/v1/invoices/%s", ApiResource.urlEncodeId(this.getId())); @@ -1866,14 +1866,14 @@ public Invoice updateLines(InvoiceUpdateLinesParams params, RequestOptions optio /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice() throws StripeException { return voidInvoice((Map) null, (RequestOptions) null); @@ -1881,14 +1881,14 @@ public Invoice voidInvoice() throws StripeException { /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(RequestOptions options) throws StripeException { return voidInvoice((Map) null, options); @@ -1896,14 +1896,14 @@ public Invoice voidInvoice(RequestOptions options) throws StripeException { /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(Map params) throws StripeException { return voidInvoice(params, (RequestOptions) null); @@ -1911,14 +1911,14 @@ public Invoice voidInvoice(Map params) throws StripeException { /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(Map params, RequestOptions options) throws StripeException { @@ -1930,14 +1930,14 @@ public Invoice voidInvoice(Map params, RequestOptions options) /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(InvoiceVoidInvoiceParams params) throws StripeException { return voidInvoice(params, (RequestOptions) null); @@ -1945,14 +1945,14 @@ public Invoice voidInvoice(InvoiceVoidInvoiceParams params) throws StripeExcepti /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(InvoiceVoidInvoiceParams params, RequestOptions options) throws StripeException { @@ -2403,7 +2403,7 @@ public static class AcssDebit extends StripeObject { MandateOptions mandateOptions; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -2622,7 +2622,7 @@ public static class UsBankAccount extends StripeObject { FinancialConnections financialConnections; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ diff --git a/src/main/java/com/stripe/model/InvoiceItem.java b/src/main/java/com/stripe/model/InvoiceItem.java index bbeaf8177ea..5e8deefa4ea 100644 --- a/src/main/java/com/stripe/model/InvoiceItem.java +++ b/src/main/java/com/stripe/model/InvoiceItem.java @@ -104,8 +104,8 @@ public class InvoiceItem extends ApiResource implements HasId, MetadataStore invoice; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -156,12 +156,21 @@ public class InvoiceItem extends ApiResource implements HasId, MetadataStoreAPI + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param refers + * to the exact amount to be charged in future payments. If {@code maximum}, the amount + * charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + String amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + } + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/PaymentAttemptRecord.java b/src/main/java/com/stripe/model/PaymentAttemptRecord.java index 408fd3ea88d..362936cd851 100644 --- a/src/main/java/com/stripe/model/PaymentAttemptRecord.java +++ b/src/main/java/com/stripe/model/PaymentAttemptRecord.java @@ -85,8 +85,8 @@ public class PaymentAttemptRecord extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -570,6 +570,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -1365,6 +1368,38 @@ public static class ThreeDSecure extends StripeObject { @SerializedName("authentication_flow") String authenticationFlow; + /** + * The 3D Secure cryptogram, also known as the "authentication value" (AAV, CAVV + * or AEVV). + */ + @SerializedName("cryptogram") + String cryptogram; + + /** + * The Electronic Commerce Indicator (ECI). A protocol-level field indicating what degree of + * authentication was performed. + * + *

One of {@code 01}, {@code 02}, {@code 03}, {@code 04}, {@code 05}, {@code 06}, or + * {@code 07}. + */ + @SerializedName("electronic_commerce_indicator") + String electronicCommerceIndicator; + + /** + * The exemption requested via 3DS and accepted by the issuer at authentication time. + * + *

One of {@code low_risk}, or {@code none}. + */ + @SerializedName("exemption_indicator") + String exemptionIndicator; + + /** + * Whether Stripe requested the value of {@code exemption_indicator} in the transaction. + * This will depend on the outcome of Stripe's internal risk assessment. + */ + @SerializedName("exemption_indicator_applied") + Boolean exemptionIndicatorApplied; + /** * Indicates the outcome of 3D Secure authentication. * @@ -1780,7 +1815,8 @@ public static class Crypto extends StripeObject { /** * The blockchain network that the transaction was sent on. * - *

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. + *

One of {@code base}, {@code ethereum}, {@code polygon}, {@code solana}, or {@code + * tempo}. */ @SerializedName("network") String network; @@ -3074,6 +3110,19 @@ public static class Swish extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Twint extends StripeObject {} + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Customer's unique Virtual Payment Address. */ + @SerializedName("vpa") + String vpa; + } + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 09647e1a84b..9b9a4d0f406 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -222,8 +222,8 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore

latestCharge; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -587,9 +587,9 @@ public PaymentIntent applyCustomerBalance( * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel() throws StripeException { return cancel((Map) null, (RequestOptions) null); @@ -605,9 +605,9 @@ public PaymentIntent cancel() throws StripeException { * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(RequestOptions options) throws StripeException { return cancel((Map) null, options); @@ -623,9 +623,9 @@ public PaymentIntent cancel(RequestOptions options) throws StripeException { * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(Map params) throws StripeException { return cancel(params, (RequestOptions) null); @@ -641,9 +641,9 @@ public PaymentIntent cancel(Map params) throws StripeException { * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(Map params, RequestOptions options) throws StripeException { @@ -664,9 +664,9 @@ public PaymentIntent cancel(Map params, RequestOptions options) * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(PaymentIntentCancelParams params) throws StripeException { return cancel(params, (RequestOptions) null); @@ -682,9 +682,9 @@ public PaymentIntent cancel(PaymentIntentCancelParams params) throws StripeExcep * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(PaymentIntentCancelParams params, RequestOptions options) throws StripeException { @@ -1777,6 +1777,9 @@ public static class NextAction extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi_handle_redirect_or_display_qr_code") + UpiHandleRedirectOrDisplayQrCode upiHandleRedirectOrDisplayQrCode; + /** * When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this * dictionary to invoke authentication flows. The shape of the contents is subject to change and @@ -2536,6 +2539,45 @@ public static class QrCode extends StripeObject { } } + /** + * For more details about UpiHandleRedirectOrDisplayQrCode, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UpiHandleRedirectOrDisplayQrCode extends StripeObject { + /** + * The URL to the hosted UPI instructions page, which allows customers to view the QR code. + */ + @SerializedName("hosted_instructions_url") + String hostedInstructionsUrl; + + @SerializedName("qr_code") + QrCode qrCode; + + /** + * For more details about QrCode, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class QrCode extends StripeObject { + /** The date (unix timestamp) when the QR code expires. */ + @SerializedName("expires_at") + Long expiresAt; + + /** The image_url_png string used to render QR code. */ + @SerializedName("image_url_png") + String imageUrlPng; + + /** The image_url_svg string used to render QR code. */ + @SerializedName("image_url_svg") + String imageUrlSvg; + } + } + /** * For more details about VerifyWithMicrodeposits, please refer to the API Reference. @@ -2864,6 +2906,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("twint") Twint twint; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -2917,7 +2962,7 @@ public static class AcssDebit extends StripeObject { String targetDate; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -3610,7 +3655,7 @@ public static class Plan extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class MandateOptions extends StripeObject { - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ @SerializedName("amount") Long amount; @@ -5106,6 +5151,39 @@ public static class Twint extends StripeObject { String setupFutureUsage; } + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** + * 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 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 the payment method to a + * Customer after the transaction completes. + * + *

If the payment method is {@code card_present} and isn't a digital wallet, Stripe creates + * and attaches a generated_card + * payment method representing the card to the Customer instead. + * + *

When processing card payments, Stripe uses {@code setup_future_usage} to help you comply + * with regional legislation and network rules, such as SCA. + * + *

One of {@code off_session}, or {@code on_session}. + */ + @SerializedName("setup_future_usage") + String setupFutureUsage; + } + /** * For more details about UsBankAccount, please refer to the API Reference. @@ -5120,14 +5198,6 @@ public static class UsBankAccount extends StripeObject { @SerializedName("mandate_options") MandateOptions mandateOptions; - /** - * Preferred transaction settlement speed - * - *

One of {@code fastest}, or {@code standard}. - */ - @SerializedName("preferred_settlement_speed") - String preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -5169,7 +5239,7 @@ public static class UsBankAccount extends StripeObject { String transactionPurpose; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ diff --git a/src/main/java/com/stripe/model/PaymentLink.java b/src/main/java/com/stripe/model/PaymentLink.java index d6282f9987d..9f7355b6fca 100644 --- a/src/main/java/com/stripe/model/PaymentLink.java +++ b/src/main/java/com/stripe/model/PaymentLink.java @@ -130,8 +130,8 @@ public class PaymentLink extends ApiResource implements HasId, MetadataStoreAPI + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Customer's unique Virtual Payment Address. */ + @SerializedName("vpa") + String vpa; + } + /** * For more details about UsBankAccount, please refer to the API Reference. @@ -2746,6 +2762,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(sofort, responseGetter); trySetResponseGetter(swish, responseGetter); trySetResponseGetter(twint, responseGetter); + trySetResponseGetter(upi, responseGetter); trySetResponseGetter(usBankAccount, responseGetter); trySetResponseGetter(wechatPay, responseGetter); trySetResponseGetter(zip, responseGetter); diff --git a/src/main/java/com/stripe/model/PaymentMethodConfiguration.java b/src/main/java/com/stripe/model/PaymentMethodConfiguration.java index 4a75410a343..1b75dc97f7f 100644 --- a/src/main/java/com/stripe/model/PaymentMethodConfiguration.java +++ b/src/main/java/com/stripe/model/PaymentMethodConfiguration.java @@ -160,8 +160,8 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId { Link link; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -245,6 +245,9 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId { @SerializedName("twint") Twint twint; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -3009,6 +3012,57 @@ public static class DisplayPreference extends StripeObject { } } + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** + * Whether this payment method may be offered at checkout. True if {@code display_preference} is + * {@code on} and the payment method's capability is active. + */ + @SerializedName("available") + Boolean available; + + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * For more details about DisplayPreference, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference extends StripeObject { + /** + * For child configs, whether or not the account's preference will be observed. If {@code + * false}, the parent configuration's default is used. + */ + @SerializedName("overridable") + Boolean overridable; + + /** + * The account's display preference. + * + *

One of {@code none}, {@code off}, or {@code on}. + */ + @SerializedName("preference") + String preference; + + /** + * The effective display preference value. + * + *

One of {@code off}, or {@code on}. + */ + @SerializedName("value") + String value; + } + } + /** * For more details about UsBankAccount, please refer to the API Reference. @@ -3216,6 +3270,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(sofort, responseGetter); trySetResponseGetter(swish, responseGetter); trySetResponseGetter(twint, responseGetter); + trySetResponseGetter(upi, responseGetter); trySetResponseGetter(usBankAccount, responseGetter); trySetResponseGetter(wechatPay, responseGetter); trySetResponseGetter(zip, responseGetter); diff --git a/src/main/java/com/stripe/model/PaymentMethodDomain.java b/src/main/java/com/stripe/model/PaymentMethodDomain.java index 9343eb0023a..cd7a01b69b1 100644 --- a/src/main/java/com/stripe/model/PaymentMethodDomain.java +++ b/src/main/java/com/stripe/model/PaymentMethodDomain.java @@ -73,8 +73,8 @@ public class PaymentMethodDomain extends ApiResource implements HasId { Link link; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/PaymentRecord.java b/src/main/java/com/stripe/model/PaymentRecord.java index ac5d09f6900..c7d836c5b36 100644 --- a/src/main/java/com/stripe/model/PaymentRecord.java +++ b/src/main/java/com/stripe/model/PaymentRecord.java @@ -96,8 +96,8 @@ public class PaymentRecord extends ApiResource implements HasId { String latestPaymentAttemptRecord; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -872,6 +872,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -1667,6 +1670,38 @@ public static class ThreeDSecure extends StripeObject { @SerializedName("authentication_flow") String authenticationFlow; + /** + * The 3D Secure cryptogram, also known as the "authentication value" (AAV, CAVV + * or AEVV). + */ + @SerializedName("cryptogram") + String cryptogram; + + /** + * The Electronic Commerce Indicator (ECI). A protocol-level field indicating what degree of + * authentication was performed. + * + *

One of {@code 01}, {@code 02}, {@code 03}, {@code 04}, {@code 05}, {@code 06}, or + * {@code 07}. + */ + @SerializedName("electronic_commerce_indicator") + String electronicCommerceIndicator; + + /** + * The exemption requested via 3DS and accepted by the issuer at authentication time. + * + *

One of {@code low_risk}, or {@code none}. + */ + @SerializedName("exemption_indicator") + String exemptionIndicator; + + /** + * Whether Stripe requested the value of {@code exemption_indicator} in the transaction. + * This will depend on the outcome of Stripe's internal risk assessment. + */ + @SerializedName("exemption_indicator_applied") + Boolean exemptionIndicatorApplied; + /** * Indicates the outcome of 3D Secure authentication. * @@ -2082,7 +2117,8 @@ public static class Crypto extends StripeObject { /** * The blockchain network that the transaction was sent on. * - *

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. + *

One of {@code base}, {@code ethereum}, {@code polygon}, {@code solana}, or {@code + * tempo}. */ @SerializedName("network") String network; @@ -3376,6 +3412,19 @@ public static class Swish extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Twint extends StripeObject {} + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Customer's unique Virtual Payment Address. */ + @SerializedName("vpa") + String vpa; + } + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/PaymentSourceCollection.java b/src/main/java/com/stripe/model/PaymentSourceCollection.java index 7976909856a..f651147d3ae 100644 --- a/src/main/java/com/stripe/model/PaymentSourceCollection.java +++ b/src/main/java/com/stripe/model/PaymentSourceCollection.java @@ -19,8 +19,8 @@ public class PaymentSourceCollection extends StripeCollection { * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -32,8 +32,8 @@ public PaymentSource create(Map params) throws StripeException { * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create(Map params, RequestOptions options) throws StripeException { @@ -49,8 +49,8 @@ public PaymentSource create(Map params, RequestOptions options) * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create(PaymentSourceCollectionCreateParams params) throws StripeException { return create(params, (RequestOptions) null); @@ -62,8 +62,8 @@ public PaymentSource create(PaymentSourceCollectionCreateParams params) throws S * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create(PaymentSourceCollectionCreateParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/model/Payout.java b/src/main/java/com/stripe/model/Payout.java index a7015e9eefc..9aded0baefb 100644 --- a/src/main/java/com/stripe/model/Payout.java +++ b/src/main/java/com/stripe/model/Payout.java @@ -128,8 +128,8 @@ public class Payout extends ApiResource implements MetadataStore, Balanc String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -403,8 +403,8 @@ public Payout cancel(PayoutCancelParams params, RequestOptions options) throws S * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public static Payout create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -420,8 +420,8 @@ public static Payout create(Map params) throws StripeException { * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public static Payout create(Map params, RequestOptions options) throws StripeException { @@ -441,8 +441,8 @@ public static Payout create(Map params, RequestOptions options) * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public static Payout create(PayoutCreateParams params) throws StripeException { return create(params, (RequestOptions) null); @@ -458,8 +458,8 @@ public static Payout create(PayoutCreateParams params) throws StripeException { * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public static Payout create(PayoutCreateParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/model/Plan.java b/src/main/java/com/stripe/model/Plan.java index 99a23a59c21..3276b347c69 100644 --- a/src/main/java/com/stripe/model/Plan.java +++ b/src/main/java/com/stripe/model/Plan.java @@ -110,8 +110,8 @@ public class Plan extends ApiResource implements HasId, MetadataStore { Long intervalCount; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Price.java b/src/main/java/com/stripe/model/Price.java index ebfc1851480..631bed095e9 100644 --- a/src/main/java/com/stripe/model/Price.java +++ b/src/main/java/com/stripe/model/Price.java @@ -95,8 +95,8 @@ public class Price extends ApiResource implements HasId, MetadataStore { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Product.java b/src/main/java/com/stripe/model/Product.java index 62d297b6471..1981d9a2989 100644 --- a/src/main/java/com/stripe/model/Product.java +++ b/src/main/java/com/stripe/model/Product.java @@ -78,8 +78,8 @@ public class Product extends ApiResource implements HasId, MetadataStore images; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/ProductFeature.java b/src/main/java/com/stripe/model/ProductFeature.java index 5a28860688b..25e208389ce 100644 --- a/src/main/java/com/stripe/model/ProductFeature.java +++ b/src/main/java/com/stripe/model/ProductFeature.java @@ -45,8 +45,8 @@ public class ProductFeature extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/PromotionCode.java b/src/main/java/com/stripe/model/PromotionCode.java index 07257537e10..1dc8bc05a09 100644 --- a/src/main/java/com/stripe/model/PromotionCode.java +++ b/src/main/java/com/stripe/model/PromotionCode.java @@ -71,8 +71,8 @@ public class PromotionCode extends ApiResource implements HasId, MetadataStore

{ LineItemCollection lineItems; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Review.java b/src/main/java/com/stripe/model/Review.java index c3487280d94..ec652c28ac5 100644 --- a/src/main/java/com/stripe/model/Review.java +++ b/src/main/java/com/stripe/model/Review.java @@ -68,8 +68,8 @@ public class Review extends ApiResource implements HasId { IpAddressLocation ipAddressLocation; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/SetupAttempt.java b/src/main/java/com/stripe/model/SetupAttempt.java index 3d7a6f58788..c3818f96c22 100644 --- a/src/main/java/com/stripe/model/SetupAttempt.java +++ b/src/main/java/com/stripe/model/SetupAttempt.java @@ -84,8 +84,8 @@ public class SetupAttempt extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -347,6 +347,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -1083,6 +1086,15 @@ public void setGeneratedSepaDebitMandateObject(Mandate expandableObject) { } } + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject {} + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/SetupIntent.java b/src/main/java/com/stripe/model/SetupIntent.java index fad324c5a15..4818fc82884 100644 --- a/src/main/java/com/stripe/model/SetupIntent.java +++ b/src/main/java/com/stripe/model/SetupIntent.java @@ -151,8 +151,8 @@ public class SetupIntent extends ApiResource implements HasId, MetadataStore latestAttempt; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -887,6 +887,9 @@ public static class NextAction extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi_handle_redirect_or_display_qr_code") + UpiHandleRedirectOrDisplayQrCode upiHandleRedirectOrDisplayQrCode; + /** * When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this * dictionary to invoke authentication flows. The shape of the contents is subject to change and @@ -962,6 +965,45 @@ public static class RedirectToUrl extends StripeObject { String url; } + /** + * For more details about UpiHandleRedirectOrDisplayQrCode, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UpiHandleRedirectOrDisplayQrCode extends StripeObject { + /** + * The URL to the hosted UPI instructions page, which allows customers to view the QR code. + */ + @SerializedName("hosted_instructions_url") + String hostedInstructionsUrl; + + @SerializedName("qr_code") + QrCode qrCode; + + /** + * For more details about QrCode, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class QrCode extends StripeObject { + /** The date (unix timestamp) when the QR code expires. */ + @SerializedName("expires_at") + Long expiresAt; + + /** The image_url_png string used to render QR code. */ + @SerializedName("image_url_png") + String imageUrlPng; + + /** The image_url_svg string used to render QR code. */ + @SerializedName("image_url_svg") + String imageUrlSvg; + } + } + /** * For more details about VerifyWithMicrodeposits, please refer to the API Reference. @@ -1048,6 +1090,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("sepa_debit") SepaDebit sepaDebit; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -1071,7 +1116,7 @@ public static class AcssDebit extends StripeObject { MandateOptions mandateOptions; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -1200,7 +1245,7 @@ public static class Card extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class MandateOptions extends StripeObject { - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ @SerializedName("amount") Long amount; @@ -1431,6 +1476,50 @@ public static class MandateOptions extends StripeObject { } } + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * For more details about MandateOptions, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + String amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + } + } + /** * For more details about UsBankAccount, please refer to the API Reference. @@ -1446,7 +1535,7 @@ public static class UsBankAccount extends StripeObject { MandateOptions mandateOptions; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ diff --git a/src/main/java/com/stripe/model/ShippingRate.java b/src/main/java/com/stripe/model/ShippingRate.java index 4615d03b48a..e3fa070698f 100644 --- a/src/main/java/com/stripe/model/ShippingRate.java +++ b/src/main/java/com/stripe/model/ShippingRate.java @@ -58,8 +58,8 @@ public class ShippingRate extends ApiResource implements HasId, MetadataStore, Paymen Klarna klarna; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/SourceMandateNotification.java b/src/main/java/com/stripe/model/SourceMandateNotification.java index 6a1c794cbb3..47cf5d94eac 100644 --- a/src/main/java/com/stripe/model/SourceMandateNotification.java +++ b/src/main/java/com/stripe/model/SourceMandateNotification.java @@ -39,8 +39,8 @@ public class SourceMandateNotification extends StripeObject implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/SourceTransaction.java b/src/main/java/com/stripe/model/SourceTransaction.java index 9d6a74069e8..01b1a8dd349 100644 --- a/src/main/java/com/stripe/model/SourceTransaction.java +++ b/src/main/java/com/stripe/model/SourceTransaction.java @@ -49,8 +49,8 @@ public class SourceTransaction extends StripeObject implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/StripeError.java b/src/main/java/com/stripe/model/StripeError.java index b2512570209..6892954c27e 100644 --- a/src/main/java/com/stripe/model/StripeError.java +++ b/src/main/java/com/stripe/model/StripeError.java @@ -95,7 +95,8 @@ public class StripeError extends StripeObject { * refer_to_customer}, {@code refund_disputed_payment}, {@code request_blocked}, {@code * resource_already_exists}, {@code resource_missing}, {@code return_intent_already_processed}, * {@code routing_number_invalid}, {@code secret_key_required}, {@code sepa_unsupported_account}, - * {@code setup_attempt_failed}, {@code setup_intent_authentication_failure}, {@code + * {@code service_period_coupon_with_metered_tiered_item_unsupported}, {@code + * setup_attempt_failed}, {@code setup_intent_authentication_failure}, {@code * setup_intent_invalid_parameter}, {@code setup_intent_mandate_invalid}, {@code * setup_intent_mobile_wallet_unsupported}, {@code setup_intent_setup_attempt_expired}, {@code * setup_intent_unexpected_state}, {@code shipping_address_invalid}, {@code diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index c776a96e6b0..f955227972f 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -216,8 +216,8 @@ public class Subscription extends ApiResource implements HasId, MetadataStore latestInvoice; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -272,8 +272,8 @@ public class Subscription extends ApiResource implements HasId, MetadataStoreCreate an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ @SerializedName("pending_invoice_item_interval") PendingInvoiceItemInterval pendingInvoiceItemInterval; @@ -590,9 +590,9 @@ public void setDiscountObjects(List objs) { * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -612,9 +612,9 @@ public Subscription cancel() throws StripeException { * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -634,9 +634,9 @@ public Subscription cancel(Map params) throws StripeException { * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -660,9 +660,9 @@ public Subscription cancel(Map params, RequestOptions options) * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -682,9 +682,9 @@ public Subscription cancel(SubscriptionCancelParams params) throws StripeExcepti * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -1493,8 +1493,8 @@ public static class CancellationDetails extends StripeObject { /** * Why this subscription was canceled. * - *

One of {@code cancellation_requested}, {@code payment_disputed}, or {@code - * payment_failed}. + *

One of {@code canceled_by_retention_policy}, {@code cancellation_requested}, {@code + * payment_disputed}, or {@code payment_failed}. */ @SerializedName("reason") String reason; @@ -1613,8 +1613,9 @@ public void setAccountObject(Account expandableObject) { @EqualsAndHashCode(callSuper = false) public static class PauseCollection extends StripeObject { /** - * The payment collection behavior for this subscription while paused. One of {@code - * keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * The payment collection behavior for this subscription while paused. + * + *

One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. */ @SerializedName("behavior") String behavior; @@ -1731,7 +1732,7 @@ public static class AcssDebit extends StripeObject { MandateOptions mandateOptions; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -1815,7 +1816,7 @@ public static class Card extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class MandateOptions extends StripeObject { - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ @SerializedName("amount") Long amount; @@ -1972,7 +1973,7 @@ public static class UsBankAccount extends StripeObject { FinancialConnections financialConnections; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ diff --git a/src/main/java/com/stripe/model/SubscriptionSchedule.java b/src/main/java/com/stripe/model/SubscriptionSchedule.java index 1c2d16086cb..1bcf7b31798 100644 --- a/src/main/java/com/stripe/model/SubscriptionSchedule.java +++ b/src/main/java/com/stripe/model/SubscriptionSchedule.java @@ -101,8 +101,8 @@ public class SubscriptionSchedule extends ApiResource String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/TaxId.java b/src/main/java/com/stripe/model/TaxId.java index 7dbecfd4452..d21285fdced 100644 --- a/src/main/java/com/stripe/model/TaxId.java +++ b/src/main/java/com/stripe/model/TaxId.java @@ -58,8 +58,8 @@ public class TaxId extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/TaxRate.java b/src/main/java/com/stripe/model/TaxRate.java index af094958079..72799fe33e5 100644 --- a/src/main/java/com/stripe/model/TaxRate.java +++ b/src/main/java/com/stripe/model/TaxRate.java @@ -108,8 +108,8 @@ public class TaxRate extends ApiResource implements HasId, MetadataStore, BalanceT /** * Error code explaining reason for top-up failure if available (see the errors section for a list of codes). + * href="https://stripe.com/api/errors">the errors section for a list of codes). */ @SerializedName("failure_code") String failureCode; @@ -82,8 +82,8 @@ public class Topup extends ApiResource implements MetadataStore, BalanceT String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Transfer.java b/src/main/java/com/stripe/model/Transfer.java index af66f5c27e9..ca0f483a1b7 100644 --- a/src/main/java/com/stripe/model/Transfer.java +++ b/src/main/java/com/stripe/model/Transfer.java @@ -90,8 +90,8 @@ public class Transfer extends ApiResource String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/WebhookEndpoint.java b/src/main/java/com/stripe/model/WebhookEndpoint.java index 71157bb11f3..4ae148715a9 100644 --- a/src/main/java/com/stripe/model/WebhookEndpoint.java +++ b/src/main/java/com/stripe/model/WebhookEndpoint.java @@ -65,8 +65,8 @@ public class WebhookEndpoint extends ApiResource implements HasId, MetadataStore String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/apps/Secret.java b/src/main/java/com/stripe/model/apps/Secret.java index 66e91925646..72a3e98dc19 100644 --- a/src/main/java/com/stripe/model/apps/Secret.java +++ b/src/main/java/com/stripe/model/apps/Secret.java @@ -60,8 +60,8 @@ public class Secret extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/billing/Alert.java b/src/main/java/com/stripe/model/billing/Alert.java index 437bee7c5a4..ec0f04e7b9e 100644 --- a/src/main/java/com/stripe/model/billing/Alert.java +++ b/src/main/java/com/stripe/model/billing/Alert.java @@ -48,8 +48,8 @@ public class Alert extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/billing/AlertTriggered.java b/src/main/java/com/stripe/model/billing/AlertTriggered.java index c02dc2f80d7..00af8da00b5 100644 --- a/src/main/java/com/stripe/model/billing/AlertTriggered.java +++ b/src/main/java/com/stripe/model/billing/AlertTriggered.java @@ -28,8 +28,8 @@ public class AlertTriggered extends StripeObject { String customer; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/billing/CreditBalanceSummary.java b/src/main/java/com/stripe/model/billing/CreditBalanceSummary.java index 3a6ba11a814..a4639382c79 100644 --- a/src/main/java/com/stripe/model/billing/CreditBalanceSummary.java +++ b/src/main/java/com/stripe/model/billing/CreditBalanceSummary.java @@ -42,8 +42,8 @@ public class CreditBalanceSummary extends ApiResource { String customerAccount; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/billing/CreditBalanceTransaction.java b/src/main/java/com/stripe/model/billing/CreditBalanceTransaction.java index 03364483471..dff06b1f5ee 100644 --- a/src/main/java/com/stripe/model/billing/CreditBalanceTransaction.java +++ b/src/main/java/com/stripe/model/billing/CreditBalanceTransaction.java @@ -57,8 +57,8 @@ public class CreditBalanceTransaction extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/billing/CreditGrant.java b/src/main/java/com/stripe/model/billing/CreditGrant.java index f7475e96231..383ceb6d43c 100644 --- a/src/main/java/com/stripe/model/billing/CreditGrant.java +++ b/src/main/java/com/stripe/model/billing/CreditGrant.java @@ -82,8 +82,8 @@ public class CreditGrant extends ApiResource implements HasId, MetadataStoreOne of {@code custom}, {@code embedded}, or {@code hosted}. + *

One of {@code custom}, {@code elements}, {@code embedded}, {@code embedded_page}, {@code + * form}, {@code hosted}, or {@code hosted_page}. */ @SerializedName("ui_mode") String uiMode; @@ -2092,6 +2100,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("twint") Twint twint; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -2147,7 +2158,7 @@ public static class AcssDebit extends StripeObject { String targetDate; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -3879,6 +3890,74 @@ public static class Twint extends StripeObject { String setupFutureUsage; } + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * 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 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 the payment method to a + * Customer after the transaction completes. + * + *

If the payment method is {@code card_present} and isn't a digital wallet, Stripe creates + * and attaches a generated_card + * payment method representing the card to the Customer instead. + * + *

When processing card payments, Stripe uses {@code setup_future_usage} to help you comply + * with regional legislation and network rules, such as SCA. + * + *

One of {@code none}, {@code off_session}, or {@code on_session}. + */ + @SerializedName("setup_future_usage") + String setupFutureUsage; + + /** + * For more details about MandateOptions, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + String amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + } + } + /** * For more details about UsBankAccount, please refer to the API Reference. @@ -3923,7 +4002,7 @@ public static class UsBankAccount extends StripeObject { String targetDate; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, or {@code instant}. */ diff --git a/src/main/java/com/stripe/model/climate/Supplier.java b/src/main/java/com/stripe/model/climate/Supplier.java index c83382ccbf1..2403d5ad3ca 100644 --- a/src/main/java/com/stripe/model/climate/Supplier.java +++ b/src/main/java/com/stripe/model/climate/Supplier.java @@ -59,8 +59,8 @@ public class Supplier extends ApiResource implements HasId { /** * The scientific pathway used for carbon removal. * - *

One of {@code biomass_carbon_removal_and_storage}, {@code direct_air_capture}, or {@code - * enhanced_weathering}. + *

One of {@code biomass_carbon_removal_and_storage}, {@code direct_air_capture}, {@code + * enhanced_weathering}, or {@code marine_carbon_removal}. */ @SerializedName("removal_pathway") String removalPathway; diff --git a/src/main/java/com/stripe/model/entitlements/ActiveEntitlement.java b/src/main/java/com/stripe/model/entitlements/ActiveEntitlement.java index c8a5182648e..818cc808316 100644 --- a/src/main/java/com/stripe/model/entitlements/ActiveEntitlement.java +++ b/src/main/java/com/stripe/model/entitlements/ActiveEntitlement.java @@ -38,8 +38,8 @@ public class ActiveEntitlement extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/entitlements/ActiveEntitlementSummary.java b/src/main/java/com/stripe/model/entitlements/ActiveEntitlementSummary.java index ea98118e538..111f2efad8b 100644 --- a/src/main/java/com/stripe/model/entitlements/ActiveEntitlementSummary.java +++ b/src/main/java/com/stripe/model/entitlements/ActiveEntitlementSummary.java @@ -21,8 +21,8 @@ public class ActiveEntitlementSummary extends StripeObject { ActiveEntitlementCollection entitlements; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/entitlements/Feature.java b/src/main/java/com/stripe/model/entitlements/Feature.java index b6caf0e5936..4abcd771a4c 100644 --- a/src/main/java/com/stripe/model/entitlements/Feature.java +++ b/src/main/java/com/stripe/model/entitlements/Feature.java @@ -41,8 +41,8 @@ public class Feature extends ApiResource implements HasId, MetadataStore lastVerificationReport; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/Authorization.java b/src/main/java/com/stripe/model/issuing/Authorization.java index 80c1efef7f7..de680af9e89 100644 --- a/src/main/java/com/stripe/model/issuing/Authorization.java +++ b/src/main/java/com/stripe/model/issuing/Authorization.java @@ -130,8 +130,8 @@ public class Authorization extends ApiResource String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/Card.java b/src/main/java/com/stripe/model/issuing/Card.java index 0b4eca67064..e66d781f222 100644 --- a/src/main/java/com/stripe/model/issuing/Card.java +++ b/src/main/java/com/stripe/model/issuing/Card.java @@ -112,8 +112,16 @@ public class Card extends ApiResource implements HasId, MetadataStore { LatestFraudWarning latestFraudWarning; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * Rules that control the lifecycle of this card, such as automatic cancellation. Refer to our documentation for more + * details. + */ + @SerializedName("lifecycle_controls") + LifecycleControls lifecycleControls; + + /** + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -443,6 +451,35 @@ public static class LatestFraudWarning extends StripeObject { String type; } + /** + * For more details about LifecycleControls, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LifecycleControls extends StripeObject { + @SerializedName("cancel_after") + CancelAfter cancelAfter; + + /** + * For more details about CancelAfter, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CancelAfter extends StripeObject { + /** + * The card is automatically cancelled when it makes this number of non-zero payment + * authorizations and transactions. The count includes penny authorizations, but doesn't + * include non-payment actions, such as authorization advice. + */ + @SerializedName("payment_count") + Long paymentCount; + } + } + /** * For more details about Shipping, please refer to the API * Reference. @@ -1073,6 +1110,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(cardholder, responseGetter); trySetResponseGetter(latestFraudWarning, responseGetter); + trySetResponseGetter(lifecycleControls, responseGetter); trySetResponseGetter(personalizationDesign, responseGetter); trySetResponseGetter(replacedBy, responseGetter); trySetResponseGetter(replacementFor, responseGetter); diff --git a/src/main/java/com/stripe/model/issuing/Cardholder.java b/src/main/java/com/stripe/model/issuing/Cardholder.java index 6c0c016ee23..190e599df97 100644 --- a/src/main/java/com/stripe/model/issuing/Cardholder.java +++ b/src/main/java/com/stripe/model/issuing/Cardholder.java @@ -62,8 +62,8 @@ public class Cardholder extends ApiResource implements HasId, MetadataStoreOne of {@code block}, or {@code continue}. + */ + @SerializedName("recommended_action") + String recommendedAction; + + /** Collection of signals for this payment evaluation. */ + @SerializedName("signals") + Signals signals; + /** * Request a Radar API fraud risk score from Stripe for a payment before sending it for external * processor authorization. @@ -349,42 +359,6 @@ public static class UserInterventionResolved extends StripeObject { } } - /** Collection of scores and insights for this payment evaluation. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Insights extends StripeObject { - /** The timestamp when the evaluation was performed. */ - @SerializedName("evaluated_at") - Long evaluatedAt; - - /** Scores, insights and recommended action for one scorer for this PaymentEvaluation. */ - @SerializedName("fraudulent_dispute") - FraudulentDispute fraudulentDispute; - - /** Scores, insights and recommended action for one scorer for this PaymentEvaluation. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class FraudulentDispute extends StripeObject { - /** - * Recommended action based on the risk score. Possible values are {@code block} and {@code - * continue}. - * - *

One of {@code block}, or {@code continue}. - */ - @SerializedName("recommended_action") - String recommendedAction; - - /** - * Stripe Radar’s evaluation of the risk level of the payment. Possible values for evaluated - * payments are between 0 and 100, with higher scores indicating higher risk. - */ - @SerializedName("risk_score") - Long riskScore; - } - } - /** Outcome details for this payment evaluation. */ @Getter @Setter @@ -757,13 +731,49 @@ public static class Address extends StripeObject { } } + /** Collection of signals for this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Signals extends StripeObject { + /** A payment evaluation signal with evaluated_at, risk_level, and score fields. */ + @SerializedName("fraudulent_payment") + FraudulentPayment fraudulentPayment; + + /** A payment evaluation signal with evaluated_at, risk_level, and score fields. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FraudulentPayment extends StripeObject { + /** The time when this signal was evaluated. */ + @SerializedName("evaluated_at") + Long evaluatedAt; + + /** + * Risk level of this signal, based on the score. + * + *

One of {@code elevated}, {@code highest}, or {@code normal}. + */ + @SerializedName("risk_level") + String riskLevel; + + /** + * Score for this insight. Possible values for evaluated payments are -1 and any value between + * 0 and 100. The value is returned with two decimal places. A score of -1 indicates a test + * integration and higher scores indicate a higher likelihood of the signal being true. + */ + @SerializedName("score") + BigDecimal score; + } + } + @Override public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(clientDeviceMetadataDetails, responseGetter); trySetResponseGetter(customerDetails, responseGetter); - trySetResponseGetter(insights, responseGetter); trySetResponseGetter(outcome, responseGetter); trySetResponseGetter(paymentDetails, responseGetter); + trySetResponseGetter(signals, responseGetter); } } diff --git a/src/main/java/com/stripe/model/radar/ValueList.java b/src/main/java/com/stripe/model/radar/ValueList.java index cc1ad900b1c..0e560494d20 100644 --- a/src/main/java/com/stripe/model/radar/ValueList.java +++ b/src/main/java/com/stripe/model/radar/ValueList.java @@ -53,8 +53,9 @@ public class ValueList extends ApiResource implements HasId, MetadataStoresmallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("amount_total") Long amountTotal; @@ -68,8 +68,8 @@ public class Calculation extends ApiResource implements HasId { CalculationLineItemCollection lineItems; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -411,7 +411,7 @@ public static class Address extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class ShippingCost extends StripeObject { /** - * The shipping amount in the smallest + * The shipping amount in the smallest * currency unit. If {@code tax_behavior=inclusive}, then this amount includes taxes. * Otherwise, taxes were calculated on top of this amount. */ @@ -420,7 +420,7 @@ public static class ShippingCost extends StripeObject { /** * The amount of tax calculated for shipping, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("amount_tax") Long amountTax; @@ -460,8 +460,8 @@ public static class ShippingCost extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class TaxBreakdown extends StripeObject { /** - * The amount of tax, in the smallest currency unit. + * The amount of tax, in the smallest + * currency unit. */ @SerializedName("amount") Long amount; @@ -500,7 +500,7 @@ public static class TaxBreakdown extends StripeObject { /** * The amount on which tax is calculated, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("taxable_amount") Long taxableAmount; @@ -586,7 +586,7 @@ public static class TaxRateDetails extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class TaxBreakdown extends StripeObject { /** - * The amount of tax, in the smallest + * The amount of tax, in the smallest * currency unit. */ @SerializedName("amount") @@ -614,7 +614,7 @@ public static class TaxBreakdown extends StripeObject { /** * The amount on which tax is calculated, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("taxable_amount") Long taxableAmount; diff --git a/src/main/java/com/stripe/model/tax/CalculationLineItem.java b/src/main/java/com/stripe/model/tax/CalculationLineItem.java index fc64b94fa46..4053a98e231 100644 --- a/src/main/java/com/stripe/model/tax/CalculationLineItem.java +++ b/src/main/java/com/stripe/model/tax/CalculationLineItem.java @@ -15,7 +15,7 @@ @EqualsAndHashCode(callSuper = false) public class CalculationLineItem extends StripeObject implements HasId { /** - * The line item amount in the smallest + * The line item amount in the smallest * currency unit. If {@code tax_behavior=inclusive}, then this amount includes taxes. * Otherwise, taxes were calculated on top of this amount. */ @@ -24,7 +24,7 @@ public class CalculationLineItem extends StripeObject implements HasId { /** * The amount of tax calculated for this line item, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("amount_tax") Long amountTax; @@ -35,8 +35,8 @@ public class CalculationLineItem extends StripeObject implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -100,7 +100,7 @@ public class CalculationLineItem extends StripeObject implements HasId { @EqualsAndHashCode(callSuper = false) public static class TaxBreakdown extends StripeObject { /** - * The amount of tax, in the smallest + * The amount of tax, in the smallest * currency unit. */ @SerializedName("amount") @@ -140,7 +140,7 @@ public static class TaxBreakdown extends StripeObject { /** * The amount on which tax is calculated, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("taxable_amount") Long taxableAmount; diff --git a/src/main/java/com/stripe/model/tax/Registration.java b/src/main/java/com/stripe/model/tax/Registration.java index f7056acdd51..74469d3db35 100644 --- a/src/main/java/com/stripe/model/tax/Registration.java +++ b/src/main/java/com/stripe/model/tax/Registration.java @@ -68,8 +68,8 @@ public class Registration extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/tax/Settings.java b/src/main/java/com/stripe/model/tax/Settings.java index 49b8a683e4d..fdca9592eaf 100644 --- a/src/main/java/com/stripe/model/tax/Settings.java +++ b/src/main/java/com/stripe/model/tax/Settings.java @@ -36,8 +36,8 @@ public class Settings extends ApiResource { HeadOffice headOffice; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/tax/Transaction.java b/src/main/java/com/stripe/model/tax/Transaction.java index b36a3d110f7..3dc225c7943 100644 --- a/src/main/java/com/stripe/model/tax/Transaction.java +++ b/src/main/java/com/stripe/model/tax/Transaction.java @@ -62,8 +62,8 @@ public class Transaction extends ApiResource implements HasId { TransactionLineItemCollection lineItems; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -469,7 +469,7 @@ public static class Address extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class ShippingCost extends StripeObject { /** - * The shipping amount in the smallest + * The shipping amount in the smallest * currency unit. If {@code tax_behavior=inclusive}, then this amount includes taxes. * Otherwise, taxes were calculated on top of this amount. */ @@ -478,7 +478,7 @@ public static class ShippingCost extends StripeObject { /** * The amount of tax calculated for shipping, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("amount_tax") Long amountTax; @@ -521,8 +521,8 @@ public static class ShippingCost extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class TaxBreakdown extends StripeObject { /** - * The amount of tax, in the smallest currency unit. + * The amount of tax, in the smallest + * currency unit. */ @SerializedName("amount") Long amount; @@ -561,7 +561,7 @@ public static class TaxBreakdown extends StripeObject { /** * The amount on which tax is calculated, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("taxable_amount") Long taxableAmount; diff --git a/src/main/java/com/stripe/model/tax/TransactionLineItem.java b/src/main/java/com/stripe/model/tax/TransactionLineItem.java index a6fb325ff88..8f1bd4781bf 100644 --- a/src/main/java/com/stripe/model/tax/TransactionLineItem.java +++ b/src/main/java/com/stripe/model/tax/TransactionLineItem.java @@ -14,7 +14,7 @@ @EqualsAndHashCode(callSuper = false) public class TransactionLineItem extends StripeObject implements HasId { /** - * The line item amount in the smallest + * The line item amount in the smallest * currency unit. If {@code tax_behavior=inclusive}, then this amount includes taxes. * Otherwise, taxes were calculated on top of this amount. */ @@ -23,7 +23,7 @@ public class TransactionLineItem extends StripeObject implements HasId { /** * The amount of tax calculated for this line item, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("amount_tax") Long amountTax; @@ -34,8 +34,8 @@ public class TransactionLineItem extends StripeObject implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/terminal/Configuration.java b/src/main/java/com/stripe/model/terminal/Configuration.java index 44bbb5b6a5e..a8343e6c033 100644 --- a/src/main/java/com/stripe/model/terminal/Configuration.java +++ b/src/main/java/com/stripe/model/terminal/Configuration.java @@ -56,8 +56,8 @@ public class Configuration extends ApiResource implements HasId { Boolean isAccountDefault; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/terminal/Location.java b/src/main/java/com/stripe/model/terminal/Location.java index d8e2ec39dd6..79964b5d293 100644 --- a/src/main/java/com/stripe/model/terminal/Location.java +++ b/src/main/java/com/stripe/model/terminal/Location.java @@ -66,8 +66,8 @@ public class Location extends ApiResource implements HasId, MetadataStore Long lastSeenAt; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/testhelpers/TestClock.java b/src/main/java/com/stripe/model/testhelpers/TestClock.java index e4648007508..278be69db50 100644 --- a/src/main/java/com/stripe/model/testhelpers/TestClock.java +++ b/src/main/java/com/stripe/model/testhelpers/TestClock.java @@ -53,8 +53,8 @@ public class TestClock extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/CreditReversal.java b/src/main/java/com/stripe/model/treasury/CreditReversal.java index 2ce933d3fc0..b39e71e1b68 100644 --- a/src/main/java/com/stripe/model/treasury/CreditReversal.java +++ b/src/main/java/com/stripe/model/treasury/CreditReversal.java @@ -62,8 +62,8 @@ public class CreditReversal extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/DebitReversal.java b/src/main/java/com/stripe/model/treasury/DebitReversal.java index f8792d561d6..fc15606863c 100644 --- a/src/main/java/com/stripe/model/treasury/DebitReversal.java +++ b/src/main/java/com/stripe/model/treasury/DebitReversal.java @@ -66,8 +66,8 @@ public class DebitReversal extends ApiResource implements HasId { LinkedFlows linkedFlows; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/FinancialAccount.java b/src/main/java/com/stripe/model/treasury/FinancialAccount.java index b807084b69b..20d5333a8cc 100644 --- a/src/main/java/com/stripe/model/treasury/FinancialAccount.java +++ b/src/main/java/com/stripe/model/treasury/FinancialAccount.java @@ -75,8 +75,8 @@ public class FinancialAccount extends ApiResource Boolean isDefault; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/InboundTransfer.java b/src/main/java/com/stripe/model/treasury/InboundTransfer.java index 12823ff7cf0..716e1fc50f3 100644 --- a/src/main/java/com/stripe/model/treasury/InboundTransfer.java +++ b/src/main/java/com/stripe/model/treasury/InboundTransfer.java @@ -88,8 +88,8 @@ public class InboundTransfer extends ApiResource implements HasId { LinkedFlows linkedFlows; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/OutboundPayment.java b/src/main/java/com/stripe/model/treasury/OutboundPayment.java index f70ee34eda2..d8ec5fb816c 100644 --- a/src/main/java/com/stripe/model/treasury/OutboundPayment.java +++ b/src/main/java/com/stripe/model/treasury/OutboundPayment.java @@ -114,8 +114,8 @@ public class OutboundPayment extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/OutboundTransfer.java b/src/main/java/com/stripe/model/treasury/OutboundTransfer.java index 5f6ba73877b..527f0d936c2 100644 --- a/src/main/java/com/stripe/model/treasury/OutboundTransfer.java +++ b/src/main/java/com/stripe/model/treasury/OutboundTransfer.java @@ -99,8 +99,8 @@ public class OutboundTransfer extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/ReceivedCredit.java b/src/main/java/com/stripe/model/treasury/ReceivedCredit.java index d7b6134a579..650e4e5b5cf 100644 --- a/src/main/java/com/stripe/model/treasury/ReceivedCredit.java +++ b/src/main/java/com/stripe/model/treasury/ReceivedCredit.java @@ -84,8 +84,8 @@ public class ReceivedCredit extends ApiResource implements HasId { LinkedFlows linkedFlows; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java index 6e7c5fb5b4f..aa5e6d61cc7 100644 --- a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java +++ b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java @@ -83,8 +83,8 @@ public class ReceivedDebit extends ApiResource implements HasId { LinkedFlows linkedFlows; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/Transaction.java b/src/main/java/com/stripe/model/treasury/Transaction.java index 155204693f2..6d113d57931 100644 --- a/src/main/java/com/stripe/model/treasury/Transaction.java +++ b/src/main/java/com/stripe/model/treasury/Transaction.java @@ -85,8 +85,8 @@ public class Transaction extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/TransactionEntry.java b/src/main/java/com/stripe/model/treasury/TransactionEntry.java index aa06ab900fc..64a439da80b 100644 --- a/src/main/java/com/stripe/model/treasury/TransactionEntry.java +++ b/src/main/java/com/stripe/model/treasury/TransactionEntry.java @@ -75,8 +75,8 @@ public class TransactionEntry extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/v2/core/Account.java b/src/main/java/com/stripe/model/v2/core/Account.java index 199ef950979..269497a1f2d 100644 --- a/src/main/java/com/stripe/model/v2/core/Account.java +++ b/src/main/java/com/stripe/model/v2/core/Account.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.List; import java.util.Map; @@ -4250,27 +4251,6 @@ public static class AnnualRevenue extends StripeObject { */ @SerializedName("fiscal_year_end") String fiscalYearEnd; - - /** Annual revenue amount in minor currency units (for example, '123' for 1.23 USD). */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** Documents that may be submitted to satisfy various informational requests. */ @@ -4649,30 +4629,6 @@ public static class MonthlyEstimatedRevenue extends StripeObject { */ @SerializedName("amount") Amount amount; - - /** - * Estimated monthly revenue amount in minor currency units (for example, '123' for 1.23 - * USD). - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** When the business was incorporated or registered. */ diff --git a/src/main/java/com/stripe/model/v2/core/EventDestination.java b/src/main/java/com/stripe/model/v2/core/EventDestination.java index 0aee20d9e9b..bcad2757070 100644 --- a/src/main/java/com/stripe/model/v2/core/EventDestination.java +++ b/src/main/java/com/stripe/model/v2/core/EventDestination.java @@ -46,7 +46,14 @@ public class EventDestination extends StripeObject implements HasId { @SerializedName("event_payload") String eventPayload; - /** Where events should be routed from. */ + /** + * Specifies which accounts' events route to this destination. {@code @self}: Receive events from + * the account that owns the event destination. {@code @accounts}: Receive events emitted from + * other accounts you manage which includes your v1 and v2 accounts. + * {@code @organization_members}: Receive events from accounts directly linked to the + * organization. {@code @organization_members/@accounts}: Receive events from all accounts + * connected to any platform accounts in the organization. + */ @SerializedName("events_from") List eventsFrom; diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index fa772ebc1e9..0bf0068ddde 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -1522,6 +1522,10 @@ public static class Capabilities { @SerializedName("twint_payments") TwintPayments twintPayments; + /** The upi_payments capability. */ + @SerializedName("upi_payments") + UpiPayments upiPayments; + /** The us_bank_account_ach_payments capability. */ @SerializedName("us_bank_account_ach_payments") UsBankAccountAchPayments usBankAccountAchPayments; @@ -1594,6 +1598,7 @@ private Capabilities( Transfers transfers, Treasury treasury, TwintPayments twintPayments, + UpiPayments upiPayments, UsBankAccountAchPayments usBankAccountAchPayments, UsBankTransferPayments usBankTransferPayments, ZipPayments zipPayments) { @@ -1656,6 +1661,7 @@ private Capabilities( this.transfers = transfers; this.treasury = treasury; this.twintPayments = twintPayments; + this.upiPayments = upiPayments; this.usBankAccountAchPayments = usBankAccountAchPayments; this.usBankTransferPayments = usBankTransferPayments; this.zipPayments = zipPayments; @@ -1784,6 +1790,8 @@ public static class Builder { private TwintPayments twintPayments; + private UpiPayments upiPayments; + private UsBankAccountAchPayments usBankAccountAchPayments; private UsBankTransferPayments usBankTransferPayments; @@ -1852,6 +1860,7 @@ public AccountCreateParams.Capabilities build() { this.transfers, this.treasury, this.twintPayments, + this.upiPayments, this.usBankAccountAchPayments, this.usBankTransferPayments, this.zipPayments); @@ -2277,6 +2286,12 @@ public Builder setTwintPayments( return this; } + /** The upi_payments capability. */ + public Builder setUpiPayments(AccountCreateParams.Capabilities.UpiPayments upiPayments) { + this.upiPayments = upiPayments; + return this; + } + /** The us_bank_account_ach_payments capability. */ public Builder setUsBankAccountAchPayments( AccountCreateParams.Capabilities.UsBankAccountAchPayments usBankAccountAchPayments) { @@ -6932,6 +6947,85 @@ public Builder setRequested(Boolean requested) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class UpiPayments { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * 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 {@code requirements} arrays. + */ + @SerializedName("requested") + Boolean requested; + + private UpiPayments(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Capabilities.UpiPayments build() { + return new AccountCreateParams.Capabilities.UpiPayments(this.extraParams, this.requested); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Capabilities.UpiPayments#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Capabilities.UpiPayments#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * 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 {@code requirements} arrays. + */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccountAchPayments { diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index f193b6d6e16..74f5ae9e5af 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -1623,6 +1623,10 @@ public static class Capabilities { @SerializedName("twint_payments") TwintPayments twintPayments; + /** The upi_payments capability. */ + @SerializedName("upi_payments") + UpiPayments upiPayments; + /** The us_bank_account_ach_payments capability. */ @SerializedName("us_bank_account_ach_payments") UsBankAccountAchPayments usBankAccountAchPayments; @@ -1695,6 +1699,7 @@ private Capabilities( Transfers transfers, Treasury treasury, TwintPayments twintPayments, + UpiPayments upiPayments, UsBankAccountAchPayments usBankAccountAchPayments, UsBankTransferPayments usBankTransferPayments, ZipPayments zipPayments) { @@ -1757,6 +1762,7 @@ private Capabilities( this.transfers = transfers; this.treasury = treasury; this.twintPayments = twintPayments; + this.upiPayments = upiPayments; this.usBankAccountAchPayments = usBankAccountAchPayments; this.usBankTransferPayments = usBankTransferPayments; this.zipPayments = zipPayments; @@ -1885,6 +1891,8 @@ public static class Builder { private TwintPayments twintPayments; + private UpiPayments upiPayments; + private UsBankAccountAchPayments usBankAccountAchPayments; private UsBankTransferPayments usBankTransferPayments; @@ -1953,6 +1961,7 @@ public AccountUpdateParams.Capabilities build() { this.transfers, this.treasury, this.twintPayments, + this.upiPayments, this.usBankAccountAchPayments, this.usBankTransferPayments, this.zipPayments); @@ -2378,6 +2387,12 @@ public Builder setTwintPayments( return this; } + /** The upi_payments capability. */ + public Builder setUpiPayments(AccountUpdateParams.Capabilities.UpiPayments upiPayments) { + this.upiPayments = upiPayments; + return this; + } + /** The us_bank_account_ach_payments capability. */ public Builder setUsBankAccountAchPayments( AccountUpdateParams.Capabilities.UsBankAccountAchPayments usBankAccountAchPayments) { @@ -7033,6 +7048,85 @@ public Builder setRequested(Boolean requested) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class UpiPayments { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * 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 {@code requirements} arrays. + */ + @SerializedName("requested") + Boolean requested; + + private UpiPayments(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Capabilities.UpiPayments build() { + return new AccountUpdateParams.Capabilities.UpiPayments(this.extraParams, this.requested); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Capabilities.UpiPayments#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Capabilities.UpiPayments#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * 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 {@code requirements} arrays. + */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccountAchPayments { diff --git a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java index ccdc86b5f71..40d7ffa7a3b 100644 --- a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java +++ b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java @@ -590,6 +590,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -665,6 +672,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -721,6 +729,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -837,6 +846,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -899,6 +910,7 @@ public ConfirmationTokenCreateParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1441,6 +1453,15 @@ public Builder setType(ConfirmationTokenCreateParams.PaymentMethodData.Type type return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(ConfirmationTokenCreateParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -5498,6 +5519,229 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfirmationTokenCreateParams.PaymentMethodData.Upi build() { + return new ConfirmationTokenCreateParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfirmationTokenCreateParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfirmationTokenCreateParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions build() { + return new ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -5941,6 +6185,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/CreditNoteCreateParams.java b/src/main/java/com/stripe/param/CreditNoteCreateParams.java index 4af8c7201f0..cedeeb465b2 100644 --- a/src/main/java/com/stripe/param/CreditNoteCreateParams.java +++ b/src/main/java/com/stripe/param/CreditNoteCreateParams.java @@ -452,6 +452,15 @@ public static class Line { @SerializedName("invoice_line_item") String invoiceLineItem; + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + /** The line item quantity to credit. */ @SerializedName("quantity") Long quantity; @@ -499,6 +508,7 @@ private Line( String description, Map extraParams, String invoiceLineItem, + Map metadata, Long quantity, Object taxAmounts, Object taxRates, @@ -509,6 +519,7 @@ private Line( this.description = description; this.extraParams = extraParams; this.invoiceLineItem = invoiceLineItem; + this.metadata = metadata; this.quantity = quantity; this.taxAmounts = taxAmounts; this.taxRates = taxRates; @@ -530,6 +541,8 @@ public static class Builder { private String invoiceLineItem; + private Map metadata; + private Long quantity; private Object taxAmounts; @@ -549,6 +562,7 @@ public CreditNoteCreateParams.Line build() { this.description, this.extraParams, this.invoiceLineItem, + this.metadata, this.quantity, this.taxAmounts, this.taxRates, @@ -610,6 +624,32 @@ public Builder setInvoiceLineItem(String invoiceLineItem) { return this; } + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * CreditNoteCreateParams.Line#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link CreditNoteCreateParams.Line#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + /** The line item quantity to credit. */ public Builder setQuantity(Long quantity) { this.quantity = quantity; diff --git a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java index cc81e9c9328..1d1dd8f82a6 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java @@ -523,6 +523,15 @@ public static class Line { @SerializedName("invoice_line_item") String invoiceLineItem; + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + /** The line item quantity to credit. */ @SerializedName("quantity") Long quantity; @@ -570,6 +579,7 @@ private Line( String description, Map extraParams, String invoiceLineItem, + Map metadata, Long quantity, Object taxAmounts, Object taxRates, @@ -580,6 +590,7 @@ private Line( this.description = description; this.extraParams = extraParams; this.invoiceLineItem = invoiceLineItem; + this.metadata = metadata; this.quantity = quantity; this.taxAmounts = taxAmounts; this.taxRates = taxRates; @@ -601,6 +612,8 @@ public static class Builder { private String invoiceLineItem; + private Map metadata; + private Long quantity; private Object taxAmounts; @@ -620,6 +633,7 @@ public CreditNotePreviewLinesListParams.Line build() { this.description, this.extraParams, this.invoiceLineItem, + this.metadata, this.quantity, this.taxAmounts, this.taxRates, @@ -681,6 +695,32 @@ public Builder setInvoiceLineItem(String invoiceLineItem) { return this; } + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * CreditNotePreviewLinesListParams.Line#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link CreditNotePreviewLinesListParams.Line#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + /** The line item quantity to credit. */ public Builder setQuantity(Long quantity) { this.quantity = quantity; diff --git a/src/main/java/com/stripe/param/CreditNotePreviewParams.java b/src/main/java/com/stripe/param/CreditNotePreviewParams.java index 68518736636..69350171b81 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewParams.java @@ -452,6 +452,15 @@ public static class Line { @SerializedName("invoice_line_item") String invoiceLineItem; + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + /** The line item quantity to credit. */ @SerializedName("quantity") Long quantity; @@ -499,6 +508,7 @@ private Line( String description, Map extraParams, String invoiceLineItem, + Map metadata, Long quantity, Object taxAmounts, Object taxRates, @@ -509,6 +519,7 @@ private Line( this.description = description; this.extraParams = extraParams; this.invoiceLineItem = invoiceLineItem; + this.metadata = metadata; this.quantity = quantity; this.taxAmounts = taxAmounts; this.taxRates = taxRates; @@ -530,6 +541,8 @@ public static class Builder { private String invoiceLineItem; + private Map metadata; + private Long quantity; private Object taxAmounts; @@ -549,6 +562,7 @@ public CreditNotePreviewParams.Line build() { this.description, this.extraParams, this.invoiceLineItem, + this.metadata, this.quantity, this.taxAmounts, this.taxRates, @@ -610,6 +624,32 @@ public Builder setInvoiceLineItem(String invoiceLineItem) { return this; } + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * CreditNotePreviewParams.Line#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link CreditNotePreviewParams.Line#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + /** The line item quantity to credit. */ public Builder setQuantity(Long quantity) { this.quantity = quantity; diff --git a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java index 9402cf8bf71..1e032df4801 100644 --- a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java +++ b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java @@ -384,6 +384,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java index 517eae5b7fe..853df8e5ad5 100644 --- a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java @@ -384,6 +384,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/InvoiceAddLinesParams.java b/src/main/java/com/stripe/param/InvoiceAddLinesParams.java index 6a56e9e115c..af872b4e00e 100644 --- a/src/main/java/com/stripe/param/InvoiceAddLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceAddLinesParams.java @@ -279,10 +279,20 @@ public static class Line { @SerializedName("pricing") Pricing pricing; - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + @SerializedName("quantity_decimal") + BigDecimal quantityDecimal; + /** * A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes * on your own or use a third-party to calculate them. You cannot set tax amounts if any line @@ -316,6 +326,7 @@ private Line( PriceData priceData, Pricing pricing, Long quantity, + BigDecimal quantityDecimal, Object taxAmounts, Object taxRates) { this.amount = amount; @@ -329,6 +340,7 @@ private Line( this.priceData = priceData; this.pricing = pricing; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.taxAmounts = taxAmounts; this.taxRates = taxRates; } @@ -360,6 +372,8 @@ public static class Builder { private Long quantity; + private BigDecimal quantityDecimal; + private Object taxAmounts; private Object taxRates; @@ -378,6 +392,7 @@ public InvoiceAddLinesParams.Line build() { this.priceData, this.pricing, this.quantity, + this.quantityDecimal, this.taxAmounts, this.taxRates); } @@ -572,12 +587,25 @@ public Builder setPricing(InvoiceAddLinesParams.Line.Pricing pricing) { return this; } - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line + * item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * Add an element to `taxAmounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link diff --git a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java index fea9bd6b50e..eda26010906 100644 --- a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java @@ -2052,10 +2052,21 @@ public static class InvoiceItem { @SerializedName("price_data") PriceData priceData; - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code + * quantity_decimal} instead to provide decimal precision. This field will be deprecated in + * favor of {@code quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice + * item. + */ + @SerializedName("quantity_decimal") + BigDecimal quantityDecimal; + /** * Only required if a default @@ -2107,6 +2118,7 @@ private InvoiceItem( String price, PriceData priceData, Long quantity, + BigDecimal quantityDecimal, TaxBehavior taxBehavior, Object taxCode, Object taxRates, @@ -2124,6 +2136,7 @@ private InvoiceItem( this.price = price; this.priceData = priceData; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.taxBehavior = taxBehavior; this.taxCode = taxCode; this.taxRates = taxRates; @@ -2160,6 +2173,8 @@ public static class Builder { private Long quantity; + private BigDecimal quantityDecimal; + private TaxBehavior taxBehavior; private Object taxCode; @@ -2185,6 +2200,7 @@ public InvoiceCreatePreviewParams.InvoiceItem build() { this.price, this.priceData, this.quantity, + this.quantityDecimal, this.taxBehavior, this.taxCode, this.taxRates, @@ -2380,12 +2396,25 @@ public Builder setPriceData(InvoiceCreatePreviewParams.InvoiceItem.PriceData pri return this; } - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code + * quantity_decimal} instead to provide decimal precision. This field will be deprecated in + * favor of {@code quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice + * item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * Only required if a default diff --git a/src/main/java/com/stripe/param/InvoiceItemCreateParams.java b/src/main/java/com/stripe/param/InvoiceItemCreateParams.java index fa63985c47e..0854b6552a5 100644 --- a/src/main/java/com/stripe/param/InvoiceItemCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceItemCreateParams.java @@ -114,10 +114,21 @@ public class InvoiceItemCreateParams extends ApiRequestParams { @SerializedName("pricing") Pricing pricing; - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice + * item. + */ + @SerializedName("quantity_decimal") + BigDecimal quantityDecimal; + /** * The ID of a subscription to add this invoice item to. When left blank, the invoice item is * added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions @@ -174,6 +185,7 @@ private InvoiceItemCreateParams( PriceData priceData, Pricing pricing, Long quantity, + BigDecimal quantityDecimal, String subscription, TaxBehavior taxBehavior, Object taxCode, @@ -194,6 +206,7 @@ private InvoiceItemCreateParams( this.priceData = priceData; this.pricing = pricing; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.subscription = subscription; this.taxBehavior = taxBehavior; this.taxCode = taxCode; @@ -236,6 +249,8 @@ public static class Builder { private Long quantity; + private BigDecimal quantityDecimal; + private String subscription; private TaxBehavior taxBehavior; @@ -264,6 +279,7 @@ public InvoiceItemCreateParams build() { this.priceData, this.pricing, this.quantity, + this.quantityDecimal, this.subscription, this.taxBehavior, this.taxCode, @@ -510,12 +526,25 @@ public Builder setPricing(InvoiceItemCreateParams.Pricing pricing) { return this; } - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code + * quantity_decimal} instead to provide decimal precision. This field will be deprecated in + * favor of {@code quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice + * item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * The ID of a subscription to add this invoice item to. When left blank, the invoice item is * added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions diff --git a/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java b/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java index 6ec7f103dd1..9983850bc28 100644 --- a/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java @@ -89,10 +89,20 @@ public class InvoiceItemUpdateParams extends ApiRequestParams { @SerializedName("pricing") Pricing pricing; - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + @SerializedName("quantity_decimal") + Object quantityDecimal; + /** * Only required if a default @@ -137,6 +147,7 @@ private InvoiceItemUpdateParams( PriceData priceData, Pricing pricing, Long quantity, + Object quantityDecimal, TaxBehavior taxBehavior, Object taxCode, Object taxRates, @@ -152,6 +163,7 @@ private InvoiceItemUpdateParams( this.priceData = priceData; this.pricing = pricing; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.taxBehavior = taxBehavior; this.taxCode = taxCode; this.taxRates = taxRates; @@ -185,6 +197,8 @@ public static class Builder { private Long quantity; + private Object quantityDecimal; + private TaxBehavior taxBehavior; private Object taxCode; @@ -207,6 +221,7 @@ public InvoiceItemUpdateParams build() { this.priceData, this.pricing, this.quantity, + this.quantityDecimal, this.taxBehavior, this.taxCode, this.taxRates, @@ -428,12 +443,32 @@ public Builder setPricing(InvoiceItemUpdateParams.Pricing pricing) { return this; } - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code + * quantity_decimal} instead to provide decimal precision. This field will be deprecated in + * favor of {@code quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + public Builder setQuantityDecimal(EmptyParam quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * Only required if a default diff --git a/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java b/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java index a5536459b48..a4b277944b0 100644 --- a/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java @@ -62,11 +62,10 @@ public class InvoiceLineItemUpdateParams extends ApiRequestParams { * to an object. This can be useful for storing additional information about the object in a * structured format. Individual keys can be unset by posting an empty value to them. All keys can * be unset by posting an empty value to {@code metadata}. For type=subscription - * line items, the incoming metadata specified on the request is directly used to set this value, - * in contrast to type=invoiceitem line items, - * where any existing metadata on the invoice line is merged with the incoming data. + * href="https://stripe.com/api/invoices/line_item">type=subscription line items, the incoming + * metadata specified on the request is directly used to set this value, in contrast to type=invoiceitem line items, where any + * existing metadata on the invoice line is merged with the incoming data. */ @SerializedName("metadata") Object metadata; @@ -93,10 +92,20 @@ public class InvoiceLineItemUpdateParams extends ApiRequestParams { @SerializedName("pricing") Pricing pricing; - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + @SerializedName("quantity_decimal") + Object quantityDecimal; + /** * A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on * your own or use a third-party to calculate them. You cannot set tax amounts if any line item @@ -130,6 +139,7 @@ private InvoiceLineItemUpdateParams( PriceData priceData, Pricing pricing, Long quantity, + Object quantityDecimal, Object taxAmounts, Object taxRates) { this.amount = amount; @@ -143,6 +153,7 @@ private InvoiceLineItemUpdateParams( this.priceData = priceData; this.pricing = pricing; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.taxAmounts = taxAmounts; this.taxRates = taxRates; } @@ -174,6 +185,8 @@ public static class Builder { private Long quantity; + private Object quantityDecimal; + private Object taxAmounts; private Object taxRates; @@ -192,6 +205,7 @@ public InvoiceLineItemUpdateParams build() { this.priceData, this.pricing, this.quantity, + this.quantityDecimal, this.taxAmounts, this.taxRates); } @@ -365,11 +379,10 @@ public Builder putAllMetadata(Map map) { * to an object. This can be useful for storing additional information about the object in a * structured format. Individual keys can be unset by posting an empty value to them. All keys * can be unset by posting an empty value to {@code metadata}. For type=subscription - * line items, the incoming metadata specified on the request is directly used to set this - * value, in contrast to type=invoiceitem line items, - * where any existing metadata on the invoice line is merged with the incoming data. + * href="https://stripe.com/api/invoices/line_item">type=subscription line items, the + * incoming metadata specified on the request is directly used to set this value, in contrast to + * type=invoiceitem line items, where + * any existing metadata on the invoice line is merged with the incoming data. */ public Builder setMetadata(EmptyParam metadata) { this.metadata = metadata; @@ -381,11 +394,10 @@ public Builder setMetadata(EmptyParam metadata) { * to an object. This can be useful for storing additional information about the object in a * structured format. Individual keys can be unset by posting an empty value to them. All keys * can be unset by posting an empty value to {@code metadata}. For type=subscription - * line items, the incoming metadata specified on the request is directly used to set this - * value, in contrast to type=invoiceitem line items, - * where any existing metadata on the invoice line is merged with the incoming data. + * href="https://stripe.com/api/invoices/line_item">type=subscription line items, the + * incoming metadata specified on the request is directly used to set this value, in contrast to + * type=invoiceitem line items, where + * any existing metadata on the invoice line is merged with the incoming data. */ public Builder setMetadata(Map metadata) { this.metadata = metadata; @@ -420,12 +432,32 @@ public Builder setPricing(InvoiceLineItemUpdateParams.Pricing pricing) { return this; } - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + public Builder setQuantityDecimal(EmptyParam quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * Add an element to `taxAmounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link diff --git a/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java b/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java index 2cfd34330de..7937d6dc2b3 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java @@ -296,10 +296,20 @@ public static class Line { @SerializedName("pricing") Pricing pricing; - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + @SerializedName("quantity_decimal") + BigDecimal quantityDecimal; + /** * A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes * on your own or use a third-party to calculate them. You cannot set tax amounts if any line @@ -333,6 +343,7 @@ private Line( PriceData priceData, Pricing pricing, Long quantity, + BigDecimal quantityDecimal, Object taxAmounts, Object taxRates) { this.amount = amount; @@ -346,6 +357,7 @@ private Line( this.priceData = priceData; this.pricing = pricing; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.taxAmounts = taxAmounts; this.taxRates = taxRates; } @@ -377,6 +389,8 @@ public static class Builder { private Long quantity; + private BigDecimal quantityDecimal; + private Object taxAmounts; private Object taxRates; @@ -395,6 +409,7 @@ public InvoiceUpdateLinesParams.Line build() { this.priceData, this.pricing, this.quantity, + this.quantityDecimal, this.taxAmounts, this.taxRates); } @@ -596,12 +611,25 @@ public Builder setPricing(InvoiceUpdateLinesParams.Line.Pricing pricing) { return this; } - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line + * item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * Add an element to `taxAmounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 380152b2943..d1b7defa9bf 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -3163,6 +3163,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -3238,6 +3245,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -3294,6 +3302,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -3410,6 +3419,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -3472,6 +3483,7 @@ public PaymentIntentConfirmParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -4011,6 +4023,15 @@ public Builder setType(PaymentIntentConfirmParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(PaymentIntentConfirmParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -8055,6 +8076,229 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodData.Upi build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -8496,6 +8740,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -8866,6 +9113,13 @@ public static class PaymentMethodOptions { @SerializedName("twint") Object twint; + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Object upi; + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about the * US bank account payment method options. @@ -8938,6 +9192,7 @@ private PaymentMethodOptions( Object sofort, Object swish, Object twint, + Object upi, Object usBankAccount, Object wechatPay, Object zip) { @@ -8991,6 +9246,7 @@ private PaymentMethodOptions( this.sofort = sofort; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -9101,6 +9357,8 @@ public static class Builder { private Object twint; + private Object upi; + private Object usBankAccount; private Object wechatPay; @@ -9160,6 +9418,7 @@ public PaymentIntentConfirmParams.PaymentMethodOptions build() { this.sofort, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -10088,6 +10347,24 @@ public Builder setTwint(EmptyParam twint) { return this; } + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(PaymentIntentConfirmParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(EmptyParam upi) { + this.upi = upi; + return this; + } + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about * the US bank account payment method options. @@ -10195,7 +10472,7 @@ public static class AcssDebit { @SerializedName("target_date") String targetDate; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -10343,7 +10620,7 @@ public Builder setTargetDate(String targetDate) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -13518,7 +13795,10 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -13653,7 +13933,10 @@ public PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions build this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -22182,6 +22465,267 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodOptions.Upi build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -22206,10 +22750,6 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Preferred transaction settlement speed. */ - @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -22248,7 +22788,7 @@ public static class UsBankAccount { @SerializedName("transaction_purpose") ApiRequestParams.EnumParam transactionPurpose; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -22257,7 +22797,6 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, String targetDate, ApiRequestParams.EnumParam transactionPurpose, @@ -22266,7 +22805,6 @@ private UsBankAccount( this.financialConnections = financialConnections; this.mandateOptions = mandateOptions; this.networks = networks; - this.preferredSettlementSpeed = preferredSettlementSpeed; this.setupFutureUsage = setupFutureUsage; this.targetDate = targetDate; this.transactionPurpose = transactionPurpose; @@ -22286,8 +22824,6 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; - private ApiRequestParams.EnumParam setupFutureUsage; private String targetDate; @@ -22303,7 +22839,6 @@ public PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount build() { this.financialConnections, this.mandateOptions, this.networks, - this.preferredSettlementSpeed, this.setupFutureUsage, this.targetDate, this.transactionPurpose, @@ -22363,20 +22898,6 @@ public Builder setNetworks( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed( - PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.PreferredSettlementSpeed - preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. @@ -22461,7 +22982,7 @@ public Builder setTransactionPurpose(EmptyParam transactionPurpose) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { @@ -23083,21 +23604,6 @@ public enum Requested implements ApiRequestParams.EnumParam { } } - public enum PreferredSettlementSpeed implements ApiRequestParams.EnumParam { - @SerializedName("fastest") - FASTEST("fastest"), - - @SerializedName("standard") - STANDARD("standard"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - PreferredSettlementSpeed(String value) { - this.value = value; - } - } - public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), @@ -24003,6 +24509,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 97ad5db0d0c..52236d32165 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -3696,6 +3696,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -3771,6 +3778,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -3827,6 +3835,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -3943,6 +3952,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -4005,6 +4016,7 @@ public PaymentIntentCreateParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -4537,6 +4549,15 @@ public Builder setType(PaymentIntentCreateParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(PaymentIntentCreateParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -8575,6 +8596,229 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodData.Upi build() { + return new PaymentIntentCreateParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions build() { + return new PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -9016,6 +9260,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -9386,6 +9633,13 @@ public static class PaymentMethodOptions { @SerializedName("twint") Object twint; + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Object upi; + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about the * US bank account payment method options. @@ -9458,6 +9712,7 @@ private PaymentMethodOptions( Object sofort, Object swish, Object twint, + Object upi, Object usBankAccount, Object wechatPay, Object zip) { @@ -9511,6 +9766,7 @@ private PaymentMethodOptions( this.sofort = sofort; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -9621,6 +9877,8 @@ public static class Builder { private Object twint; + private Object upi; + private Object usBankAccount; private Object wechatPay; @@ -9680,6 +9938,7 @@ public PaymentIntentCreateParams.PaymentMethodOptions build() { this.sofort, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -10605,6 +10864,24 @@ public Builder setTwint(EmptyParam twint) { return this; } + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(PaymentIntentCreateParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(EmptyParam upi) { + this.upi = upi; + return this; + } + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about * the US bank account payment method options. @@ -10712,7 +10989,7 @@ public static class AcssDebit { @SerializedName("target_date") String targetDate; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -10860,7 +11137,7 @@ public Builder setTargetDate(String targetDate) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -14033,7 +14310,10 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -14168,7 +14448,10 @@ public PaymentIntentCreateParams.PaymentMethodOptions.Card.MandateOptions build( this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -22684,6 +22967,267 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodOptions.Upi build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -22708,10 +23252,6 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Preferred transaction settlement speed. */ - @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -22750,7 +23290,7 @@ public static class UsBankAccount { @SerializedName("transaction_purpose") ApiRequestParams.EnumParam transactionPurpose; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -22759,7 +23299,6 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, String targetDate, ApiRequestParams.EnumParam transactionPurpose, @@ -22768,7 +23307,6 @@ private UsBankAccount( this.financialConnections = financialConnections; this.mandateOptions = mandateOptions; this.networks = networks; - this.preferredSettlementSpeed = preferredSettlementSpeed; this.setupFutureUsage = setupFutureUsage; this.targetDate = targetDate; this.transactionPurpose = transactionPurpose; @@ -22788,8 +23326,6 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; - private ApiRequestParams.EnumParam setupFutureUsage; private String targetDate; @@ -22805,7 +23341,6 @@ public PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount build() { this.financialConnections, this.mandateOptions, this.networks, - this.preferredSettlementSpeed, this.setupFutureUsage, this.targetDate, this.transactionPurpose, @@ -22863,20 +23398,6 @@ public Builder setNetworks( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed( - PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.PreferredSettlementSpeed - preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. @@ -22961,7 +23482,7 @@ public Builder setTransactionPurpose(EmptyParam transactionPurpose) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { @@ -23583,21 +24104,6 @@ public enum Requested implements ApiRequestParams.EnumParam { } } - public enum PreferredSettlementSpeed implements ApiRequestParams.EnumParam { - @SerializedName("fastest") - FASTEST("fastest"), - - @SerializedName("standard") - STANDARD("standard"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - PreferredSettlementSpeed(String value) { - this.value = value; - } - } - public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), @@ -24626,6 +25132,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 36189aa82ed..554a8d43d30 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -3173,6 +3173,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -3248,6 +3255,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -3304,6 +3312,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -3420,6 +3429,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -3482,6 +3493,7 @@ public PaymentIntentUpdateParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -4014,6 +4026,15 @@ public Builder setType(PaymentIntentUpdateParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(PaymentIntentUpdateParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -8226,6 +8247,238 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodData.Upi build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + Object description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + Object description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private Object description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -8685,6 +8938,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -9055,6 +9311,13 @@ public static class PaymentMethodOptions { @SerializedName("twint") Object twint; + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Object upi; + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about the * US bank account payment method options. @@ -9127,6 +9390,7 @@ private PaymentMethodOptions( Object sofort, Object swish, Object twint, + Object upi, Object usBankAccount, Object wechatPay, Object zip) { @@ -9180,6 +9444,7 @@ private PaymentMethodOptions( this.sofort = sofort; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -9290,6 +9555,8 @@ public static class Builder { private Object twint; + private Object upi; + private Object usBankAccount; private Object wechatPay; @@ -9349,6 +9616,7 @@ public PaymentIntentUpdateParams.PaymentMethodOptions build() { this.sofort, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -10274,6 +10542,24 @@ public Builder setTwint(EmptyParam twint) { return this; } + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(PaymentIntentUpdateParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(EmptyParam upi) { + this.upi = upi; + return this; + } + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about * the US bank account payment method options. @@ -10381,7 +10667,7 @@ public static class AcssDebit { @SerializedName("target_date") Object targetDate; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -10539,7 +10825,7 @@ public Builder setTargetDate(EmptyParam targetDate) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -13778,7 +14064,10 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -13913,7 +14202,10 @@ public PaymentIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions build( this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -22561,6 +22853,276 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodOptions.Upi build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + Object description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + Object description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private Object description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -22585,10 +23147,6 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Preferred transaction settlement speed. */ - @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -22627,7 +23185,7 @@ public static class UsBankAccount { @SerializedName("transaction_purpose") ApiRequestParams.EnumParam transactionPurpose; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -22636,7 +23194,6 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, Object targetDate, ApiRequestParams.EnumParam transactionPurpose, @@ -22645,7 +23202,6 @@ private UsBankAccount( this.financialConnections = financialConnections; this.mandateOptions = mandateOptions; this.networks = networks; - this.preferredSettlementSpeed = preferredSettlementSpeed; this.setupFutureUsage = setupFutureUsage; this.targetDate = targetDate; this.transactionPurpose = transactionPurpose; @@ -22665,8 +23221,6 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; - private ApiRequestParams.EnumParam setupFutureUsage; private Object targetDate; @@ -22682,7 +23236,6 @@ public PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount build() { this.financialConnections, this.mandateOptions, this.networks, - this.preferredSettlementSpeed, this.setupFutureUsage, this.targetDate, this.transactionPurpose, @@ -22740,20 +23293,6 @@ public Builder setNetworks( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed( - PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.PreferredSettlementSpeed - preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. @@ -22848,7 +23387,7 @@ public Builder setTransactionPurpose(EmptyParam transactionPurpose) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { @@ -23479,21 +24018,6 @@ public enum Requested implements ApiRequestParams.EnumParam { } } - public enum PreferredSettlementSpeed implements ApiRequestParams.EnumParam { - @SerializedName("fastest") - FASTEST("fastest"), - - @SerializedName("standard") - STANDARD("standard"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - PreferredSettlementSpeed(String value) { - this.value = value; - } - } - public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), @@ -24465,6 +24989,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 031e01a8480..53da9a4cff8 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -7095,6 +7095,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index 43bb3383dec..efe8f622b7d 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -6157,6 +6157,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java index a4cae983f99..06285487626 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java @@ -487,6 +487,13 @@ public class PaymentMethodConfigurationCreateParams extends ApiRequestParams { @SerializedName("twint") Twint twint; + /** + * Unified Payment Interface (UPI) is India's leading payment method with exponential growth since + * it launched in 2016. + */ + @SerializedName("upi") + Upi upi; + /** * Stripe users in the United States can accept ACH direct debit payments from customers with a US * bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check @@ -571,6 +578,7 @@ private PaymentMethodConfigurationCreateParams( Sofort sofort, Swish swish, Twint twint, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -631,6 +639,7 @@ private PaymentMethodConfigurationCreateParams( this.sofort = sofort; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -755,6 +764,8 @@ public static class Builder { private Twint twint; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -821,6 +832,7 @@ public PaymentMethodConfigurationCreateParams build() { this.sofort, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1459,6 +1471,15 @@ public Builder setTwint(PaymentMethodConfigurationCreateParams.Twint twint) { return this; } + /** + * Unified Payment Interface (UPI) is India's leading payment method with exponential growth + * since it launched in 2016. + */ + public Builder setUpi(PaymentMethodConfigurationCreateParams.Upi upi) { + this.upi = upi; + return this; + } + /** * Stripe users in the United States can accept ACH direct debit payments from customers with a * US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. @@ -10271,6 +10292,169 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Upi(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.Upi build() { + return new PaymentMethodConfigurationCreateParams.Upi( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationCreateParams.Upi.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodConfigurationCreateParams.Upi#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodConfigurationCreateParams.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.Upi.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.Upi.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentMethodConfigurationCreateParams.Upi.DisplayPreference#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentMethodConfigurationCreateParams.Upi.DisplayPreference#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationCreateParams.Upi.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java index 1261aa9fceb..e6b3024243b 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java @@ -488,6 +488,13 @@ public class PaymentMethodConfigurationUpdateParams extends ApiRequestParams { @SerializedName("twint") Twint twint; + /** + * Unified Payment Interface (UPI) is India's leading payment method with exponential growth since + * it launched in 2016. + */ + @SerializedName("upi") + Upi upi; + /** * Stripe users in the United States can accept ACH direct debit payments from customers with a US * bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check @@ -572,6 +579,7 @@ private PaymentMethodConfigurationUpdateParams( Sofort sofort, Swish swish, Twint twint, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -632,6 +640,7 @@ private PaymentMethodConfigurationUpdateParams( this.sofort = sofort; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -756,6 +765,8 @@ public static class Builder { private Twint twint; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -822,6 +833,7 @@ public PaymentMethodConfigurationUpdateParams build() { this.sofort, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1466,6 +1478,15 @@ public Builder setTwint(PaymentMethodConfigurationUpdateParams.Twint twint) { return this; } + /** + * Unified Payment Interface (UPI) is India's leading payment method with exponential growth + * since it launched in 2016. + */ + public Builder setUpi(PaymentMethodConfigurationUpdateParams.Upi upi) { + this.upi = upi; + return this; + } + /** * Stripe users in the United States can accept ACH direct debit payments from customers with a * US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. @@ -10278,6 +10299,169 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Upi(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.Upi build() { + return new PaymentMethodConfigurationUpdateParams.Upi( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodConfigurationUpdateParams.Upi#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodConfigurationUpdateParams.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index 6a80db12abd..0503208963d 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -415,6 +415,13 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -495,6 +502,7 @@ private PaymentMethodCreateParams( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -556,6 +564,7 @@ private PaymentMethodCreateParams( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -682,6 +691,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -749,6 +760,7 @@ public PaymentMethodCreateParams build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1340,6 +1352,15 @@ public Builder setType(PaymentMethodCreateParams.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(PaymentMethodCreateParams.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -5651,6 +5672,221 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodCreateParams.Upi build() { + return new PaymentMethodCreateParams.Upi(this.extraParams, this.mandateOptions); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodCreateParams.Upi#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodCreateParams.Upi#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentMethodCreateParams.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param refers + * to the exact amount to be charged in future payments. If {@code maximum}, the amount + * charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodCreateParams.Upi.MandateOptions build() { + return new PaymentMethodCreateParams.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentMethodCreateParams.Upi.MandateOptions.AmountType amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentMethodCreateParams.Upi.MandateOptions#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentMethodCreateParams.Upi.MandateOptions#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -6092,6 +6328,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentMethodListParams.java b/src/main/java/com/stripe/param/PaymentMethodListParams.java index b9ed4dcb712..82cf1b5d0ae 100644 --- a/src/main/java/com/stripe/param/PaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodListParams.java @@ -412,6 +412,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index 6758c5ef32b..37457541478 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -1004,6 +1004,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -1079,6 +1086,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -1135,6 +1143,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -1251,6 +1260,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -1313,6 +1324,7 @@ public SetupIntentConfirmParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1845,6 +1857,15 @@ public Builder setType(SetupIntentConfirmParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(SetupIntentConfirmParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -5883,6 +5904,228 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodData.Upi build() { + return new SetupIntentConfirmParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentConfirmParams.PaymentMethodData.Upi#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentConfirmParams.PaymentMethodData.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions build() { + return new SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions.AmountType amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -6324,6 +6567,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -6421,6 +6667,13 @@ public static class PaymentMethodOptions { @SerializedName("sepa_debit") SepaDebit sepaDebit; + /** + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Upi upi; + /** * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the US * bank account payment method options. @@ -6440,6 +6693,7 @@ private PaymentMethodOptions( Paypal paypal, Payto payto, SepaDebit sepaDebit, + Upi upi, UsBankAccount usBankAccount) { this.acssDebit = acssDebit; this.amazonPay = amazonPay; @@ -6452,6 +6706,7 @@ private PaymentMethodOptions( this.paypal = paypal; this.payto = payto; this.sepaDebit = sepaDebit; + this.upi = upi; this.usBankAccount = usBankAccount; } @@ -6482,6 +6737,8 @@ public static class Builder { private SepaDebit sepaDebit; + private Upi upi; + private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ @@ -6498,6 +6755,7 @@ public SetupIntentConfirmParams.PaymentMethodOptions build() { this.paypal, this.payto, this.sepaDebit, + this.upi, this.usBankAccount); } @@ -6620,6 +6878,15 @@ public Builder setSepaDebit( return this; } + /** + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + public Builder setUpi(SetupIntentConfirmParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the * US bank account payment method options. @@ -6655,7 +6922,7 @@ public static class AcssDebit { @SerializedName("mandate_options") MandateOptions mandateOptions; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -6735,7 +7002,7 @@ public Builder setMandateOptions( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -7433,7 +7700,10 @@ public Builder setThreeDSecure( @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -7582,7 +7852,10 @@ public SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions build() this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -9957,6 +10230,267 @@ public Builder setReferencePrefix(EmptyParam referencePrefix) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodOptions.Upi build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentConfirmParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentConfirmParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + SetupIntentConfirmParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -9981,7 +10515,7 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -10074,7 +10608,7 @@ public Builder setNetworks( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index df0d34e227b..e500e560311 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -1542,6 +1542,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -1617,6 +1624,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -1673,6 +1681,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -1789,6 +1798,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -1851,6 +1862,7 @@ public SetupIntentCreateParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -2382,6 +2394,15 @@ public Builder setType(SetupIntentCreateParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(SetupIntentCreateParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -6419,6 +6440,228 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodData.Upi build() { + return new SetupIntentCreateParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentCreateParams.PaymentMethodData.Upi#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentCreateParams.PaymentMethodData.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions build() { + return new SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions.AmountType amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -6860,6 +7103,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -6957,6 +7203,13 @@ public static class PaymentMethodOptions { @SerializedName("sepa_debit") SepaDebit sepaDebit; + /** + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Upi upi; + /** * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the US * bank account payment method options. @@ -6976,6 +7229,7 @@ private PaymentMethodOptions( Paypal paypal, Payto payto, SepaDebit sepaDebit, + Upi upi, UsBankAccount usBankAccount) { this.acssDebit = acssDebit; this.amazonPay = amazonPay; @@ -6988,6 +7242,7 @@ private PaymentMethodOptions( this.paypal = paypal; this.payto = payto; this.sepaDebit = sepaDebit; + this.upi = upi; this.usBankAccount = usBankAccount; } @@ -7018,6 +7273,8 @@ public static class Builder { private SepaDebit sepaDebit; + private Upi upi; + private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ @@ -7034,6 +7291,7 @@ public SetupIntentCreateParams.PaymentMethodOptions build() { this.paypal, this.payto, this.sepaDebit, + this.upi, this.usBankAccount); } @@ -7156,6 +7414,15 @@ public Builder setSepaDebit( return this; } + /** + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + public Builder setUpi(SetupIntentCreateParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the * US bank account payment method options. @@ -7191,7 +7458,7 @@ public static class AcssDebit { @SerializedName("mandate_options") MandateOptions mandateOptions; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -7271,7 +7538,7 @@ public Builder setMandateOptions( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -7967,7 +8234,10 @@ public Builder setThreeDSecure( @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -8116,7 +8386,10 @@ public SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions build() this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -10491,6 +10764,267 @@ public Builder setReferencePrefix(EmptyParam referencePrefix) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodOptions.Upi build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentCreateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentCreateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + SetupIntentCreateParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -10515,7 +11049,7 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -10608,7 +11142,7 @@ public Builder setNetworks( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { @@ -11496,6 +12030,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index 60c1dd1bbb0..d6c0d53b3a2 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -911,6 +911,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -986,6 +993,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -1042,6 +1050,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -1158,6 +1167,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -1220,6 +1231,7 @@ public SetupIntentUpdateParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1751,6 +1763,15 @@ public Builder setType(SetupIntentUpdateParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(SetupIntentUpdateParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -5962,6 +5983,237 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodData.Upi build() { + return new SetupIntentUpdateParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentUpdateParams.PaymentMethodData.Upi#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentUpdateParams.PaymentMethodData.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + Object description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + Object description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private Object description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions build() { + return new SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions.AmountType amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -6421,6 +6673,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -6518,6 +6773,13 @@ public static class PaymentMethodOptions { @SerializedName("sepa_debit") SepaDebit sepaDebit; + /** + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Upi upi; + /** * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the US * bank account payment method options. @@ -6537,6 +6799,7 @@ private PaymentMethodOptions( Paypal paypal, Payto payto, SepaDebit sepaDebit, + Upi upi, UsBankAccount usBankAccount) { this.acssDebit = acssDebit; this.amazonPay = amazonPay; @@ -6549,6 +6812,7 @@ private PaymentMethodOptions( this.paypal = paypal; this.payto = payto; this.sepaDebit = sepaDebit; + this.upi = upi; this.usBankAccount = usBankAccount; } @@ -6579,6 +6843,8 @@ public static class Builder { private SepaDebit sepaDebit; + private Upi upi; + private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ @@ -6595,6 +6861,7 @@ public SetupIntentUpdateParams.PaymentMethodOptions build() { this.paypal, this.payto, this.sepaDebit, + this.upi, this.usBankAccount); } @@ -6717,6 +6984,15 @@ public Builder setSepaDebit( return this; } + /** + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + public Builder setUpi(SetupIntentUpdateParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the * US bank account payment method options. @@ -6752,7 +7028,7 @@ public static class AcssDebit { @SerializedName("mandate_options") MandateOptions mandateOptions; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -6832,7 +7108,7 @@ public Builder setMandateOptions( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -7537,7 +7813,10 @@ public Builder setThreeDSecure( @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -7686,7 +7965,10 @@ public SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions build() this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -10172,6 +10454,276 @@ public Builder setReferencePrefix(EmptyParam referencePrefix) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodOptions.Upi build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentUpdateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentUpdateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + SetupIntentUpdateParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + Object description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + Object description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private Object description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -10196,7 +10748,7 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -10289,7 +10841,7 @@ public Builder setNetworks( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { @@ -11078,6 +11630,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index 22abddda759..03ff21eb8fd 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -251,8 +251,8 @@ public class SubscriptionCreateParams extends ApiRequestParams { /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ @SerializedName("pending_invoice_item_interval") Object pendingInvoiceItemInterval; @@ -1022,8 +1022,8 @@ public Builder setPaymentSettings(SubscriptionCreateParams.PaymentSettings payme /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval( SubscriptionCreateParams.PendingInvoiceItemInterval pendingInvoiceItemInterval) { @@ -1033,8 +1033,8 @@ public Builder setPendingInvoiceItemInterval( /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval(EmptyParam pendingInvoiceItemInterval) { this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; @@ -4714,7 +4714,7 @@ public Builder setRequestThreeDSecure( @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ @SerializedName("amount") Long amount; @@ -4774,7 +4774,7 @@ public static class Builder { .MandateOptions(this.amount, this.amountType, this.description, this.extraParams); } - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ public Builder setAmount(Long amount) { this.amount = amount; return this; diff --git a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java index 4a5f7729b09..48f93d206ce 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java @@ -107,7 +107,7 @@ public class SubscriptionItemCreateParams extends ApiRequestParams { /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ @SerializedName("proration_date") Long prorationDate; @@ -421,7 +421,7 @@ public Builder setProrationBehavior( /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ public Builder setProrationDate(Long prorationDate) { this.prorationDate = prorationDate; diff --git a/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java b/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java index e4dd97fd49f..b120672bf05 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java @@ -71,7 +71,7 @@ public class SubscriptionItemDeleteParams extends ApiRequestParams { /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ @SerializedName("proration_date") Long prorationDate; @@ -199,7 +199,7 @@ public Builder setProrationBehavior( /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ public Builder setProrationDate(Long prorationDate) { this.prorationDate = prorationDate; diff --git a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java index e23d13bc509..e5d37ac3398 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java @@ -118,7 +118,7 @@ public class SubscriptionItemUpdateParams extends ApiRequestParams { /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ @SerializedName("proration_date") Long prorationDate; @@ -481,7 +481,7 @@ public Builder setProrationBehavior( /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ public Builder setProrationDate(Long prorationDate) { this.prorationDate = prorationDate; diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index bd3ceca780d..295cf6995f5 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -226,8 +226,8 @@ public class SubscriptionUpdateParams extends ApiRequestParams { /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ @SerializedName("pending_invoice_item_interval") Object pendingInvoiceItemInterval; @@ -1006,8 +1006,8 @@ public Builder setPaymentSettings(SubscriptionUpdateParams.PaymentSettings payme /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval( SubscriptionUpdateParams.PendingInvoiceItemInterval pendingInvoiceItemInterval) { @@ -1017,8 +1017,8 @@ public Builder setPendingInvoiceItemInterval( /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval(EmptyParam pendingInvoiceItemInterval) { this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; @@ -3837,7 +3837,7 @@ public enum TaxBehavior implements ApiRequestParams.EnumParam { public static class PauseCollection { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ @SerializedName("behavior") Behavior behavior; @@ -3880,7 +3880,7 @@ public SubscriptionUpdateParams.PauseCollection build() { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ public Builder setBehavior(SubscriptionUpdateParams.PauseCollection.Behavior behavior) { this.behavior = behavior; @@ -4879,7 +4879,7 @@ public Builder setRequestThreeDSecure( @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ @SerializedName("amount") Long amount; @@ -4939,7 +4939,7 @@ public static class Builder { .MandateOptions(this.amount, this.amountType, this.description, this.extraParams); } - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ public Builder setAmount(Long amount) { this.amount = amount; return this; diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index d5676820498..bba110902f3 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -645,7 +645,10 @@ public enum ApiVersion implements ApiRequestParams.EnumParam { VERSION_2026_01_28_CLOVER("2026-01-28.clover"), @SerializedName("2026-02-25.clover") - VERSION_2026_02_25_CLOVER("2026-02-25.clover"); + VERSION_2026_02_25_CLOVER("2026-02-25.clover"), + + @SerializedName("2026-03-25.dahlia") + VERSION_2026_03_25_DAHLIA("2026-03-25.dahlia"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index ffa2ecce311..1893de69ace 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -196,6 +196,13 @@ public class SessionCreateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The integration identifier for this Checkout Session. Multiple Checkout Sessions can have the + * same integration identifier. + */ + @SerializedName("integration_identifier") + String integrationIdentifier; + /** Generate a post-purchase Invoice for one-time payments. */ @SerializedName("invoice_creation") InvoiceCreation invoiceCreation; @@ -456,6 +463,7 @@ private SessionCreateParams( List expand, Long expiresAt, Map extraParams, + String integrationIdentifier, InvoiceCreation invoiceCreation, List lineItems, Locale locale, @@ -506,6 +514,7 @@ private SessionCreateParams( this.expand = expand; this.expiresAt = expiresAt; this.extraParams = extraParams; + this.integrationIdentifier = integrationIdentifier; this.invoiceCreation = invoiceCreation; this.lineItems = lineItems; this.locale = locale; @@ -585,6 +594,8 @@ public static class Builder { private Map extraParams; + private String integrationIdentifier; + private InvoiceCreation invoiceCreation; private List lineItems; @@ -666,6 +677,7 @@ public SessionCreateParams build() { this.expand, this.expiresAt, this.extraParams, + this.integrationIdentifier, this.invoiceCreation, this.lineItems, this.locale, @@ -1008,6 +1020,15 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The integration identifier for this Checkout Session. Multiple Checkout Sessions can have the + * same integration identifier. + */ + public Builder setIntegrationIdentifier(String integrationIdentifier) { + this.integrationIdentifier = integrationIdentifier; + return this; + } + /** Generate a post-purchase Invoice for one-time payments. */ public Builder setInvoiceCreation(SessionCreateParams.InvoiceCreation invoiceCreation) { this.invoiceCreation = invoiceCreation; @@ -7218,6 +7239,10 @@ public static class PaymentMethodOptions { @SerializedName("cashapp") Cashapp cashapp; + /** contains details about the Crypto payment method options. */ + @SerializedName("crypto") + Crypto crypto; + /** contains details about the Customer Balance payment method options. */ @SerializedName("customer_balance") CustomerBalance customerBalance; @@ -7347,6 +7372,10 @@ public static class PaymentMethodOptions { @SerializedName("twint") Twint twint; + /** contains details about the UPI payment method options. */ + @SerializedName("upi") + Upi upi; + /** contains details about the Us Bank Account payment method options. */ @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -7369,6 +7398,7 @@ private PaymentMethodOptions( Boleto boleto, Card card, Cashapp cashapp, + Crypto crypto, CustomerBalance customerBalance, DemoPay demoPay, Eps eps, @@ -7400,6 +7430,7 @@ private PaymentMethodOptions( Sofort sofort, Swish swish, Twint twint, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay) { this.acssDebit = acssDebit; @@ -7415,6 +7446,7 @@ private PaymentMethodOptions( this.boleto = boleto; this.card = card; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.demoPay = demoPay; this.eps = eps; @@ -7446,6 +7478,7 @@ private PaymentMethodOptions( this.sofort = sofort; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; } @@ -7481,6 +7514,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private DemoPay demoPay; @@ -7543,6 +7578,8 @@ public static class Builder { private Twint twint; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -7563,6 +7600,7 @@ public SessionCreateParams.PaymentMethodOptions build() { this.boleto, this.card, this.cashapp, + this.crypto, this.customerBalance, this.demoPay, this.eps, @@ -7594,6 +7632,7 @@ public SessionCreateParams.PaymentMethodOptions build() { this.sofort, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay); } @@ -7681,6 +7720,12 @@ public Builder setCashapp(SessionCreateParams.PaymentMethodOptions.Cashapp casha return this; } + /** contains details about the Crypto payment method options. */ + public Builder setCrypto(SessionCreateParams.PaymentMethodOptions.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** contains details about the Customer Balance payment method options. */ public Builder setCustomerBalance( SessionCreateParams.PaymentMethodOptions.CustomerBalance customerBalance) { @@ -7889,6 +7934,12 @@ public Builder setTwint(SessionCreateParams.PaymentMethodOptions.Twint twint) { return this; } + /** contains details about the UPI payment method options. */ + public Builder setUpi(SessionCreateParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + /** contains details about the Us Bank Account payment method options. */ public Builder setUsBankAccount( SessionCreateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { @@ -10641,6 +10692,128 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * 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 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 the payment method to a + * Customer after the transaction completes. + * + *

If the payment method is {@code card_present} and isn't a digital wallet, Stripe creates + * and attaches a generated_card + * payment method representing the card to the Customer instead. + * + *

When processing card payments, Stripe uses {@code setup_future_usage} to help you comply + * with regional legislation and network rules, such as SCA. + */ + @SerializedName("setup_future_usage") + SetupFutureUsage setupFutureUsage; + + private Crypto(Map extraParams, SetupFutureUsage setupFutureUsage) { + this.extraParams = extraParams; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private SetupFutureUsage setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.PaymentMethodOptions.Crypto build() { + return new SessionCreateParams.PaymentMethodOptions.Crypto( + this.extraParams, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SessionCreateParams.PaymentMethodOptions.Crypto#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SessionCreateParams.PaymentMethodOptions.Crypto#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * 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 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 the payment method to a + * Customer after the transaction completes. + * + *

If the payment method is {@code card_present} and isn't a digital wallet, Stripe + * creates and attaches a generated_card + * payment method representing the card to the Customer instead. + * + *

When processing card payments, Stripe uses {@code setup_future_usage} to help you + * comply with regional legislation and network rules, such as SCA. + */ + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Crypto.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -15838,6 +16011,266 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Additional fields for Mandate creation. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.PaymentMethodOptions.Upi build() { + return new SessionCreateParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SessionCreateParams.PaymentMethodOptions.Upi#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SessionCreateParams.PaymentMethodOptions.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Additional fields for Mandate creation. */ + public Builder setMandateOptions( + SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions.AmountType amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + public enum AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -18769,6 +19202,14 @@ public static class SubscriptionData { @SerializedName("on_behalf_of") String onBehalfOf; + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to + * calling Create an invoice for the + * given subscription at the specified interval. + */ + @SerializedName("pending_invoice_item_interval") + PendingInvoiceItemInterval pendingInvoiceItemInterval; + /** * Determines how to handle prorations resulting from the {@code billing_cycle_anchor}. If no * value is passed, the default is {@code create_prorations}. @@ -18811,6 +19252,7 @@ private SubscriptionData( InvoiceSettings invoiceSettings, Map metadata, String onBehalfOf, + PendingInvoiceItemInterval pendingInvoiceItemInterval, ProrationBehavior prorationBehavior, TransferData transferData, Long trialEnd, @@ -18825,6 +19267,7 @@ private SubscriptionData( this.invoiceSettings = invoiceSettings; this.metadata = metadata; this.onBehalfOf = onBehalfOf; + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; this.prorationBehavior = prorationBehavior; this.transferData = transferData; this.trialEnd = trialEnd; @@ -18855,6 +19298,8 @@ public static class Builder { private String onBehalfOf; + private PendingInvoiceItemInterval pendingInvoiceItemInterval; + private ProrationBehavior prorationBehavior; private TransferData transferData; @@ -18877,6 +19322,7 @@ public SessionCreateParams.SubscriptionData build() { this.invoiceSettings, this.metadata, this.onBehalfOf, + this.pendingInvoiceItemInterval, this.prorationBehavior, this.transferData, this.trialEnd, @@ -19013,6 +19459,18 @@ public Builder setOnBehalfOf(String onBehalfOf) { return this; } + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous + * to calling Create an invoice for + * the given subscription at the specified interval. + */ + public Builder setPendingInvoiceItemInterval( + SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval + pendingInvoiceItemInterval) { + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; + return this; + } + /** * Determines how to handle prorations resulting from the {@code billing_cycle_anchor}. If no * value is passed, the default is {@code create_prorations}. @@ -19443,6 +19901,130 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PendingInvoiceItemInterval { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. Specifies invoicing frequency. Either {@code day}, {@code week}, + * {@code month} or {@code year}. + */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals between invoices. For example, {@code interval=month} and {@code + * interval_count=3} bills every 3 months. Maximum of one year interval allowed (1 year, 12 + * months, or 52 weeks). + */ + @SerializedName("interval_count") + Long intervalCount; + + private PendingInvoiceItemInterval( + Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval build() { + return new SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval( + this.extraParams, this.interval, this.intervalCount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Specifies invoicing frequency. Either {@code day}, {@code + * week}, {@code month} or {@code year}. + */ + public Builder setInterval( + SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval.Interval interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals between invoices. For example, {@code interval=month} and {@code + * interval_count=3} bills every 3 months. Maximum of one year interval allowed (1 year, 12 + * months, or 52 weeks). + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class TransferData { @@ -20176,6 +20758,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -20515,6 +21100,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -20578,11 +21166,23 @@ public enum UiMode implements ApiRequestParams.EnumParam { @SerializedName("custom") CUSTOM("custom"), + @SerializedName("elements") + ELEMENTS("elements"), + @SerializedName("embedded") EMBEDDED("embedded"), + @SerializedName("embedded_page") + EMBEDDED_PAGE("embedded_page"), + + @SerializedName("form") + FORM("form"), + @SerializedName("hosted") - HOSTED("hosted"); + HOSTED("hosted"), + + @SerializedName("hosted_page") + HOSTED_PAGE("hosted_page"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java b/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java index 79c47fc21cd..d185cfad08c 100644 --- a/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java @@ -2738,18 +2738,18 @@ public static class CardTestingRisk { * Required. The likelihood that this authorization is associated with card * testing activity. This is assessed by evaluating decline activity over the last hour. */ - @SerializedName("risk_level") - RiskLevel riskLevel; + @SerializedName("level") + Level level; private CardTestingRisk( Map extraParams, Long invalidAccountNumberDeclineRatePastHour, Long invalidCredentialsDeclineRatePastHour, - RiskLevel riskLevel) { + Level level) { this.extraParams = extraParams; this.invalidAccountNumberDeclineRatePastHour = invalidAccountNumberDeclineRatePastHour; this.invalidCredentialsDeclineRatePastHour = invalidCredentialsDeclineRatePastHour; - this.riskLevel = riskLevel; + this.level = level; } public static Builder builder() { @@ -2763,7 +2763,7 @@ public static class Builder { private Long invalidCredentialsDeclineRatePastHour; - private RiskLevel riskLevel; + private Level level; /** Finalize and obtain parameter instance from this builder. */ public AuthorizationCreateParams.RiskAssessment.CardTestingRisk build() { @@ -2771,7 +2771,7 @@ public AuthorizationCreateParams.RiskAssessment.CardTestingRisk build() { this.extraParams, this.invalidAccountNumberDeclineRatePastHour, this.invalidCredentialsDeclineRatePastHour, - this.riskLevel); + this.level); } /** @@ -2830,14 +2830,14 @@ public Builder setInvalidCredentialsDeclineRatePastHour( * Required. The likelihood that this authorization is associated with card * testing activity. This is assessed by evaluating decline activity over the last hour. */ - public Builder setRiskLevel( - AuthorizationCreateParams.RiskAssessment.CardTestingRisk.RiskLevel riskLevel) { - this.riskLevel = riskLevel; + public Builder setLevel( + AuthorizationCreateParams.RiskAssessment.CardTestingRisk.Level level) { + this.level = level; return this; } } - public enum RiskLevel implements ApiRequestParams.EnumParam { + public enum Level implements ApiRequestParams.EnumParam { @SerializedName("elevated") ELEVATED("elevated"), @@ -2859,7 +2859,7 @@ public enum RiskLevel implements ApiRequestParams.EnumParam { @Getter(onMethod_ = {@Override}) private final String value; - RiskLevel(String value) { + Level(String value) { this.value = value; } } @@ -3016,14 +3016,13 @@ public static class MerchantDisputeRisk { * Required. The likelihood that authorizations from this merchant will * result in a dispute based on their history on Stripe Issuing. */ - @SerializedName("risk_level") - RiskLevel riskLevel; + @SerializedName("level") + Level level; - private MerchantDisputeRisk( - Long disputeRate, Map extraParams, RiskLevel riskLevel) { + private MerchantDisputeRisk(Long disputeRate, Map extraParams, Level level) { this.disputeRate = disputeRate; this.extraParams = extraParams; - this.riskLevel = riskLevel; + this.level = level; } public static Builder builder() { @@ -3035,12 +3034,12 @@ public static class Builder { private Map extraParams; - private RiskLevel riskLevel; + private Level level; /** Finalize and obtain parameter instance from this builder. */ public AuthorizationCreateParams.RiskAssessment.MerchantDisputeRisk build() { return new AuthorizationCreateParams.RiskAssessment.MerchantDisputeRisk( - this.disputeRate, this.extraParams, this.riskLevel); + this.disputeRate, this.extraParams, this.level); } /** @@ -3086,14 +3085,14 @@ public Builder putAllExtraParam(Map map) { * Required. The likelihood that authorizations from this merchant will * result in a dispute based on their history on Stripe Issuing. */ - public Builder setRiskLevel( - AuthorizationCreateParams.RiskAssessment.MerchantDisputeRisk.RiskLevel riskLevel) { - this.riskLevel = riskLevel; + public Builder setLevel( + AuthorizationCreateParams.RiskAssessment.MerchantDisputeRisk.Level level) { + this.level = level; return this; } } - public enum RiskLevel implements ApiRequestParams.EnumParam { + public enum Level implements ApiRequestParams.EnumParam { @SerializedName("elevated") ELEVATED("elevated"), @@ -3115,7 +3114,7 @@ public enum RiskLevel implements ApiRequestParams.EnumParam { @Getter(onMethod_ = {@Override}) private final String value; - RiskLevel(String value) { + Level(String value) { this.value = value; } } diff --git a/src/main/java/com/stripe/param/issuing/CardCreateParams.java b/src/main/java/com/stripe/param/issuing/CardCreateParams.java index d7679ef3dd1..df1f69c0c8d 100644 --- a/src/main/java/com/stripe/param/issuing/CardCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardCreateParams.java @@ -61,6 +61,14 @@ public class CardCreateParams extends ApiRequestParams { @SerializedName("financial_account") String financialAccount; + /** + * Rules that control the lifecycle of this card, such as automatic cancellation. Refer to our documentation for more + * details. + */ + @SerializedName("lifecycle_controls") + LifecycleControls lifecycleControls; + /** * Set of key-value pairs that you can attach * to an object. This can be useful for storing additional information about the object in a @@ -126,6 +134,7 @@ private CardCreateParams( List expand, Map extraParams, String financialAccount, + LifecycleControls lifecycleControls, Map metadata, String personalizationDesign, Pin pin, @@ -143,6 +152,7 @@ private CardCreateParams( this.expand = expand; this.extraParams = extraParams; this.financialAccount = financialAccount; + this.lifecycleControls = lifecycleControls; this.metadata = metadata; this.personalizationDesign = personalizationDesign; this.pin = pin; @@ -174,6 +184,8 @@ public static class Builder { private String financialAccount; + private LifecycleControls lifecycleControls; + private Map metadata; private String personalizationDesign; @@ -204,6 +216,7 @@ public CardCreateParams build() { this.expand, this.extraParams, this.financialAccount, + this.lifecycleControls, this.metadata, this.personalizationDesign, this.pin, @@ -312,6 +325,16 @@ public Builder setFinancialAccount(String financialAccount) { return this; } + /** + * Rules that control the lifecycle of this card, such as automatic cancellation. Refer to our + * documentation for more + * details. + */ + public Builder setLifecycleControls(CardCreateParams.LifecycleControls lifecycleControls) { + this.lifecycleControls = lifecycleControls; + return this; + } + /** * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, * and subsequent calls add additional key/value pairs to the original map. See {@link @@ -412,6 +435,155 @@ public Builder setType(CardCreateParams.Type type) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LifecycleControls { + /** Required. Cancels the card after the specified conditions are met. */ + @SerializedName("cancel_after") + CancelAfter cancelAfter; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private LifecycleControls(CancelAfter cancelAfter, Map extraParams) { + this.cancelAfter = cancelAfter; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CancelAfter cancelAfter; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CardCreateParams.LifecycleControls build() { + return new CardCreateParams.LifecycleControls(this.cancelAfter, this.extraParams); + } + + /** Required. Cancels the card after the specified conditions are met. */ + public Builder setCancelAfter(CardCreateParams.LifecycleControls.CancelAfter cancelAfter) { + this.cancelAfter = cancelAfter; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * CardCreateParams.LifecycleControls#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link CardCreateParams.LifecycleControls#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CancelAfter { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. The card is automatically cancelled when it makes this number of + * non-zero payment authorizations and transactions. The count includes penny authorizations, + * but doesn't include non-payment actions, such as authorization advice. + */ + @SerializedName("payment_count") + Long paymentCount; + + private CancelAfter(Map extraParams, Long paymentCount) { + this.extraParams = extraParams; + this.paymentCount = paymentCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long paymentCount; + + /** Finalize and obtain parameter instance from this builder. */ + public CardCreateParams.LifecycleControls.CancelAfter build() { + return new CardCreateParams.LifecycleControls.CancelAfter( + this.extraParams, this.paymentCount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CardCreateParams.LifecycleControls.CancelAfter#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CardCreateParams.LifecycleControls.CancelAfter#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. The card is automatically cancelled when it makes this number + * of non-zero payment authorizations and transactions. The count includes penny + * authorizations, but doesn't include non-payment actions, such as authorization advice. + */ + public Builder setPaymentCount(Long paymentCount) { + this.paymentCount = paymentCount; + return this; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Pin { diff --git a/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java b/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java index fc6c59a68e3..5a7bb885ea5 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java @@ -894,10 +894,7 @@ public Builder setUserTermsAcceptance( @Getter @EqualsAndHashCode(callSuper = false) public static class UserTermsAcceptance { - /** - * The Unix timestamp marking when the cardholder accepted the Authorized User Terms. - * Required for Celtic Spend Card users. - */ + /** The Unix timestamp marking when the cardholder accepted the Authorized User Terms. */ @SerializedName("date") Long date; @@ -911,10 +908,7 @@ public static class UserTermsAcceptance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The IP address from which the cardholder accepted the Authorized User Terms. Required for - * Celtic Spend Card users. - */ + /** The IP address from which the cardholder accepted the Authorized User Terms. */ @SerializedName("ip") String ip; @@ -952,10 +946,7 @@ public CardholderCreateParams.Individual.CardIssuing.UserTermsAcceptance build() this.date, this.extraParams, this.ip, this.userAgent); } - /** - * The Unix timestamp marking when the cardholder accepted the Authorized User Terms. - * Required for Celtic Spend Card users. - */ + /** The Unix timestamp marking when the cardholder accepted the Authorized User Terms. */ public Builder setDate(Long date) { this.date = date; return this; @@ -991,10 +982,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * The IP address from which the cardholder accepted the Authorized User Terms. Required - * for Celtic Spend Card users. - */ + /** The IP address from which the cardholder accepted the Authorized User Terms. */ public Builder setIp(String ip) { this.ip = ip; return this; diff --git a/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java b/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java index ce9031c30c7..c55c6bcbae0 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java @@ -924,10 +924,7 @@ public Builder setUserTermsAcceptance( @Getter @EqualsAndHashCode(callSuper = false) public static class UserTermsAcceptance { - /** - * The Unix timestamp marking when the cardholder accepted the Authorized User Terms. - * Required for Celtic Spend Card users. - */ + /** The Unix timestamp marking when the cardholder accepted the Authorized User Terms. */ @SerializedName("date") Long date; @@ -941,10 +938,7 @@ public static class UserTermsAcceptance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The IP address from which the cardholder accepted the Authorized User Terms. Required for - * Celtic Spend Card users. - */ + /** The IP address from which the cardholder accepted the Authorized User Terms. */ @SerializedName("ip") Object ip; @@ -982,10 +976,7 @@ public CardholderUpdateParams.Individual.CardIssuing.UserTermsAcceptance build() this.date, this.extraParams, this.ip, this.userAgent); } - /** - * The Unix timestamp marking when the cardholder accepted the Authorized User Terms. - * Required for Celtic Spend Card users. - */ + /** The Unix timestamp marking when the cardholder accepted the Authorized User Terms. */ public Builder setDate(Long date) { this.date = date; return this; @@ -1021,19 +1012,13 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * The IP address from which the cardholder accepted the Authorized User Terms. Required - * for Celtic Spend Card users. - */ + /** The IP address from which the cardholder accepted the Authorized User Terms. */ public Builder setIp(String ip) { this.ip = ip; return this; } - /** - * The IP address from which the cardholder accepted the Authorized User Terms. Required - * for Celtic Spend Card users. - */ + /** The IP address from which the cardholder accepted the Authorized User Terms. */ public Builder setIp(EmptyParam ip) { this.ip = ip; return this; diff --git a/src/main/java/com/stripe/param/radar/ValueListCreateParams.java b/src/main/java/com/stripe/param/radar/ValueListCreateParams.java index 9e056deef5d..209cd61b055 100644 --- a/src/main/java/com/stripe/param/radar/ValueListCreateParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListCreateParams.java @@ -32,9 +32,9 @@ public class ValueListCreateParams extends ApiRequestParams { /** * Type of the items in the value list. One of {@code card_fingerprint}, {@code card_bin}, {@code - * email}, {@code ip_address}, {@code country}, {@code string}, {@code case_sensitive_string}, - * {@code customer_id}, {@code sepa_debit_fingerprint}, or {@code us_bank_account_fingerprint}. - * Use {@code string} if the item type is unknown or mixed. + * crypto_fingerprint}, {@code email}, {@code ip_address}, {@code country}, {@code string}, {@code + * case_sensitive_string}, {@code customer_id}, {@code sepa_debit_fingerprint}, or {@code + * us_bank_account_fingerprint}. Use {@code string} if the item type is unknown or mixed. */ @SerializedName("item_type") ItemType itemType; @@ -150,9 +150,10 @@ public Builder putAllExtraParam(Map map) { /** * Type of the items in the value list. One of {@code card_fingerprint}, {@code card_bin}, - * {@code email}, {@code ip_address}, {@code country}, {@code string}, {@code - * case_sensitive_string}, {@code customer_id}, {@code sepa_debit_fingerprint}, or {@code - * us_bank_account_fingerprint}. Use {@code string} if the item type is unknown or mixed. + * {@code crypto_fingerprint}, {@code email}, {@code ip_address}, {@code country}, {@code + * string}, {@code case_sensitive_string}, {@code customer_id}, {@code sepa_debit_fingerprint}, + * or {@code us_bank_account_fingerprint}. Use {@code string} if the item type is unknown or + * mixed. */ public Builder setItemType(ValueListCreateParams.ItemType itemType) { this.itemType = itemType; @@ -205,6 +206,9 @@ public enum ItemType implements ApiRequestParams.EnumParam { @SerializedName("country") COUNTRY("country"), + @SerializedName("crypto_fingerprint") + CRYPTO_FINGERPRINT("crypto_fingerprint"), + @SerializedName("customer_id") CUSTOMER_ID("customer_id"), diff --git a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java index a854b816230..e5cf6b0ece3 100644 --- a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java @@ -1132,7 +1132,7 @@ public enum TaxabilityOverride implements ApiRequestParams.EnumParam { public static class LineItem { /** * Required. A positive integer representing the line item's total price in the - * smallest currency unit. If + * smallest currency unit. If * {@code tax_behavior=inclusive}, then this amount includes taxes. Otherwise, taxes are * calculated on top of this amount. */ @@ -1246,8 +1246,8 @@ public CalculationCreateParams.LineItem build() { /** * Required. A positive integer representing the line item's total price in - * the smallest currency unit. - * If {@code tax_behavior=inclusive}, then this amount includes taxes. Otherwise, taxes are + * the smallest currency unit. If + * {@code tax_behavior=inclusive}, then this amount includes taxes. Otherwise, taxes are * calculated on top of this amount. */ public Builder setAmount(Long amount) { @@ -1639,7 +1639,7 @@ public Builder setState(EmptyParam state) { @EqualsAndHashCode(callSuper = false) public static class ShippingCost { /** - * A positive integer in the smallest + * A positive integer in the smallest * currency unit representing the shipping charge. If {@code tax_behavior=inclusive}, then * this amount includes taxes. Otherwise, taxes are calculated on top of this amount. */ @@ -1714,10 +1714,9 @@ public CalculationCreateParams.ShippingCost build() { } /** - * A positive integer in the smallest currency unit - * representing the shipping charge. If {@code tax_behavior=inclusive}, then this amount - * includes taxes. Otherwise, taxes are calculated on top of this amount. + * A positive integer in the smallest + * currency unit representing the shipping charge. If {@code tax_behavior=inclusive}, then + * this amount includes taxes. Otherwise, taxes are calculated on top of this amount. */ public Builder setAmount(Long amount) { this.amount = amount; diff --git a/src/main/java/com/stripe/param/tax/TransactionCreateReversalParams.java b/src/main/java/com/stripe/param/tax/TransactionCreateReversalParams.java index 7f345739fb4..56aefedb926 100644 --- a/src/main/java/com/stripe/param/tax/TransactionCreateReversalParams.java +++ b/src/main/java/com/stripe/param/tax/TransactionCreateReversalParams.java @@ -28,7 +28,7 @@ public class TransactionCreateReversalParams extends ApiRequestParams { /** * A flat amount to reverse across the entire transaction, in the smallest currency unit in negative. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. * This value represents the total amount to refund from the transaction, including taxes. */ @SerializedName("flat_amount") @@ -183,9 +183,8 @@ public Builder putAllExtraParam(Map map) { /** * A flat amount to reverse across the entire transaction, in the smallest currency unit in - * negative. This value represents the total amount to refund from the transaction, including - * taxes. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. + * This value represents the total amount to refund from the transaction, including taxes. */ public Builder setFlatAmount(Long flatAmount) { this.flatAmount = flatAmount; @@ -282,16 +281,14 @@ public Builder setShippingCost(TransactionCreateReversalParams.ShippingCost ship public static class LineItem { /** * Required. The amount to reverse, in the smallest currency unit in - * negative. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. */ @SerializedName("amount") Long amount; /** * Required. The amount of tax to reverse, in the smallest currency unit in - * negative. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. */ @SerializedName("amount_tax") Long amountTax; @@ -384,7 +381,7 @@ public TransactionCreateReversalParams.LineItem build() { /** * Required. The amount to reverse, in the smallest currency unit in + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in * negative. */ public Builder setAmount(Long amount) { @@ -394,7 +391,7 @@ public Builder setAmount(Long amount) { /** * Required. The amount of tax to reverse, in the smallest currency unit in + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in * negative. */ public Builder setAmountTax(Long amountTax) { @@ -489,16 +486,14 @@ public Builder setReference(String reference) { public static class ShippingCost { /** * Required. The amount to reverse, in the smallest currency unit in - * negative. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. */ @SerializedName("amount") Long amount; /** * Required. The amount of tax to reverse, in the smallest currency unit in - * negative. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. */ @SerializedName("amount_tax") Long amountTax; @@ -537,7 +532,7 @@ public TransactionCreateReversalParams.ShippingCost build() { /** * Required. The amount to reverse, in the smallest currency unit in + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in * negative. */ public Builder setAmount(Long amount) { @@ -547,7 +542,7 @@ public Builder setAmount(Long amount) { /** * Required. The amount of tax to reverse, in the smallest currency unit in + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in * negative. */ public Builder setAmountTax(Long amountTax) { diff --git a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java index 7543b5309c1..48026ef7d63 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -10052,8 +10053,7 @@ public AccountCreateParams.Identity.BusinessDetails.AnnualRevenue build() { } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -10095,108 +10095,6 @@ public Builder setFiscalYearEnd(String fiscalYearEnd) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount build() { - return new AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount#extraParams} for - * the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; - } - - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount#extraParams} for - * the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -12411,8 +12309,7 @@ public AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue buil } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -12447,109 +12344,6 @@ public Builder putAllExtraParam(Map map) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - build() { - return new AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue - .Amount(this.currency, this.extraParams, this.value); - } - - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; - } - - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter diff --git a/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java b/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java index 80f89389a60..f2dec5cc6e3 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import com.stripe.v2.Amount; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -1472,8 +1473,7 @@ public AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue build() { } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -1517,108 +1517,6 @@ public Builder setFiscalYearEnd(String fiscalYearEnd) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount build() { - return new AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; - } - - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -3846,9 +3744,7 @@ public AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -3883,109 +3779,6 @@ public Builder putAllExtraParam(Map map) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - build() { - return new AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue - .Amount(this.currency, this.extraParams, this.value); - } - - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; - } - - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter diff --git a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java index fea3ba60a71..7bbc94507b1 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -11024,8 +11025,7 @@ public AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue build() { } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -11076,118 +11076,6 @@ public Builder setFiscalYearEnd(EmptyParam fiscalYearEnd) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - Object currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(Object currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Object currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount build() { - return new AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - public Builder setCurrency(EmptyParam currency) { - this.currency = currency; - return this; - } - - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount#extraParams} for - * the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; - } - - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount#extraParams} for - * the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -13437,8 +13325,7 @@ public AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue buil } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -13473,119 +13360,6 @@ public Builder putAllExtraParam(Map map) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - Object currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(Object currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Object currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - build() { - return new AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue - .Amount(this.currency, this.extraParams, this.value); - } - - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - public Builder setCurrency(EmptyParam currency) { - this.currency = currency; - return this; - } - - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; - } - - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the - * original map. See {@link - * AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter diff --git a/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java b/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java index 946287f6e15..195cd285252 100644 --- a/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java @@ -29,9 +29,16 @@ public class EventDestinationCreateParams extends ApiRequestParams { @SerializedName("event_payload") EventPayload eventPayload; - /** Where events should be routed from. */ + /** + * Specifies which accounts' events route to this destination. {@code @self}: Receive events from + * the account that owns the event destination. {@code @accounts}: Receive events emitted from + * other accounts you manage which includes your v1 and v2 accounts. + * {@code @organization_members}: Receive events from accounts directly linked to the + * organization. {@code @organization_members/@accounts}: Receive events from all accounts + * connected to any platform accounts in the organization. + */ @SerializedName("events_from") - List eventsFrom; + List eventsFrom; /** * Map of extra parameters for custom features not available in this client library. The content @@ -71,7 +78,7 @@ private EventDestinationCreateParams( String description, List enabledEvents, EventPayload eventPayload, - List eventsFrom, + List eventsFrom, Map extraParams, List include, Map metadata, @@ -106,7 +113,7 @@ public static class Builder { private EventPayload eventPayload; - private List eventsFrom; + private List eventsFrom; private Map extraParams; @@ -189,7 +196,7 @@ public Builder setEventPayload(EventDestinationCreateParams.EventPayload eventPa * and subsequent calls adds additional elements to the original list. See {@link * EventDestinationCreateParams#eventsFrom} for the field documentation. */ - public Builder addEventsFrom(EventDestinationCreateParams.EventsFrom element) { + public Builder addEventsFrom(String element) { if (this.eventsFrom == null) { this.eventsFrom = new ArrayList<>(); } @@ -202,7 +209,7 @@ public Builder addEventsFrom(EventDestinationCreateParams.EventsFrom element) { * and subsequent calls adds additional elements to the original list. See {@link * EventDestinationCreateParams#eventsFrom} for the field documentation. */ - public Builder addAllEventsFrom(List elements) { + public Builder addAllEventsFrom(List elements) { if (this.eventsFrom == null) { this.eventsFrom = new ArrayList<>(); } @@ -484,21 +491,6 @@ public enum EventPayload implements ApiRequestParams.EnumParam { } } - public enum EventsFrom implements ApiRequestParams.EnumParam { - @SerializedName("other_accounts") - OTHER_ACCOUNTS("other_accounts"), - - @SerializedName("self") - SELF("self"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - EventsFrom(String value) { - this.value = value; - } - } - public enum Include implements ApiRequestParams.EnumParam { @SerializedName("webhook_endpoint.signing_secret") WEBHOOK_ENDPOINT__SIGNING_SECRET("webhook_endpoint.signing_secret"), diff --git a/src/main/java/com/stripe/service/CustomerPaymentSourceService.java b/src/main/java/com/stripe/service/CustomerPaymentSourceService.java index 3b28c7dfdf8..f7cd4a699f1 100644 --- a/src/main/java/com/stripe/service/CustomerPaymentSourceService.java +++ b/src/main/java/com/stripe/service/CustomerPaymentSourceService.java @@ -59,8 +59,8 @@ public StripeCollection list( * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create(String customer, CustomerPaymentSourceCreateParams params) throws StripeException { @@ -72,8 +72,8 @@ public PaymentSource create(String customer, CustomerPaymentSourceCreateParams p * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create( String customer, CustomerPaymentSourceCreateParams params, RequestOptions options) diff --git a/src/main/java/com/stripe/service/InvoiceService.java b/src/main/java/com/stripe/service/InvoiceService.java index 979dc51661d..85b1084f2b4 100644 --- a/src/main/java/com/stripe/service/InvoiceService.java +++ b/src/main/java/com/stripe/service/InvoiceService.java @@ -38,7 +38,7 @@ public InvoiceService(StripeResponseGetter responseGetter) { * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete(String invoice) throws StripeException { return delete(invoice, (RequestOptions) null); @@ -47,7 +47,7 @@ public Invoice delete(String invoice) throws StripeException { * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete(String invoice, RequestOptions options) throws StripeException { String path = String.format("/v1/invoices/%s", ApiResource.urlEncodeId(invoice)); @@ -180,8 +180,8 @@ public StripeCollection list(InvoiceListParams params, RequestOptions o } /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public Invoice create(InvoiceCreateParams params) throws StripeException { @@ -189,8 +189,8 @@ public Invoice create(InvoiceCreateParams params) throws StripeException { } /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public Invoice create(RequestOptions options) throws StripeException { @@ -198,8 +198,8 @@ public Invoice create(RequestOptions options) throws StripeException { } /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public Invoice create() throws StripeException { @@ -207,8 +207,8 @@ public Invoice create() throws StripeException { } /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public Invoice create(InvoiceCreateParams params, RequestOptions options) throws StripeException { @@ -596,14 +596,14 @@ public Invoice updateLines( } /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(String invoice, InvoiceVoidInvoiceParams params) throws StripeException { @@ -611,42 +611,42 @@ public Invoice voidInvoice(String invoice, InvoiceVoidInvoiceParams params) } /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(String invoice, RequestOptions options) throws StripeException { return voidInvoice(invoice, (InvoiceVoidInvoiceParams) null, options); } /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(String invoice) throws StripeException { return voidInvoice(invoice, (InvoiceVoidInvoiceParams) null, (RequestOptions) null); } /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice( String invoice, InvoiceVoidInvoiceParams params, RequestOptions options) diff --git a/src/main/java/com/stripe/service/PaymentIntentService.java b/src/main/java/com/stripe/service/PaymentIntentService.java index 4baa049de19..550e7ab4887 100644 --- a/src/main/java/com/stripe/service/PaymentIntentService.java +++ b/src/main/java/com/stripe/service/PaymentIntentService.java @@ -292,9 +292,9 @@ public PaymentIntent applyCustomerBalance( * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(String intent, PaymentIntentCancelParams params) throws StripeException { @@ -310,9 +310,9 @@ public PaymentIntent cancel(String intent, PaymentIntentCancelParams params) * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(String intent, RequestOptions options) throws StripeException { return cancel(intent, (PaymentIntentCancelParams) null, options); @@ -327,9 +327,9 @@ public PaymentIntent cancel(String intent, RequestOptions options) throws Stripe * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(String intent) throws StripeException { return cancel(intent, (PaymentIntentCancelParams) null, (RequestOptions) null); @@ -344,9 +344,9 @@ public PaymentIntent cancel(String intent) throws StripeException { * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel( String intent, PaymentIntentCancelParams params, RequestOptions options) diff --git a/src/main/java/com/stripe/service/PayoutService.java b/src/main/java/com/stripe/service/PayoutService.java index b46edd7bcb7..4751e9a8cd8 100644 --- a/src/main/java/com/stripe/service/PayoutService.java +++ b/src/main/java/com/stripe/service/PayoutService.java @@ -75,8 +75,8 @@ public StripeCollection list(PayoutListParams params, RequestOptions opt * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public Payout create(PayoutCreateParams params) throws StripeException { return create(params, (RequestOptions) null); @@ -91,8 +91,8 @@ public Payout create(PayoutCreateParams params) throws StripeException { * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public Payout create(PayoutCreateParams params, RequestOptions options) throws StripeException { String path = "/v1/payouts"; diff --git a/src/main/java/com/stripe/service/SubscriptionService.java b/src/main/java/com/stripe/service/SubscriptionService.java index e275a677335..9f58e62f243 100644 --- a/src/main/java/com/stripe/service/SubscriptionService.java +++ b/src/main/java/com/stripe/service/SubscriptionService.java @@ -34,9 +34,9 @@ public SubscriptionService(StripeResponseGetter responseGetter) { * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -56,9 +56,9 @@ public Subscription cancel(String subscriptionExposedId, SubscriptionCancelParam * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -78,9 +78,9 @@ public Subscription cancel(String subscriptionExposedId, RequestOptions options) * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -99,9 +99,9 @@ public Subscription cancel(String subscriptionExposedId) throws StripeException * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * diff --git a/src/main/java/com/stripe/service/v2/core/AccountLinkService.java b/src/main/java/com/stripe/service/v2/core/AccountLinkService.java index a47c0c59b5d..7aa70806477 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountLinkService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountLinkService.java @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core; +import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.core.AccountLink; import com.stripe.net.ApiRequest; @@ -21,7 +22,8 @@ public AccountLinkService(StripeResponseGetter responseGetter) { * Creates an AccountLink object that includes a single-use URL that an account can use to access * a Stripe-hosted flow for collecting or updating required information. */ - public AccountLink create(AccountLinkCreateParams params) throws StripeException { + public AccountLink create(AccountLinkCreateParams params) + throws StripeException, RateLimitException { return create(params, (RequestOptions) null); } /** @@ -29,7 +31,7 @@ public AccountLink create(AccountLinkCreateParams params) throws StripeException * a Stripe-hosted flow for collecting or updating required information. */ public AccountLink create(AccountLinkCreateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = "/v2/core/account_links"; ApiRequest request = new ApiRequest( diff --git a/src/main/java/com/stripe/service/v2/core/AccountService.java b/src/main/java/com/stripe/service/v2/core/AccountService.java index 0ba14c9d182..2f5157cee7c 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountService.java @@ -2,6 +2,7 @@ package com.stripe.service.v2.core; import com.google.gson.reflect.TypeToken; +import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.StripeCollection; import com.stripe.model.v2.core.Account; @@ -24,20 +25,22 @@ public AccountService(StripeResponseGetter responseGetter) { } /** Returns a list of Accounts. */ - public StripeCollection list(AccountListParams params) throws StripeException { + public StripeCollection list(AccountListParams params) + throws StripeException, RateLimitException { return list(params, (RequestOptions) null); } /** Returns a list of Accounts. */ - public StripeCollection list(RequestOptions options) throws StripeException { + public StripeCollection list(RequestOptions options) + throws StripeException, RateLimitException { return list((AccountListParams) null, options); } /** Returns a list of Accounts. */ - public StripeCollection list() throws StripeException { + public StripeCollection list() throws StripeException, RateLimitException { return list((AccountListParams) null, (RequestOptions) null); } /** Returns a list of Accounts. */ public StripeCollection list(AccountListParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = "/v2/core/accounts"; ApiRequest request = new ApiRequest( @@ -54,7 +57,7 @@ public StripeCollection list(AccountListParams params, RequestOptions o * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create(AccountCreateParams params) throws StripeException { + public Account create(AccountCreateParams params) throws StripeException, RateLimitException { return create(params, (RequestOptions) null); } /** @@ -63,7 +66,7 @@ public Account create(AccountCreateParams params) throws StripeException { * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create(RequestOptions options) throws StripeException { + public Account create(RequestOptions options) throws StripeException, RateLimitException { return create((AccountCreateParams) null, options); } /** @@ -72,7 +75,7 @@ public Account create(RequestOptions options) throws StripeException { * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create() throws StripeException { + public Account create() throws StripeException, RateLimitException { return create((AccountCreateParams) null, (RequestOptions) null); } /** @@ -81,7 +84,8 @@ public Account create() throws StripeException { * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create(AccountCreateParams params, RequestOptions options) throws StripeException { + public Account create(AccountCreateParams params, RequestOptions options) + throws StripeException, RateLimitException { String path = "/v2/core/accounts"; ApiRequest request = new ApiRequest( @@ -93,20 +97,22 @@ public Account create(AccountCreateParams params, RequestOptions options) throws return this.request(request, Account.class); } /** Retrieves the details of an Account. */ - public Account retrieve(String id, AccountRetrieveParams params) throws StripeException { + public Account retrieve(String id, AccountRetrieveParams params) + throws StripeException, RateLimitException { return retrieve(id, params, (RequestOptions) null); } /** Retrieves the details of an Account. */ - public Account retrieve(String id, RequestOptions options) throws StripeException { + public Account retrieve(String id, RequestOptions options) + throws StripeException, RateLimitException { return retrieve(id, (AccountRetrieveParams) null, options); } /** Retrieves the details of an Account. */ - public Account retrieve(String id) throws StripeException { + public Account retrieve(String id) throws StripeException, RateLimitException { return retrieve(id, (AccountRetrieveParams) null, (RequestOptions) null); } /** Retrieves the details of an Account. */ public Account retrieve(String id, AccountRetrieveParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest( @@ -118,20 +124,22 @@ public Account retrieve(String id, AccountRetrieveParams params, RequestOptions return this.request(request, Account.class); } /** Updates the details of an Account. */ - public Account update(String id, AccountUpdateParams params) throws StripeException { + public Account update(String id, AccountUpdateParams params) + throws StripeException, RateLimitException { return update(id, params, (RequestOptions) null); } /** Updates the details of an Account. */ - public Account update(String id, RequestOptions options) throws StripeException { + public Account update(String id, RequestOptions options) + throws StripeException, RateLimitException { return update(id, (AccountUpdateParams) null, options); } /** Updates the details of an Account. */ - public Account update(String id) throws StripeException { + public Account update(String id) throws StripeException, RateLimitException { return update(id, (AccountUpdateParams) null, (RequestOptions) null); } /** Updates the details of an Account. */ public Account update(String id, AccountUpdateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest( @@ -147,7 +155,8 @@ public Account update(String id, AccountUpdateParams params, RequestOptions opti * operated on, but limited information can still be retrieved through the API in order to be able * to track their history. */ - public Account close(String id, AccountCloseParams params) throws StripeException { + public Account close(String id, AccountCloseParams params) + throws StripeException, RateLimitException { return close(id, params, (RequestOptions) null); } /** @@ -155,7 +164,8 @@ public Account close(String id, AccountCloseParams params) throws StripeExceptio * operated on, but limited information can still be retrieved through the API in order to be able * to track their history. */ - public Account close(String id, RequestOptions options) throws StripeException { + public Account close(String id, RequestOptions options) + throws StripeException, RateLimitException { return close(id, (AccountCloseParams) null, options); } /** @@ -163,7 +173,7 @@ public Account close(String id, RequestOptions options) throws StripeException { * operated on, but limited information can still be retrieved through the API in order to be able * to track their history. */ - public Account close(String id) throws StripeException { + public Account close(String id) throws StripeException, RateLimitException { return close(id, (AccountCloseParams) null, (RequestOptions) null); } /** @@ -172,7 +182,7 @@ public Account close(String id) throws StripeException { * to track their history. */ public Account close(String id, AccountCloseParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s/close", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest( diff --git a/src/main/java/com/stripe/service/v2/core/AccountTokenService.java b/src/main/java/com/stripe/service/v2/core/AccountTokenService.java index cc7c754b89a..3eb34d7d350 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountTokenService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountTokenService.java @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core; +import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.core.AccountToken; import com.stripe.net.ApiRequest; @@ -18,20 +19,21 @@ public AccountTokenService(StripeResponseGetter responseGetter) { } /** Creates an Account Token. */ - public AccountToken create(AccountTokenCreateParams params) throws StripeException { + public AccountToken create(AccountTokenCreateParams params) + throws StripeException, RateLimitException { return create(params, (RequestOptions) null); } /** Creates an Account Token. */ - public AccountToken create(RequestOptions options) throws StripeException { + public AccountToken create(RequestOptions options) throws StripeException, RateLimitException { return create((AccountTokenCreateParams) null, options); } /** Creates an Account Token. */ - public AccountToken create() throws StripeException { + public AccountToken create() throws StripeException, RateLimitException { return create((AccountTokenCreateParams) null, (RequestOptions) null); } /** Creates an Account Token. */ public AccountToken create(AccountTokenCreateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = "/v2/core/account_tokens"; ApiRequest request = new ApiRequest( @@ -43,11 +45,12 @@ public AccountToken create(AccountTokenCreateParams params, RequestOptions optio return this.request(request, AccountToken.class); } /** Retrieves an Account Token. */ - public AccountToken retrieve(String id) throws StripeException { + public AccountToken retrieve(String id) throws StripeException, RateLimitException { return retrieve(id, (RequestOptions) null); } /** Retrieves an Account Token. */ - public AccountToken retrieve(String id, RequestOptions options) throws StripeException { + public AccountToken retrieve(String id, RequestOptions options) + throws StripeException, RateLimitException { String path = String.format("/v2/core/account_tokens/%s", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); diff --git a/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java b/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java index 1ba7615b0cc..4a1b2b957e4 100644 --- a/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java +++ b/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java @@ -2,6 +2,7 @@ package com.stripe.service.v2.core.accounts; import com.google.gson.reflect.TypeToken; +import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.DeletedObject; import com.stripe.model.v2.StripeCollection; @@ -24,21 +25,23 @@ public PersonService(StripeResponseGetter responseGetter) { /** Returns a paginated list of Persons associated with an Account. */ public StripeCollection list(String accountId, PersonListParams params) - throws StripeException { + throws StripeException, RateLimitException { return list(accountId, params, (RequestOptions) null); } /** Returns a paginated list of Persons associated with an Account. */ public StripeCollection list(String accountId, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { return list(accountId, (PersonListParams) null, options); } /** Returns a paginated list of Persons associated with an Account. */ - public StripeCollection list(String accountId) throws StripeException { + public StripeCollection list(String accountId) + throws StripeException, RateLimitException { return list(accountId, (PersonListParams) null, (RequestOptions) null); } /** Returns a paginated list of Persons associated with an Account. */ public StripeCollection list( - String accountId, PersonListParams params, RequestOptions options) throws StripeException { + String accountId, PersonListParams params, RequestOptions options) + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s/persons", ApiResource.urlEncodeId(accountId)); ApiRequest request = new ApiRequest( @@ -53,21 +56,23 @@ public StripeCollection list( * Create a Person. Adds an individual to an Account's identity. You can set relationship * attributes and identity information at creation. */ - public AccountPerson create(String accountId, PersonCreateParams params) throws StripeException { + public AccountPerson create(String accountId, PersonCreateParams params) + throws StripeException, RateLimitException { return create(accountId, params, (RequestOptions) null); } /** * Create a Person. Adds an individual to an Account's identity. You can set relationship * attributes and identity information at creation. */ - public AccountPerson create(String accountId, RequestOptions options) throws StripeException { + public AccountPerson create(String accountId, RequestOptions options) + throws StripeException, RateLimitException { return create(accountId, (PersonCreateParams) null, options); } /** * Create a Person. Adds an individual to an Account's identity. You can set relationship * attributes and identity information at creation. */ - public AccountPerson create(String accountId) throws StripeException { + public AccountPerson create(String accountId) throws StripeException, RateLimitException { return create(accountId, (PersonCreateParams) null, (RequestOptions) null); } /** @@ -75,7 +80,7 @@ public AccountPerson create(String accountId) throws StripeException { * attributes and identity information at creation. */ public AccountPerson create(String accountId, PersonCreateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s/persons", ApiResource.urlEncodeId(accountId)); ApiRequest request = new ApiRequest( @@ -87,12 +92,13 @@ public AccountPerson create(String accountId, PersonCreateParams params, Request return this.request(request, AccountPerson.class); } /** Delete a Person associated with an Account. */ - public DeletedObject delete(String accountId, String id) throws StripeException { + public DeletedObject delete(String accountId, String id) + throws StripeException, RateLimitException { return delete(accountId, id, (RequestOptions) null); } /** Delete a Person associated with an Account. */ public DeletedObject delete(String accountId, String id, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format( "/v2/core/accounts/%s/persons/%s", @@ -102,12 +108,13 @@ public DeletedObject delete(String accountId, String id, RequestOptions options) return this.request(request, DeletedObject.class); } /** Retrieves a Person associated with an Account. */ - public AccountPerson retrieve(String accountId, String id) throws StripeException { + public AccountPerson retrieve(String accountId, String id) + throws StripeException, RateLimitException { return retrieve(accountId, id, (RequestOptions) null); } /** Retrieves a Person associated with an Account. */ public AccountPerson retrieve(String accountId, String id, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format( "/v2/core/accounts/%s/persons/%s", @@ -118,22 +125,23 @@ public AccountPerson retrieve(String accountId, String id, RequestOptions option } /** Updates a Person associated with an Account. */ public AccountPerson update(String accountId, String id, PersonUpdateParams params) - throws StripeException { + throws StripeException, RateLimitException { return update(accountId, id, params, (RequestOptions) null); } /** Updates a Person associated with an Account. */ public AccountPerson update(String accountId, String id, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { return update(accountId, id, (PersonUpdateParams) null, options); } /** Updates a Person associated with an Account. */ - public AccountPerson update(String accountId, String id) throws StripeException { + public AccountPerson update(String accountId, String id) + throws StripeException, RateLimitException { return update(accountId, id, (PersonUpdateParams) null, (RequestOptions) null); } /** Updates a Person associated with an Account. */ public AccountPerson update( String accountId, String id, PersonUpdateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format( "/v2/core/accounts/%s/persons/%s", diff --git a/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java b/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java index 4325a3193ec..b6180a4b7d7 100644 --- a/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java +++ b/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core.accounts; +import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.core.AccountPersonToken; import com.stripe.net.ApiRequest; @@ -19,22 +20,22 @@ public PersonTokenService(StripeResponseGetter responseGetter) { /** Creates a Person Token associated with an Account. */ public AccountPersonToken create(String accountId, PersonTokenCreateParams params) - throws StripeException { + throws StripeException, RateLimitException { return create(accountId, params, (RequestOptions) null); } /** Creates a Person Token associated with an Account. */ public AccountPersonToken create(String accountId, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { return create(accountId, (PersonTokenCreateParams) null, options); } /** Creates a Person Token associated with an Account. */ - public AccountPersonToken create(String accountId) throws StripeException { + public AccountPersonToken create(String accountId) throws StripeException, RateLimitException { return create(accountId, (PersonTokenCreateParams) null, (RequestOptions) null); } /** Creates a Person Token associated with an Account. */ public AccountPersonToken create( String accountId, PersonTokenCreateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s/person_tokens", ApiResource.urlEncodeId(accountId)); ApiRequest request = @@ -47,12 +48,13 @@ public AccountPersonToken create( return this.request(request, AccountPersonToken.class); } /** Retrieves a Person Token associated with an Account. */ - public AccountPersonToken retrieve(String accountId, String id) throws StripeException { + public AccountPersonToken retrieve(String accountId, String id) + throws StripeException, RateLimitException { return retrieve(accountId, id, (RequestOptions) null); } /** Retrieves a Person Token associated with an Account. */ public AccountPersonToken retrieve(String accountId, String id, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format( "/v2/core/accounts/%s/person_tokens/%s", diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index 44f6f8fea82..3e7868791a6 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -25154,6 +25154,31 @@ public void testV2CoreEventDestinationPost5Services() throws StripeException { null); } + @Test + public void testRateLimitErrorServices() throws StripeException { + stubRequestReturnError( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/accounts", + null, + null, + "{\"error\":{\"type\":\"rate_limit\",\"code\":\"account_rate_limit_exceeded\"}}", + 400); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.AccountListParams params = + com.stripe.param.v2.core.AccountListParams.builder().build(); + + try { + client.v2().core().accounts().list(params); + } catch (RateLimitException e) { + + } + ; + verifyRequest( + BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/accounts", params.toMap(), null); + } + @Test public void testTemporarySessionExpiredErrorServices() throws StripeException { stubRequestReturnError(