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 1/5] 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( From 150d98514326550ec8b252cb346cd281f15dbbdb Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Thu, 19 Mar 2026 17:08:00 -0700 Subject: [PATCH 2/5] =?UTF-8?q?=E2=9A=A0=EF=B8=8F=20Throw=20an=20error=20w?= =?UTF-8?q?hen=20using=20the=20wrong=20webhook=20parsing=20method=20(#2190?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add errors when parsing the wrong kind of webhooks payload * fix tests --- .../model/v2/core/EventNotification.java | 6 +++ src/main/java/com/stripe/net/Webhook.java | 11 +++++- .../java/com/stripe/StripeClientTest.java | 34 ++++++++++++++--- src/test/java/com/stripe/net/WebhookTest.java | 38 +++++++++++++++++++ 4 files changed, 82 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/stripe/model/v2/core/EventNotification.java b/src/main/java/com/stripe/model/v2/core/EventNotification.java index 2246cabcaa7..374abbb60f8 100644 --- a/src/main/java/com/stripe/model/v2/core/EventNotification.java +++ b/src/main/java/com/stripe/model/v2/core/EventNotification.java @@ -93,6 +93,12 @@ public static EventNotification fromJson(String payload, StripeClient client) { // don't love the double json parse here, but I don't think we can avoid it? JsonObject jsonObject = ApiResource.GSON.fromJson(payload, JsonObject.class).getAsJsonObject(); + if (jsonObject.has("object") && "event".equals(jsonObject.get("object").getAsString())) { + throw new IllegalArgumentException( + "You passed a webhook payload to StripeClient.parseEventNotification, which expects an event notification." + + " Use StripeClient.constructEvent instead."); + } + Class cls = EventNotificationClassLookup.eventClassLookup.get(jsonObject.get("type").getAsString()); if (cls == null) { diff --git a/src/main/java/com/stripe/net/Webhook.java b/src/main/java/com/stripe/net/Webhook.java index ea67ea34362..09505f70873 100644 --- a/src/main/java/com/stripe/net/Webhook.java +++ b/src/main/java/com/stripe/net/Webhook.java @@ -54,8 +54,8 @@ public static Event constructEvent( /** * Returns an Event instance using the provided JSON payload. Throws a JsonSyntaxException if the - * payload is not valid JSON, and a SignatureVerificationException if the signature verification - * fails for any reason. + * payload is not valid JSON, a SignatureVerificationException if the signature verification fails + * for any reason, and an IllegalArgumentException if you pass the wrong type of input. * * @param payload the payload sent by Stripe. * @param sigHeader the contents of the signature header sent by Stripe. @@ -72,6 +72,13 @@ public static Event constructEvent( Event event = StripeObject.deserializeStripeObject( payload, Event.class, ApiResource.getGlobalResponseGetter()); + + if ("v2.core.event".equals(event.getObject())) { + throw new IllegalArgumentException( + "You passed an event notification to Webhook.constructEvent, which expects a webhook payload." + + " Use StripeClient.parseEventNotification instead."); + } + Signature.verifyHeader(payload, sigHeader, secret, tolerance, clock); // StripeObjects source their raw JSON object from their last response, but constructed webhooks // don't have that diff --git a/src/test/java/com/stripe/StripeClientTest.java b/src/test/java/com/stripe/StripeClientTest.java index a26737f57cd..aa97216e5a4 100644 --- a/src/test/java/com/stripe/StripeClientTest.java +++ b/src/test/java/com/stripe/StripeClientTest.java @@ -140,7 +140,7 @@ public void checksWebhookSignature() StripeClient client = new StripeClient("sk_123"); String payload = - "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"event\"\n}"; + "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"v2.core.event\"\n}"; String secret = "whsec_test_secret"; Map options = new HashMap<>(); @@ -159,7 +159,7 @@ public void failsWebhookVerification() StripeClient client = new StripeClient("sk_123"); String payload = - "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"event\"\n}"; + "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"v2.core.event\"\n}"; String secret = "whsec_test_secret"; String signature = "bad signature"; @@ -173,7 +173,7 @@ public void failsWebhookVerification() static final String v2EventNotificationWithRelatedObject = "{\n" + " \"id\": \"evt_234\",\n" - + " \"object\": \"event\",\n" + + " \"object\": \"v2.core.event\",\n" + " \"type\": \"v1.billing.meter.error_report_triggered\",\n" + " \"livemode\": false,\n" + " \"context\": \"org_123\",\n" @@ -191,7 +191,7 @@ public void failsWebhookVerification() static final String v2EventNotificationWithoutRelatedObject = "{\n" + " \"id\": \"evt_234\",\n" - + " \"object\": \"event\",\n" + + " \"object\": \"v2.core.event\",\n" + " \"type\": \"v1.billing.meter.no_meter_found\",\n" + " \"livemode\": false,\n" + " \"created\": \"2022-02-15T00:27:45.330Z\"\n" @@ -200,7 +200,7 @@ public void failsWebhookVerification() static final String v2UnknownEventNotification = "{\n" + " \"id\": \"evt_234\",\n" - + " \"object\": \"event\",\n" + + " \"object\": \"v2.core.event\",\n" + " \"type\": \"v1.imaginary_event\",\n" + " \"livemode\": false,\n" + " \"created\": \"2022-02-15T00:27:45.330Z\"\n" @@ -417,4 +417,28 @@ public void parseEventNotificationAndPull() assertEquals("org_123", v.getOptions().getStripeContext()); } } + + @Test + public void parseEventNotificationRejectsV1Payload() + throws InvalidKeyException, NoSuchAlgorithmException { + StripeClient client = new StripeClient("sk_123"); + + String payload = + "{\n \"id\": \"evt_test_webhook\",\n \"object\": \"event\",\n \"type\": \"charge.succeeded\"\n}"; + String secret = "whsec_test_secret"; + + Map options = new HashMap<>(); + options.put("payload", payload); + options.put("secret", secret); + + String signature = WebhookTest.generateSigHeader(options); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> { + client.parseEventNotification(payload, signature, secret); + }); + assertTrue(exception.getMessage().contains("constructEvent")); + } } diff --git a/src/test/java/com/stripe/net/WebhookTest.java b/src/test/java/com/stripe/net/WebhookTest.java index c6a9c89aa77..3e1357b6bf3 100644 --- a/src/test/java/com/stripe/net/WebhookTest.java +++ b/src/test/java/com/stripe/net/WebhookTest.java @@ -335,4 +335,42 @@ public void testConstructEventWithRawJson() assertNotNull(event.getRawJsonObject()); } + + @Test + public void testConstructEventRejectsV2Payload() + throws NoSuchAlgorithmException, InvalidKeyException { + final String v2Payload = + "{\n \"id\": \"evt_test_webhook\",\n \"object\": \"v2.core.event\"\n}"; + final Map options = new HashMap<>(); + options.put("payload", v2Payload); + final String sigHeader = generateSigHeader(options); + + Throwable exception = + assertThrows( + IllegalArgumentException.class, + () -> { + Webhook.constructEvent(v2Payload, sigHeader, secret); + }); + assertTrue(exception.getMessage().contains("StripeClient.parseEventNotification")); + } + + @Test + public void testClientConstructEventRejectsV2Payload() + throws NoSuchAlgorithmException, InvalidKeyException { + StripeClient client = new StripeClient(new LiveStripeResponseGetter()); + + final String v2Payload = + "{\n \"id\": \"evt_test_webhook\",\n \"object\": \"v2.core.event\"\n}"; + final Map options = new HashMap<>(); + options.put("payload", v2Payload); + final String sigHeader = generateSigHeader(options); + + Throwable exception = + assertThrows( + IllegalArgumentException.class, + () -> { + client.constructEvent(v2Payload, sigHeader, secret); + }); + assertTrue(exception.getMessage().contains("StripeClient.parseEventNotification")); + } } From 28de1d0330685ead8c6ace36c539196a282b3161 Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Fri, 20 Mar 2026 08:35:21 -0700 Subject: [PATCH 3/5] Regenerate with decimal_string enabled for v2 APIs (#2187) --- .../com/stripe/model/v2/core/Account.java | 3 ++- .../stripe/model/v2/core/AccountPerson.java | 3 ++- src/main/java/com/stripe/net/JsonEncoder.java | 27 +++++++++++++++++++ .../param/v2/core/AccountCreateParams.java | 9 ++++--- .../v2/core/AccountTokenCreateParams.java | 9 ++++--- .../param/v2/core/AccountUpdateParams.java | 3 ++- .../v2/core/accounts/PersonCreateParams.java | 9 ++++--- .../accounts/PersonTokenCreateParams.java | 9 ++++--- .../v2/core/accounts/PersonUpdateParams.java | 3 ++- 9 files changed, 55 insertions(+), 20 deletions(-) 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 269497a1f2d..4af8544f7f8 100644 --- a/src/main/java/com/stripe/model/v2/core/Account.java +++ b/src/main/java/com/stripe/model/v2/core/Account.java @@ -5,6 +5,7 @@ import com.stripe.model.HasId; import com.stripe.model.StripeObject; import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import java.util.Map; @@ -5345,7 +5346,7 @@ public static class Relationship extends StripeObject { /** The percentage of the Account's identity that the individual owns. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** * Whether the individual is authorized as the primary representative of the Account. This diff --git a/src/main/java/com/stripe/model/v2/core/AccountPerson.java b/src/main/java/com/stripe/model/v2/core/AccountPerson.java index f3ce221205d..25eed6ceaab 100644 --- a/src/main/java/com/stripe/model/v2/core/AccountPerson.java +++ b/src/main/java/com/stripe/model/v2/core/AccountPerson.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import java.util.Map; @@ -584,7 +585,7 @@ public static class Relationship extends StripeObject { /** The percentage of the Account's identity that the individual owns. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** * Whether the individual is authorized as the primary representative of the Account. This is diff --git a/src/main/java/com/stripe/net/JsonEncoder.java b/src/main/java/com/stripe/net/JsonEncoder.java index 35de33bc6a2..898a7d6f5e3 100644 --- a/src/main/java/com/stripe/net/JsonEncoder.java +++ b/src/main/java/com/stripe/net/JsonEncoder.java @@ -3,15 +3,42 @@ import com.google.gson.FieldNamingPolicy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; final class JsonEncoder { + /** + * Serializes BigDecimal as a JSON string (e.g., "25.5") rather than a JSON number (25.5). All + * BigDecimal fields in the Stripe API use format: decimal, and the V2 API expects them as strings + * on the wire. + */ + private static final TypeAdapter BIG_DECIMAL_STRING_ADAPTER = + new TypeAdapter() { + @Override + public void write(JsonWriter out, BigDecimal value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(value.toPlainString()); + } + } + + @Override + public BigDecimal read(JsonReader in) throws IOException { + return new BigDecimal(in.nextString()); + } + }; + private static final Gson BODY_GSON = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .serializeNulls() + .registerTypeAdapter(BigDecimal.class, BIG_DECIMAL_STRING_ADAPTER) .create(); public static HttpContent createHttpContent(Map params) throws IOException { 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 48026ef7d63..f804f21010d 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -15655,7 +15656,7 @@ public static class Relationship { /** The percent owned by the person of the account's legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** The person's title (e.g., CEO, Support Engineer). */ @SerializedName("title") @@ -15666,7 +15667,7 @@ private Relationship( Boolean executive, Map extraParams, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, String title) { this.director = director; this.executive = executive; @@ -15689,7 +15690,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private String title; @@ -15758,7 +15759,7 @@ public Builder setOwner(Boolean owner) { } /** The percent owned by the person of the account's legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } 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 f2dec5cc6e3..4057ecb4dd6 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java @@ -5,6 +5,7 @@ import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -7123,7 +7124,7 @@ public static class Relationship { /** The percent owned by the person of the account's legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** The person's title (e.g., CEO, Support Engineer). */ @SerializedName("title") @@ -7134,7 +7135,7 @@ private Relationship( Boolean executive, Map extraParams, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, String title) { this.director = director; this.executive = executive; @@ -7157,7 +7158,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private String title; @@ -7226,7 +7227,7 @@ public Builder setOwner(Boolean owner) { } /** The percent owned by the person of the account's legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } 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 7bbc94507b1..63db37871ad 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java @@ -5,6 +5,7 @@ import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -17078,7 +17079,7 @@ public Builder setOwner(Boolean owner) { } /** The percent owned by the person of the account's legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java b/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java index cb190454762..23964e137e1 100644 --- a/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -2575,7 +2576,7 @@ public static class Relationship { /** The percentage of ownership the person has in the associated legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** Indicates whether the person is a representative of the associated legal entity. */ @SerializedName("representative") @@ -2592,7 +2593,7 @@ private Relationship( Map extraParams, Boolean legalGuardian, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, Boolean representative, String title) { this.authorizer = authorizer; @@ -2623,7 +2624,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private Boolean representative; @@ -2700,7 +2701,7 @@ public Builder setOwner(Boolean owner) { } /** The percentage of ownership the person has in the associated legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java b/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java index 5d4fae4ceb8..47d2c7f0f15 100644 --- a/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -2545,7 +2546,7 @@ public static class Relationship { /** The percentage of ownership the person has in the associated legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** Indicates whether the person is a representative of the associated legal entity. */ @SerializedName("representative") @@ -2562,7 +2563,7 @@ private Relationship( Map extraParams, Boolean legalGuardian, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, Boolean representative, String title) { this.authorizer = authorizer; @@ -2593,7 +2594,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private Boolean representative; @@ -2670,7 +2671,7 @@ public Builder setOwner(Boolean owner) { } /** The percentage of ownership the person has in the associated legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java b/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java index c886d483511..001c826555a 100644 --- a/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -2918,7 +2919,7 @@ public Builder setOwner(Boolean owner) { } /** The percentage of ownership the person has in the associated legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } From fc13c71f40c57b296d5316264e3348d561efc958 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 16:11:23 -0700 Subject: [PATCH 4/5] Update generated code for v2205 and (#2191) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- .../java/com/stripe/model/PaymentIntent.java | 4 ---- .../java/com/stripe/model/Subscription.java | 17 +++++++++++++++++ .../java/com/stripe/model/checkout/Session.java | 5 ++--- .../com/stripe/model/issuing/Cardholder.java | 6 +++--- .../param/PaymentIntentCaptureParams.java | 12 ------------ .../param/PaymentIntentConfirmParams.java | 12 ------------ .../stripe/param/PaymentIntentCreateParams.java | 12 ------------ ...ymentIntentIncrementAuthorizationParams.java | 12 ------------ .../stripe/param/PaymentIntentUpdateParams.java | 12 ------------ .../param/checkout/SessionCreateParams.java | 9 --------- .../param/issuing/CardholderCreateParams.java | 6 +++--- .../param/issuing/CardholderUpdateParams.java | 6 +++--- 14 files changed, 30 insertions(+), 87 deletions(-) diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 1992b4523bf..92d73382fd6 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -273184f052dd3c191b1993098365d0c2437d2cb4 \ No newline at end of file +b51a9d09327603fa3a61d076f4bf7f07b43e1659 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ad0b5d45105..4ec501ea29c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2204 \ No newline at end of file +v2205 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 9b9a4d0f406..6a542c66eea 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -2721,10 +2721,6 @@ public static class PaymentDetails extends StripeObject { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index f955227972f..c5414e35a2d 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -299,6 +299,9 @@ public class Subscription extends ApiResource implements HasId, MetadataStoreAPI Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PresentmentDetails extends StripeObject { + /** Currency used for customer payments. */ + @SerializedName("presentment_currency") + String presentmentCurrency; + } + /** * For more details about TransferData, please refer to the API Reference. @@ -2183,6 +2199,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(pendingInvoiceItemInterval, responseGetter); trySetResponseGetter(pendingSetupIntent, responseGetter); trySetResponseGetter(pendingUpdate, responseGetter); + trySetResponseGetter(presentmentDetails, responseGetter); trySetResponseGetter(schedule, responseGetter); trySetResponseGetter(testClock, responseGetter); trySetResponseGetter(transferData, responseGetter); diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index 0aa679c7f06..4ade0639f01 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -471,10 +471,9 @@ public class Session extends ApiResource implements HasId, MetadataStoreOne of {@code custom}, {@code elements}, {@code embedded}, {@code embedded_page}, {@code - * form}, {@code hosted}, or {@code hosted_page}. + *

One of {@code elements}, {@code embedded_page}, {@code form}, or {@code hosted_page}. */ @SerializedName("ui_mode") String uiMode; diff --git a/src/main/java/com/stripe/model/issuing/Cardholder.java b/src/main/java/com/stripe/model/issuing/Cardholder.java index 190e599df97..d7890fa03ba 100644 --- a/src/main/java/com/stripe/model/issuing/Cardholder.java +++ b/src/main/java/com/stripe/model/issuing/Cardholder.java @@ -99,9 +99,9 @@ public class Cardholder extends ApiResource implements HasId, MetadataStore3D Secure flow and one-time password - * messages sent to the cardholder. + * da}, {@code de}, {@code en}, {@code es}, {@code fr}, {@code it}, {@code pl}, or {@code sv}. + * This changes the language of the 3D Secure + * flow and one-time password messages sent to the cardholder. */ @SerializedName("preferred_locales") List preferredLocales; diff --git a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java index ec7a6702ae0..a2f3948fcc3 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java @@ -1993,10 +1993,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -2081,10 +2077,6 @@ public Builder putAllExtraParam(Map map) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -2098,10 +2090,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index d1b7defa9bf..8fef9d787e0 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -2664,10 +2664,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -2752,10 +2748,6 @@ public Builder putAllExtraParam(Map map) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -2769,10 +2761,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 52236d32165..5b3f4189e6f 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -3197,10 +3197,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -3285,10 +3281,6 @@ public Builder putAllExtraParam(Map map) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -3302,10 +3294,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. diff --git a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java index 490b0020c7d..62c304b123b 100644 --- a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java @@ -1951,10 +1951,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -2040,10 +2036,6 @@ public Builder putAllExtraParam(Map map) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -2057,10 +2049,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 554a8d43d30..6e8137663fc 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -2674,10 +2674,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -2762,10 +2758,6 @@ public Builder putAllExtraParam(Map map) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -2779,10 +2771,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 1893de69ace..476f481bba8 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -21163,24 +21163,15 @@ public enum SubmitType implements ApiRequestParams.EnumParam { } 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"), - @SerializedName("hosted_page") HOSTED_PAGE("hosted_page"); diff --git a/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java b/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java index 5a7bb885ea5..01ce2d89682 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java @@ -72,9 +72,9 @@ public class CardholderCreateParams extends ApiRequestParams { /** * The cardholder’s preferred locales (languages), ordered by preference. Locales can be {@code - * de}, {@code en}, {@code es}, {@code fr}, or {@code it}. This changes the language of the 3D Secure flow and one-time password - * messages sent to the cardholder. + * da}, {@code de}, {@code en}, {@code es}, {@code fr}, {@code it}, {@code pl}, or {@code sv}. + * This changes the language of the 3D Secure + * flow and one-time password messages sent to the cardholder. */ @SerializedName("preferred_locales") List preferredLocales; diff --git a/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java b/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java index c55c6bcbae0..d48c5d9d3dd 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java @@ -62,9 +62,9 @@ public class CardholderUpdateParams extends ApiRequestParams { /** * The cardholder’s preferred locales (languages), ordered by preference. Locales can be {@code - * de}, {@code en}, {@code es}, {@code fr}, or {@code it}. This changes the language of the 3D Secure flow and one-time password - * messages sent to the cardholder. + * da}, {@code de}, {@code en}, {@code es}, {@code fr}, {@code it}, {@code pl}, or {@code sv}. + * This changes the language of the 3D Secure + * flow and one-time password messages sent to the cardholder. */ @SerializedName("preferred_locales") List preferredLocales; From 60e98727cbadc6f46ddf7275b084f2e2927e0879 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 18:56:19 +0000 Subject: [PATCH 5/5] Update generated code for v2205 and --- CODEGEN_VERSION | 2 +- ...gnalsIncludingDelinquencyCreatedEvent.java | 72 ++ ...ngDelinquencyCreatedEventNotification.java | 14 + ...untSignalsFraudulentWebsiteReadyEvent.java | 47 + ...audulentWebsiteReadyEventNotification.java | 14 + .../V2CoreBatchJobBatchFailedEvent.java | 22 + ...eBatchJobBatchFailedEventNotification.java | 27 + .../events/V2CoreBatchJobCanceledEvent.java | 22 + ...CoreBatchJobCanceledEventNotification.java | 27 + .../events/V2CoreBatchJobCompletedEvent.java | 22 + ...oreBatchJobCompletedEventNotification.java | 27 + .../events/V2CoreBatchJobCreatedEvent.java | 22 + ...2CoreBatchJobCreatedEventNotification.java | 27 + .../V2CoreBatchJobReadyForUploadEvent.java | 22 + ...tchJobReadyForUploadEventNotification.java | 27 + .../events/V2CoreBatchJobTimeoutEvent.java | 22 + ...2CoreBatchJobTimeoutEventNotification.java | 27 + .../events/V2CoreBatchJobUpdatedEvent.java | 22 + ...2CoreBatchJobUpdatedEventNotification.java | 27 + .../V2CoreBatchJobUploadTimeoutEvent.java | 22 + ...atchJobUploadTimeoutEventNotification.java | 27 + .../events/V2CoreBatchJobValidatingEvent.java | 22 + ...reBatchJobValidatingEventNotification.java | 27 + .../V2CoreBatchJobValidationFailedEvent.java | 22 + ...hJobValidationFailedEventNotification.java | 27 + ...untSignalFraudulentMerchantReadyEvent.java | 94 ++ ...udulentMerchantReadyEventNotification.java | 14 + .../stripe/model/v2/EventDataClassLookup.java | 40 +- .../v2/EventNotificationClassLookup.java | 39 + .../com/stripe/model/v2/billing/Cadence.java | 3 + .../model/v2/billing/CollectionSetting.java | 3 + .../v2/billing/CollectionSettingVersion.java | 3 + .../com/stripe/model/v2/billing/Intent.java | 36 + .../stripe/model/v2/billing/IntentAction.java | 63 +- .../stripe/model/v2/billing/LicenseFee.java | 45 +- .../v2/billing/LicenseFeeSubscription.java | 74 -- .../model/v2/billing/LicenseFeeVersion.java | 3 + .../stripe/model/v2/billing/LicensedItem.java | 2 +- .../stripe/model/v2/billing/MeteredItem.java | 2 +- .../stripe/model/v2/billing/PricingPlan.java | 4 - .../v2/billing/PricingPlanComponent.java | 4 +- .../v2/billing/PricingPlanSubscription.java | 579 ++++++++++ .../PricingPlanSubscriptionComponents.java | 64 -- .../com/stripe/model/v2/billing/RateCard.java | 54 +- .../stripe/model/v2/billing/RateCardRate.java | 3 + .../com/stripe/model/v2/core/Account.java | 60 +- .../model/v2/core/AccountEvaluation.java | 116 ++ .../com/stripe/model/v2/core/BatchJob.java | 408 +++++++ .../model/v2/core/EventDestination.java | 48 +- .../model/v2/core/vault/GbBankAccount.java | 5 + .../model/v2/core/vault/UsBankAccount.java | 5 + .../v2/moneymanagement/FinancialAccount.java | 91 +- .../moneymanagement/OutboundPaymentQuote.java | 4 +- .../v2/moneymanagement/PayoutMethod.java | 11 + .../PayoutMethodsBankAccountSpec.java | 7 + .../model/v2/moneymanagement/Transaction.java | 63 +- .../v2/moneymanagement/TransactionEntry.java | 45 +- .../model/v2/payments/OffSessionPayment.java | 4 +- .../SettlementAllocationIntentSplit.java | 7 +- .../stripe/model/v2/reporting/ReportRun.java | 3 + .../CollectionSettingCreateParams.java | 3 + .../CollectionSettingUpdateParams.java | 3 + .../param/v2/billing/IntentCreateParams.java | 253 +++- .../param/v2/billing/IntentReserveParams.java | 113 ++ .../v2/billing/LicenseFeeCreateParams.java | 3 + .../v2/billing/LicenseFeeUpdateParams.java | 3 + .../v2/billing/LicensedItemCreateParams.java | 8 +- .../v2/billing/LicensedItemUpdateParams.java | 6 +- .../v2/billing/MeteredItemCreateParams.java | 8 +- .../v2/billing/MeteredItemUpdateParams.java | 6 +- .../v2/billing/OneTimeItemCreateParams.java | 4 +- .../PricingPlanSubscriptionListParams.java | 63 +- ...PlanSubscriptionRemoveDiscountsParams.java | 119 ++ ...PricingPlanSubscriptionRetrieveParams.java | 117 ++ .../v2/billing/RateCardModifyRatesParams.java | 1013 +++++++++++++++++ .../RateCardSubscriptionListParams.java | 4 +- .../pricingplans/ComponentCreateParams.java | 8 +- .../billing/ratecards/RateCreateParams.java | 3 + .../param/v2/core/AccountCreateParams.java | 29 +- .../core/AccountEvaluationCreateParams.java | 557 +++++++++ .../param/v2/core/AccountUpdateParams.java | 38 +- .../param/v2/core/BatchJobCreateParams.java | 356 ++++++ .../v2/core/EventDestinationCreateParams.java | 156 ++- .../core/vault/GbBankAccountCreateParams.java | 38 +- .../core/vault/UsBankAccountCreateParams.java | 15 + .../FinancialAccountListParams.java | 49 +- .../FinancialAccountRetrieveParams.java | 113 ++ .../OutboundPaymentCreateParams.java | 21 + .../OutboundSetupIntentCreateParams.java | 36 +- .../OutboundSetupIntentUpdateParams.java | 48 +- .../OutboundTransferCreateParams.java | 21 + .../com/stripe/service/v2/BillingService.java | 5 - .../com/stripe/service/v2/CoreService.java | 8 + .../service/v2/billing/IntentService.java | 21 +- .../LicenseFeeSubscriptionService.java | 30 - .../PricingPlanSubscriptionService.java | 59 +- .../service/v2/billing/RateCardService.java | 21 + .../ComponentService.java | 32 - .../v2/billing/ratecards/RateService.java | 8 +- .../v2/core/AccountEvaluationService.java | 41 + .../service/v2/core/BatchJobService.java | 59 + .../FinancialAccountService.java | 23 +- .../stripe/functional/GeneratedExamples.java | 351 ++++-- 103 files changed, 6016 insertions(+), 501 deletions(-) create mode 100644 src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEvent.java create mode 100644 src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobCanceledEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobCanceledEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobCompletedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobCompletedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobCreatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobCreatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobValidatingEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobValidatingEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEvent.java create mode 100644 src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEventNotification.java delete mode 100644 src/main/java/com/stripe/model/v2/billing/LicenseFeeSubscription.java delete mode 100644 src/main/java/com/stripe/model/v2/billing/PricingPlanSubscriptionComponents.java create mode 100644 src/main/java/com/stripe/model/v2/core/AccountEvaluation.java create mode 100644 src/main/java/com/stripe/model/v2/core/BatchJob.java create mode 100644 src/main/java/com/stripe/param/v2/billing/IntentReserveParams.java create mode 100644 src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRemoveDiscountsParams.java create mode 100644 src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/v2/billing/RateCardModifyRatesParams.java create mode 100644 src/main/java/com/stripe/param/v2/core/AccountEvaluationCreateParams.java create mode 100644 src/main/java/com/stripe/param/v2/core/BatchJobCreateParams.java create mode 100644 src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountRetrieveParams.java delete mode 100644 src/main/java/com/stripe/service/v2/billing/LicenseFeeSubscriptionService.java delete mode 100644 src/main/java/com/stripe/service/v2/billing/pricingplansubscriptions/ComponentService.java create mode 100644 src/main/java/com/stripe/service/v2/core/AccountEvaluationService.java create mode 100644 src/main/java/com/stripe/service/v2/core/BatchJobService.java diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index ccc00900eac..0ee8c670893 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -58595eed5a9dffbf0f297ecaf3ac45acf36c5de3 \ No newline at end of file +d70a4348dd46ca726ca64c856ce6bab15e87b470 \ No newline at end of file diff --git a/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEvent.java b/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEvent.java new file mode 100644 index 00000000000..42b507db585 --- /dev/null +++ b/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEvent.java @@ -0,0 +1,72 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; +import java.time.Instant; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V1AccountSignalsIncludingDelinquencyCreatedEvent extends Event { + /** Data for the v1.account_signals[delinquency].created event. */ + @SerializedName("data") + V1AccountSignalsIncludingDelinquencyCreatedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** The account for which the signals belong to. */ + @SerializedName("account") + String account; + /** Time at which the signal was evaluated. */ + @SerializedName("evaluated_at") + Instant evaluatedAt; + /** + * Array of objects representing individual factors that contributed to the calculated + * probability of delinquency. + */ + @SerializedName("indicators") + List indicators; + /** The probability of delinquency. Can be between 0.00 and 100.00. */ + @SerializedName("probability") + BigDecimal probability; + /** + * Categorical assessment of the delinquency risk based on probability. + * + *

One of {@code elevated}, {@code highest}, {@code low}, {@code normal}, {@code + * not_assessed}, or {@code unknown}. + */ + @SerializedName("risk_level") + String riskLevel; + /** Unique identifier for the delinquency signal. */ + @SerializedName("signal_id") + String signalId; + + public static final class Indicator { + /** A brief explanation of how this indicator contributed to the delinquency probability. */ + @SerializedName("description") + String description; + /** + * The effect this indicator had on the overall risk level. + * + *

One of {@code decrease}, {@code neutral}, {@code slight_increase}, or {@code + * strong_increase}. + */ + @SerializedName("impact") + String impact; + /** + * The name of the specific indicator used in the risk assessment. + * + *

One of {@code account_balance}, {@code aov}, {@code charge_concentration}, {@code + * disputes}, {@code dispute_window}, {@code duplicates}, {@code exposure}, {@code + * firmographic}, {@code lifetime_metrics}, {@code payment_processing}, {@code + * payment_volume}, {@code payouts}, {@code refunds}, {@code tenure}, or {@code transfers}. + */ + @SerializedName("indicator") + String indicator; + } + } +} diff --git a/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEventNotification.java b/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEventNotification.java new file mode 100644 index 00000000000..ba2811d094b --- /dev/null +++ b/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEventNotification.java @@ -0,0 +1,14 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.EventNotification; + +public final class V1AccountSignalsIncludingDelinquencyCreatedEventNotification + extends EventNotification { + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V1AccountSignalsIncludingDelinquencyCreatedEvent fetchEvent() throws StripeException { + return (V1AccountSignalsIncludingDelinquencyCreatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEvent.java b/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEvent.java new file mode 100644 index 00000000000..e1a91b08c94 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEvent.java @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.v2.core.Event; +import java.time.Instant; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2CoreAccountSignalsFraudulentWebsiteReadyEvent extends Event { + /** Data for the v2.core.account_signals.fraudulent_website_ready event. */ + @SerializedName("data") + V2CoreAccountSignalsFraudulentWebsiteReadyEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** The account for which the signals belong to. Empty if this was an entityless request. */ + @SerializedName("account") + String account; + /** + * Human readable description of concerns found in the website, produced by LLM. If risk_level + * is unknown, this explains why evaluation could not run. + */ + @SerializedName("details") + String details; + /** Time at which the signal was evaluated. */ + @SerializedName("evaluated_at") + Instant evaluatedAt; + /** Unique identifier for the fraudulent website evaluation request. */ + @SerializedName("evaluation_id") + String evaluationId; + /** + * Risk level for the fraudulent website signal. If evaluation could not run (like invalid + * website), we return unknown. + * + *

One of {@code elevated}, {@code highest}, {@code low}, {@code normal}, {@code + * not_assessed}, or {@code unknown}. + */ + @SerializedName("risk_level") + String riskLevel; + /** Unique identifier for the fraudulent website signal. */ + @SerializedName("signal_id") + String signalId; + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification.java new file mode 100644 index 00000000000..8233611e6c0 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification.java @@ -0,0 +1,14 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.EventNotification; + +public final class V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification + extends EventNotification { + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountSignalsFraudulentWebsiteReadyEvent fetchEvent() throws StripeException { + return (V2CoreAccountSignalsFraudulentWebsiteReadyEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEvent.java new file mode 100644 index 00000000000..01b73e46355 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobBatchFailedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEventNotification.java new file mode 100644 index 00000000000..43fd75ea458 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobBatchFailedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobBatchFailedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobBatchFailedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEvent.java new file mode 100644 index 00000000000..dbc844ac9cc --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCanceledEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEventNotification.java new file mode 100644 index 00000000000..f6822dfddc2 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCanceledEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobCanceledEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobCanceledEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEvent.java new file mode 100644 index 00000000000..0631ef3db37 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCompletedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEventNotification.java new file mode 100644 index 00000000000..3d000c119d2 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCompletedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobCompletedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobCompletedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEvent.java new file mode 100644 index 00000000000..b12abcecf09 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCreatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEventNotification.java new file mode 100644 index 00000000000..1b5e934daae --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCreatedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobCreatedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobCreatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEvent.java new file mode 100644 index 00000000000..e82c35c9005 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobReadyForUploadEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEventNotification.java new file mode 100644 index 00000000000..74f5acae6be --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobReadyForUploadEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobReadyForUploadEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobReadyForUploadEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEvent.java new file mode 100644 index 00000000000..8f9ac367539 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobTimeoutEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEventNotification.java new file mode 100644 index 00000000000..53a6bbe5cdb --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobTimeoutEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobTimeoutEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobTimeoutEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEvent.java new file mode 100644 index 00000000000..1406fe05335 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUpdatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEventNotification.java new file mode 100644 index 00000000000..b5a6ad485bc --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUpdatedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobUpdatedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEvent.java new file mode 100644 index 00000000000..dbc64ad541c --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUploadTimeoutEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEventNotification.java new file mode 100644 index 00000000000..ba3dbeadee7 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUploadTimeoutEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobUploadTimeoutEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobUploadTimeoutEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEvent.java new file mode 100644 index 00000000000..c382cf6c2af --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidatingEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEventNotification.java new file mode 100644 index 00000000000..4b8a29dd0a7 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidatingEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobValidatingEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobValidatingEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEvent.java new file mode 100644 index 00000000000..29ea687b803 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidationFailedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEventNotification.java new file mode 100644 index 00000000000..35088400687 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidationFailedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobValidationFailedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobValidationFailedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEvent.java b/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEvent.java new file mode 100644 index 00000000000..341e0c58622 --- /dev/null +++ b/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEvent.java @@ -0,0 +1,94 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; +import java.time.Instant; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2SignalsAccountSignalFraudulentMerchantReadyEvent extends Event { + /** Data for the v2.signals.account_signal.fraudulent_merchant_ready event. */ + @SerializedName("data") + V2SignalsAccountSignalFraudulentMerchantReadyEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** Account ID that this signal is associated with. */ + @SerializedName("account") + String account; + /** Timestamp when the signal was evaluated. */ + @SerializedName("evaluated_at") + Instant evaluatedAt; + /** Fraudulent merchant signal data. Present when type is fraudulent_merchant. */ + @SerializedName("fraudulent_merchant") + FraudulentMerchant fraudulentMerchant; + /** Unique identifier for this account signal. */ + @SerializedName("id") + String id; + /** + * The type of account signal. Currently only fraudulent_merchant is supported. + * + *

Equal to {@code fraudulent_merchant}. + */ + @SerializedName("type") + String type; + + public static final class FraudulentMerchant { + /** + * Array of objects representing individual factors that contributed to the calculated + * probability. Maximum of 3. + */ + @SerializedName("indicators") + List< + V2SignalsAccountSignalFraudulentMerchantReadyEvent.EventData.FraudulentMerchant + .Indicator> + indicators; + /** + * The probability of the merchant being fraudulent. Can be between 0.00 and 100.00. May be + * empty if the risk_level is UNKNOWN or NOT_ASSESSED. + */ + @SerializedName("probability") + BigDecimal probability; + /** + * Categorical assessment of the fraudulent merchant risk based on probability. + * + *

One of {@code elevated}, {@code highest}, {@code low}, {@code normal}, {@code + * not_assessed}, or {@code unknown}. + */ + @SerializedName("risk_level") + String riskLevel; + + public static final class Indicator { + /** + * A brief explanation of how this indicator contributed to the fraudulent merchant + * probability. + */ + @SerializedName("description") + String description; + /** + * The effect this indicator had on the overall risk level. + * + *

One of {@code decrease}, {@code neutral}, {@code slight_increase}, or {@code + * strong_increase}. + */ + @SerializedName("impact") + String impact; + /** + * The name of the specific indicator used in the risk assessment. + * + *

One of {@code bank_account}, {@code business_information_and_account_activity}, {@code + * disputes}, {@code failures}, {@code geolocation}, {@code other}, {@code + * other_related_accounts}, {@code other_transaction_activity}, {@code owner_email}, or + * {@code web_presence}. + */ + @SerializedName("indicator") + String indicator; + } + } + } +} diff --git a/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEventNotification.java b/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEventNotification.java new file mode 100644 index 00000000000..2b6612ac981 --- /dev/null +++ b/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEventNotification.java @@ -0,0 +1,14 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.EventNotification; + +public final class V2SignalsAccountSignalFraudulentMerchantReadyEventNotification + extends EventNotification { + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2SignalsAccountSignalFraudulentMerchantReadyEvent fetchEvent() throws StripeException { + return (V2SignalsAccountSignalFraudulentMerchantReadyEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java index 81e42a784e6..619371d772f 100644 --- a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java @@ -43,9 +43,6 @@ public final class EventDataClassLookup { classLookup.put("v2.billing.intent", com.stripe.model.v2.billing.Intent.class); classLookup.put("v2.billing.intent_action", com.stripe.model.v2.billing.IntentAction.class); classLookup.put("v2.billing.license_fee", com.stripe.model.v2.billing.LicenseFee.class); - classLookup.put( - "v2.billing.license_fee_subscription", - com.stripe.model.v2.billing.LicenseFeeSubscription.class); classLookup.put( "v2.billing.license_fee_version", com.stripe.model.v2.billing.LicenseFeeVersion.class); classLookup.put("v2.billing.licensed_item", com.stripe.model.v2.billing.LicensedItem.class); @@ -64,9 +61,6 @@ public final class EventDataClassLookup { classLookup.put( "v2.billing.pricing_plan_subscription", com.stripe.model.v2.billing.PricingPlanSubscription.class); - classLookup.put( - "v2.billing.pricing_plan_subscription_components", - com.stripe.model.v2.billing.PricingPlanSubscriptionComponents.class); classLookup.put( "v2.billing.pricing_plan_version", com.stripe.model.v2.billing.PricingPlanVersion.class); classLookup.put("v2.billing.profile", com.stripe.model.v2.billing.Profile.class); @@ -83,11 +77,13 @@ public final class EventDataClassLookup { classLookup.put("v2.billing.service_action", com.stripe.model.v2.billing.ServiceAction.class); classLookup.put("v2.core.account", com.stripe.model.v2.core.Account.class); + classLookup.put("v2.core.account_evaluation", com.stripe.model.v2.core.AccountEvaluation.class); classLookup.put("v2.core.account_link", com.stripe.model.v2.core.AccountLink.class); classLookup.put("v2.core.account_person", com.stripe.model.v2.core.AccountPerson.class); classLookup.put( "v2.core.account_person_token", com.stripe.model.v2.core.AccountPersonToken.class); classLookup.put("v2.core.account_token", com.stripe.model.v2.core.AccountToken.class); + classLookup.put("v2.core.batch_job", com.stripe.model.v2.core.BatchJob.class); classLookup.put("v2.core.claimable_sandbox", com.stripe.model.v2.core.ClaimableSandbox.class); classLookup.put("v2.core.connection_session", com.stripe.model.v2.core.ConnectionSession.class); classLookup.put("v2.core.event", com.stripe.model.v2.core.Event.class); @@ -161,6 +157,9 @@ public final class EventDataClassLookup { classLookup.put("v2.tax.manual_rule", com.stripe.model.v2.tax.ManualRule.class); + eventClassLookup.put( + "v1.account_signals[delinquency].created", + com.stripe.events.V1AccountSignalsIncludingDelinquencyCreatedEvent.class); eventClassLookup.put( "v1.billing.meter.error_report_triggered", com.stripe.events.V1BillingMeterErrorReportTriggeredEvent.class); @@ -335,6 +334,32 @@ public final class EventDataClassLookup { "v2.core.account_person.deleted", com.stripe.events.V2CoreAccountPersonDeletedEvent.class); eventClassLookup.put( "v2.core.account_person.updated", com.stripe.events.V2CoreAccountPersonUpdatedEvent.class); + eventClassLookup.put( + "v2.core.account_signals.fraudulent_website_ready", + com.stripe.events.V2CoreAccountSignalsFraudulentWebsiteReadyEvent.class); + eventClassLookup.put( + "v2.core.batch_job.batch_failed", com.stripe.events.V2CoreBatchJobBatchFailedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.canceled", com.stripe.events.V2CoreBatchJobCanceledEvent.class); + eventClassLookup.put( + "v2.core.batch_job.completed", com.stripe.events.V2CoreBatchJobCompletedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.created", com.stripe.events.V2CoreBatchJobCreatedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.ready_for_upload", + com.stripe.events.V2CoreBatchJobReadyForUploadEvent.class); + eventClassLookup.put( + "v2.core.batch_job.timeout", com.stripe.events.V2CoreBatchJobTimeoutEvent.class); + eventClassLookup.put( + "v2.core.batch_job.updated", com.stripe.events.V2CoreBatchJobUpdatedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.upload_timeout", + com.stripe.events.V2CoreBatchJobUploadTimeoutEvent.class); + eventClassLookup.put( + "v2.core.batch_job.validating", com.stripe.events.V2CoreBatchJobValidatingEvent.class); + eventClassLookup.put( + "v2.core.batch_job.validation_failed", + com.stripe.events.V2CoreBatchJobValidationFailedEvent.class); eventClassLookup.put( "v2.core.claimable_sandbox.claimed", com.stripe.events.V2CoreClaimableSandboxClaimedEvent.class); @@ -624,5 +649,8 @@ public final class EventDataClassLookup { eventClassLookup.put( "v2.reporting.report_run.updated", com.stripe.events.V2ReportingReportRunUpdatedEvent.class); + eventClassLookup.put( + "v2.signals.account_signal.fraudulent_merchant_ready", + com.stripe.events.V2SignalsAccountSignalFraudulentMerchantReadyEvent.class); } } diff --git a/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java b/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java index a0209485cd7..0cbbd818354 100644 --- a/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java @@ -16,6 +16,9 @@ public final class EventNotificationClassLookup { new HashMap<>(); static { + eventClassLookup.put( + "v1.account_signals[delinquency].created", + com.stripe.events.V1AccountSignalsIncludingDelinquencyCreatedEventNotification.class); eventClassLookup.put( "v1.billing.meter.error_report_triggered", com.stripe.events.V1BillingMeterErrorReportTriggeredEventNotification.class); @@ -215,6 +218,39 @@ public final class EventNotificationClassLookup { eventClassLookup.put( "v2.core.account_person.updated", com.stripe.events.V2CoreAccountPersonUpdatedEventNotification.class); + eventClassLookup.put( + "v2.core.account_signals.fraudulent_website_ready", + com.stripe.events.V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.batch_failed", + com.stripe.events.V2CoreBatchJobBatchFailedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.canceled", + com.stripe.events.V2CoreBatchJobCanceledEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.completed", + com.stripe.events.V2CoreBatchJobCompletedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.created", + com.stripe.events.V2CoreBatchJobCreatedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.ready_for_upload", + com.stripe.events.V2CoreBatchJobReadyForUploadEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.timeout", + com.stripe.events.V2CoreBatchJobTimeoutEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.updated", + com.stripe.events.V2CoreBatchJobUpdatedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.upload_timeout", + com.stripe.events.V2CoreBatchJobUploadTimeoutEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.validating", + com.stripe.events.V2CoreBatchJobValidatingEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.validation_failed", + com.stripe.events.V2CoreBatchJobValidationFailedEventNotification.class); eventClassLookup.put( "v2.core.claimable_sandbox.claimed", com.stripe.events.V2CoreClaimableSandboxClaimedEventNotification.class); @@ -521,5 +557,8 @@ public final class EventNotificationClassLookup { eventClassLookup.put( "v2.reporting.report_run.updated", com.stripe.events.V2ReportingReportRunUpdatedEventNotification.class); + eventClassLookup.put( + "v2.signals.account_signal.fraudulent_merchant_ready", + com.stripe.events.V2SignalsAccountSignalFraudulentMerchantReadyEventNotification.class); } } diff --git a/src/main/java/com/stripe/model/v2/billing/Cadence.java b/src/main/java/com/stripe/model/v2/billing/Cadence.java index 7503588f52f..b4fda734733 100644 --- a/src/main/java/com/stripe/model/v2/billing/Cadence.java +++ b/src/main/java/com/stripe/model/v2/billing/Cadence.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.math.BigDecimal; import java.time.Instant; @@ -723,6 +725,7 @@ public static class Card extends StripeObject { public static class MandateOptions extends StripeObject { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java b/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java index 4a9be6c5836..146ebdd6e6c 100644 --- a/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.time.Instant; import java.util.List; @@ -247,6 +249,7 @@ public static class Card extends StripeObject { public static class MandateOptions extends StripeObject { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java b/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java index fb3cbd49a15..2035073002d 100644 --- a/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.time.Instant; import java.util.List; @@ -226,6 +228,7 @@ public static class Card extends StripeObject { public static class MandateOptions extends StripeObject { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/model/v2/billing/Intent.java b/src/main/java/com/stripe/model/v2/billing/Intent.java index 073de4ac14d..75188bf0a0b 100644 --- a/src/main/java/com/stripe/model/v2/billing/Intent.java +++ b/src/main/java/com/stripe/model/v2/billing/Intent.java @@ -44,6 +44,13 @@ public class Intent extends StripeObject implements HasId { @SerializedName("id") String id; + /** + * Invoice resources associated with this Billing Intent. Populated when include parameters are + * specified. + */ + @SerializedName("invoice_resources") + InvoiceResources invoiceResources; + /** * Has the value {@code true} if the object exists in live mode or the value {@code false} if the * object exists in test mode. @@ -77,10 +84,18 @@ public class Intent extends StripeObject implements HasId { @Setter @EqualsAndHashCode(callSuper = false) public static class AmountDetails extends StripeObject { + /** The outstanding amount after discount, tax, and customer balance application. */ + @SerializedName("amount_due") + String amountDue; + /** Three-letter ISO currency code, in lowercase. Must be a supported currency. */ @SerializedName("currency") String currency; + /** The customer's account balance applied to the amount. */ + @SerializedName("customer_balance_applied") + String customerBalanceApplied; + /** Amount of discount applied. */ @SerializedName("discount") String discount; @@ -423,6 +438,23 @@ public static class Collection extends StripeObject implements HasId { } } + /** + * Invoice resources associated with this Billing Intent. Populated when include parameters are + * specified. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InvoiceResources extends StripeObject { + /** + * ID of a preview invoice showing the breakdown of line items. Null if the billing intent will + * not create an invoice. Only present when "invoice_resources.preview_invoice" is + * included. + */ + @SerializedName("preview_invoice") + String previewInvoice; + } + /** Timestamps for status transitions of the Billing Intent. */ @Getter @Setter @@ -440,6 +472,10 @@ public static class StatusTransitions extends StripeObject { @SerializedName("drafted_at") Instant draftedAt; + /** Time at which the Billing Intent will expire. */ + @SerializedName("expires_at") + Instant expiresAt; + /** Time at which the Billing Intent was reserved. */ @SerializedName("reserved_at") Instant reservedAt; diff --git a/src/main/java/com/stripe/model/v2/billing/IntentAction.java b/src/main/java/com/stripe/model/v2/billing/IntentAction.java index d22b6e89390..707670ac283 100644 --- a/src/main/java/com/stripe/model/v2/billing/IntentAction.java +++ b/src/main/java/com/stripe/model/v2/billing/IntentAction.java @@ -81,7 +81,11 @@ public class IntentAction extends StripeObject implements HasId { @Setter @EqualsAndHashCode(callSuper = false) public static class Apply extends StripeObject { - /** When the apply action will take effect. Defaults to on_reserve if not specified. */ + /** Details for applying a discount. */ + @SerializedName("discount") + Discount discount; + + /** When the apply action will take effect. If not specified, defaults to on_reserve. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -96,21 +100,54 @@ public static class Apply extends StripeObject { /** * Type of the apply action details. * - *

One of {@code invoice_discount_rule}, or {@code spend_modifier_rule}. + *

One of {@code discount}, {@code invoice_discount_rule}, or {@code spend_modifier_rule}. */ @SerializedName("type") String type; - /** When the apply action will take effect. Defaults to on_reserve if not specified. */ + /** Details for applying a discount. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Discount extends StripeObject { + /** The ID of the Coupon applied. */ + @SerializedName("coupon") + String coupon; + + /** The ID of the created Discount. */ + @SerializedName("discount") + String discount; + + /** The ID of the PromotionCode applied. */ + @SerializedName("promotion_code") + String promotionCode; + + /** + * Type of the discount. + * + *

One of {@code coupon}, or {@code promotion_code}. + */ + @SerializedName("type") + String type; + } + + /** When the apply action will take effect. If not specified, defaults to on_reserve. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class EffectiveAt extends StripeObject { + /** + * The timestamp at which the apply action will take effect. Only present if type is + * timestamp. Only allowed for discount actions. + */ + @SerializedName("timestamp") + Instant timestamp; + /** * When the apply action will take effect. * - *

One of {@code current_billing_period_end}, {@code next_billing_period_start}, or {@code - * on_reserve}. + *

One of {@code current_billing_period_end}, {@code current_billing_period_start}, {@code + * next_billing_period_start}, {@code on_reserve}, or {@code timestamp}. */ @SerializedName("type") String type; @@ -225,7 +262,7 @@ public static class MaxBillingPeriodSpend extends StripeObject { @SerializedName("amount") Amount amount; - /** The configration for the overage rate for the custom pricing unit. */ + /** The configuration for the overage rate for the custom pricing unit. */ @SerializedName("custom_pricing_unit_overage_rate") CustomPricingUnitOverageRate customPricingUnitOverageRate; @@ -257,7 +294,7 @@ public static class CustomPricingUnit extends StripeObject { } } - /** The configration for the overage rate for the custom pricing unit. */ + /** The configuration for the overage rate for the custom pricing unit. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -397,7 +434,7 @@ public static class PartialPeriodBehavior extends StripeObject { /** * The type of behavior to override. * - *

Equal to {@code license_fee}. + *

One of {@code license_fee}, or {@code recurring_credit_grant}. */ @SerializedName("type") String type; @@ -555,7 +592,7 @@ public static class PartialPeriodBehavior extends StripeObject { /** * The type of behavior to override. * - *

Equal to {@code license_fee}. + *

One of {@code license_fee}, or {@code recurring_credit_grant}. */ @SerializedName("type") String type; @@ -598,7 +635,7 @@ public static class LicenseFee extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Remove extends StripeObject { - /** When the remove action will take effect. Defaults to on_reserve if not specified. */ + /** When the remove action will take effect. If not specified, defaults to on_reserve. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -618,7 +655,7 @@ public static class Remove extends StripeObject { @SerializedName("type") String type; - /** When the remove action will take effect. Defaults to on_reserve if not specified. */ + /** When the remove action will take effect. If not specified, defaults to on_reserve. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -779,7 +816,7 @@ public static class PartialPeriodBehavior extends StripeObject { /** * The type of behavior to override. * - *

Equal to {@code license_fee}. + *

One of {@code license_fee}, or {@code recurring_credit_grant}. */ @SerializedName("type") String type; @@ -848,7 +885,7 @@ public static class Item extends StripeObject { @SerializedName("price") String price; - /** Quantity for this item. If not provided, will default to 1. */ + /** Quantity for this item. If not provided, defaults to 1. */ @SerializedName("quantity") Long quantity; } diff --git a/src/main/java/com/stripe/model/v2/billing/LicenseFee.java b/src/main/java/com/stripe/model/v2/billing/LicenseFee.java index da4b8901c7c..c05ddb74402 100644 --- a/src/main/java/com/stripe/model/v2/billing/LicenseFee.java +++ b/src/main/java/com/stripe/model/v2/billing/LicenseFee.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.math.BigDecimal; import java.time.Instant; @@ -50,10 +52,6 @@ public class LicenseFee extends StripeObject implements HasId { @SerializedName("id") String id; - /** The ID of the license fee's most recently created version. */ - @SerializedName("latest_version") - String latestVersion; - /** * A Licensed Item represents a billable item whose pricing is based on license fees. You can use * license fees to specify the pricing and create subscriptions to these items. @@ -99,20 +97,9 @@ public class LicenseFee extends StripeObject implements HasId { @SerializedName("object") String object; - /** - * The interval for assessing service. - * - *

One of {@code day}, {@code month}, {@code week}, or {@code year}. - */ - @SerializedName("service_interval") - String serviceInterval; - - /** - * The length of the interval for assessing service. For example, set this to 3 and {@code - * service_interval} to {@code "month"} in order to specify quarterly service. - */ - @SerializedName("service_interval_count") - Long serviceIntervalCount; + /** The service cycle configuration for this License Fee. */ + @SerializedName("service_cycle") + ServiceCycle serviceCycle; /** * The Stripe Tax tax behavior - whether the license fee is inclusive or exclusive of tax. @@ -150,6 +137,27 @@ public class LicenseFee extends StripeObject implements HasId { @SerializedName("unit_amount") String unitAmount; + /** The service cycle configuration for this License Fee. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServiceCycle extends StripeObject { + /** + * The interval for assessing service. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The length of the interval for assessing service. For example, set this to 3 and {@code + * interval} to {@code "month"} in order to specify quarterly service. + */ + @SerializedName("interval_count") + Long intervalCount; + } + /** * For more details about Tier, please refer to the API * Reference. @@ -197,6 +205,7 @@ public static class Tier extends StripeObject { public static class TransformQuantity extends StripeObject { /** Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** diff --git a/src/main/java/com/stripe/model/v2/billing/LicenseFeeSubscription.java b/src/main/java/com/stripe/model/v2/billing/LicenseFeeSubscription.java deleted file mode 100644 index 944d094d9d6..00000000000 --- a/src/main/java/com/stripe/model/v2/billing/LicenseFeeSubscription.java +++ /dev/null @@ -1,74 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.model.v2.billing; - -import com.google.gson.annotations.SerializedName; -import com.stripe.model.HasId; -import com.stripe.model.StripeObject; -import java.time.Instant; -import java.util.Map; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; - -/** - * A License Fee Subscription represents a customer's subscription to a License Fee at a specified - * quantity. It tracks the number of units (such as seats or licenses) the customer has subscribed - * to and bills them according to the service interval defined in the License Fee and the Billing - * Cadence. - */ -@Getter -@Setter -@EqualsAndHashCode(callSuper = false) -public class LicenseFeeSubscription extends StripeObject implements HasId { - /** The ID of the Billing Cadence. */ - @SerializedName("billing_cadence") - String billingCadence; - - /** Timestamp of when the object was created. */ - @SerializedName("created") - Instant created; - - /** Unique identifier for the object. */ - @Getter(onMethod_ = {@Override}) - @SerializedName("id") - String id; - - /** The ID of the License Fee. */ - @SerializedName("license_fee") - String licenseFee; - - /** The ID of the License Fee Version. */ - @SerializedName("license_fee_version") - String licenseFeeVersion; - - /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. - */ - @SerializedName("livemode") - Boolean livemode; - - /** - * 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. - */ - @SerializedName("metadata") - Map metadata; - - /** - * String representing the object's type. Objects of the same type share the same value of the - * object field. - * - *

Equal to {@code v2.billing.license_fee_subscription}. - */ - @SerializedName("object") - String object; - - /** Quantity of the License Fee subscribed to. */ - @SerializedName("quantity") - Long quantity; - - /** The ID of the Test Clock, if any. */ - @SerializedName("test_clock") - String testClock; -} diff --git a/src/main/java/com/stripe/model/v2/billing/LicenseFeeVersion.java b/src/main/java/com/stripe/model/v2/billing/LicenseFeeVersion.java index 50040a63a29..0c47e70c65c 100644 --- a/src/main/java/com/stripe/model/v2/billing/LicenseFeeVersion.java +++ b/src/main/java/com/stripe/model/v2/billing/LicenseFeeVersion.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.math.BigDecimal; import java.time.Instant; @@ -125,6 +127,7 @@ public static class Tier extends StripeObject { public static class TransformQuantity extends StripeObject { /** Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** diff --git a/src/main/java/com/stripe/model/v2/billing/LicensedItem.java b/src/main/java/com/stripe/model/v2/billing/LicensedItem.java index b5741caf7ba..684542de089 100644 --- a/src/main/java/com/stripe/model/v2/billing/LicensedItem.java +++ b/src/main/java/com/stripe/model/v2/billing/LicensedItem.java @@ -41,7 +41,7 @@ public class LicensedItem extends StripeObject implements HasId { Boolean livemode; /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular licensed item. Maximum length of 200 * characters. */ @SerializedName("lookup_key") diff --git a/src/main/java/com/stripe/model/v2/billing/MeteredItem.java b/src/main/java/com/stripe/model/v2/billing/MeteredItem.java index 404e2800147..1d2da0a74a0 100644 --- a/src/main/java/com/stripe/model/v2/billing/MeteredItem.java +++ b/src/main/java/com/stripe/model/v2/billing/MeteredItem.java @@ -46,7 +46,7 @@ public class MeteredItem extends StripeObject implements HasId { Boolean livemode; /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular metered item. Maximum length of 200 * characters. */ @SerializedName("lookup_key") diff --git a/src/main/java/com/stripe/model/v2/billing/PricingPlan.java b/src/main/java/com/stripe/model/v2/billing/PricingPlan.java index d69690be424..f19c3440dd1 100644 --- a/src/main/java/com/stripe/model/v2/billing/PricingPlan.java +++ b/src/main/java/com/stripe/model/v2/billing/PricingPlan.java @@ -46,10 +46,6 @@ public class PricingPlan extends StripeObject implements HasId { @SerializedName("id") String id; - /** The ID of the latest version of the PricingPlan. */ - @SerializedName("latest_version") - String latestVersion; - /** The ID of the live version of the PricingPlan. */ @SerializedName("live_version") String liveVersion; diff --git a/src/main/java/com/stripe/model/v2/billing/PricingPlanComponent.java b/src/main/java/com/stripe/model/v2/billing/PricingPlanComponent.java index 4afed58c854..7b7ac54db72 100644 --- a/src/main/java/com/stripe/model/v2/billing/PricingPlanComponent.java +++ b/src/main/java/com/stripe/model/v2/billing/PricingPlanComponent.java @@ -95,7 +95,7 @@ public static class LicenseFee extends StripeObject implements HasId { @SerializedName("id") String id; - /** The version of the LicenseFee. Defaults to 'latest', if not specified. */ + /** The ID of the License Fee Version. If not specified, defaults to 'latest'. */ @SerializedName("version") String version; } @@ -110,7 +110,7 @@ public static class RateCard extends StripeObject implements HasId { @SerializedName("id") String id; - /** The version of the RateCard. Defaults to 'latest', if not specified. */ + /** The ID of the Rate Card Version. If not specified, defaults to 'latest'. */ @SerializedName("version") String version; } diff --git a/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscription.java b/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscription.java index 29e8b32af34..a1b7f9faac7 100644 --- a/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscription.java +++ b/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscription.java @@ -1,10 +1,14 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; +import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -48,6 +52,10 @@ public class PricingPlanSubscription extends StripeObject implements HasId { @SerializedName("created") Instant created; + /** Details about Discounts applied to this subscription. */ + @SerializedName("discount_details") + List discountDetails; + /** Unique identifier for the object. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") @@ -81,6 +89,13 @@ public class PricingPlanSubscription extends StripeObject implements HasId { @SerializedName("pricing_plan") String pricingPlan; + /** + * Pricing plan component details for the subscription, populated when + * pricing_plan_component_details is included. + */ + @SerializedName("pricing_plan_component_details") + List pricingPlanComponentDetails; + /** The ID of the Pricing Plan Version for this subscription. */ @SerializedName("pricing_plan_version") String pricingPlanVersion; @@ -162,6 +177,570 @@ public static class CollectionStatusTransitions extends StripeObject { String unpaidAt; } + /** + * For more details about DiscountDetail, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DiscountDetail extends StripeObject { + /** The ID of the Discount. */ + @SerializedName("discount") + String discount; + + /** The time at which the Discount ends, if applicable. */ + @SerializedName("end") + Instant end; + + /** The ID of the PromotionCode, if applicable. */ + @SerializedName("promotion_code") + String promotionCode; + + /** The source of the Discount. */ + @SerializedName("source") + Source source; + + /** The time at which the Discount starts. */ + @SerializedName("start") + Instant start; + + /** The source of the Discount. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Source extends StripeObject { + /** The ID of the Coupon. */ + @SerializedName("coupon") + String coupon; + + /** + * Type of the Discount source. + * + *

Equal to {@code coupon}. + */ + @SerializedName("type") + String type; + } + } + + /** + * For more details about PricingPlanComponentDetail, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PricingPlanComponentDetail extends StripeObject { + /** License fee details, present when type is license_fee_details. */ + @SerializedName("license_fee_details") + LicenseFeeDetails licenseFeeDetails; + + /** The ID of the Pricing Plan Component. */ + @SerializedName("pricing_plan_component") + String pricingPlanComponent; + + /** Rate card details, present when type is rate_card_details. */ + @SerializedName("rate_card_details") + RateCardDetails rateCardDetails; + + /** Recurring credit grant details, present when type is recurring_credit_grant_details. */ + @SerializedName("recurring_credit_grant_details") + RecurringCreditGrantDetails recurringCreditGrantDetails; + + /** + * The type of component details included. + * + *

One of {@code license_fee_details}, {@code rate_card_details}, or {@code + * recurring_credit_grant_details}. + */ + @SerializedName("type") + String type; + + /** License fee details, present when type is license_fee_details. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LicenseFeeDetails extends StripeObject { + /** Three-letter ISO currency code, in lowercase. */ + @SerializedName("currency") + String currency; + + /** A customer-facing name for the license fee. */ + @SerializedName("display_name") + String displayName; + + /** The ID of the License Fee. */ + @SerializedName("license_fee") + String licenseFee; + + /** The ID of the License Fee Version. */ + @SerializedName("license_fee_version") + String licenseFeeVersion; + + /** Quantity of the license fee on the subscription. */ + @SerializedName("quantity") + Long quantity; + + /** The service cycle configuration. */ + @SerializedName("service_cycle") + ServiceCycle serviceCycle; + + /** + * Defines whether the tiering price should be graduated or volume-based. + * + *

One of {@code graduated}, or {@code volume}. + */ + @SerializedName("tiering_mode") + String tieringMode; + + /** Each element represents a pricing tier. */ + @SerializedName("tiers") + List tiers; + + /** + * Apply a transformation to the reported usage or set quantity before computing the amount + * billed. + */ + @SerializedName("transform_quantity") + TransformQuantity transformQuantity; + + /** + * The per-unit amount to be charged, represented as a decimal string in minor currency units + * with at most 12 decimal places. + */ + @SerializedName("unit_amount") + String unitAmount; + + /** + * The unit label from the licensed item, used for display purposes (e.g. "seat", + * "environment"). + */ + @SerializedName("unit_label") + String unitLabel; + + /** The service cycle configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServiceCycle extends StripeObject { + /** + * The interval for assessing service. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The length of the interval for assessing service. For example, set this to 3 and {@code + * interval} to {@code "month"} in order to specify quarterly service. + */ + @SerializedName("interval_count") + Long intervalCount; + } + + /** + * For more details about Tier, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tier extends StripeObject { + /** + * Price for the entire tier, represented as a decimal string in minor currency units with + * at most 12 decimal places. + */ + @SerializedName("flat_amount") + String flatAmount; + + /** + * Per-unit price for units included in this tier, represented as a decimal string in minor + * currency units with at most 12 decimal places. + */ + @SerializedName("unit_amount") + String unitAmount; + + /** + * Up to and including this quantity will be contained in the tier. Only one of {@code + * up_to_decimal} and {@code up_to_inf} may be set. + */ + @SerializedName("up_to_decimal") + BigDecimal upToDecimal; + + /** + * No upper bound to this tier. Only one of {@code up_to_decimal} and {@code up_to_inf} may + * be set. + */ + @SerializedName("up_to_inf") + String upToInf; + } + + /** + * Apply a transformation to the reported usage or set quantity before computing the amount + * billed. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class TransformQuantity extends StripeObject { + /** Divide usage by this number. */ + @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) + Long divideBy; + + /** + * After division, round the result up or down. + * + *

One of {@code down}, or {@code up}. + */ + @SerializedName("round") + String round; + } + } + + /** Rate card details, present when type is rate_card_details. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RateCardDetails extends StripeObject { + /** Three-letter ISO currency code, in lowercase. */ + @SerializedName("currency") + String currency; + + /** A customer-facing name for the rate card. */ + @SerializedName("display_name") + String displayName; + + /** The ID of the Rate Card. */ + @SerializedName("rate_card") + String rateCard; + + /** The ID of the Rate Card Version. */ + @SerializedName("rate_card_version") + String rateCardVersion; + + /** The service cycle configuration. */ + @SerializedName("service_cycle") + ServiceCycle serviceCycle; + + /** + * Whether the rates are inclusive or exclusive of tax. + * + *

One of {@code exclusive}, or {@code inclusive}. + */ + @SerializedName("tax_behavior") + String taxBehavior; + + /** The service cycle configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServiceCycle extends StripeObject { + /** + * The interval for assessing service. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The length of the interval for assessing service. For example, set this to 3 and {@code + * interval} to {@code "month"} in order to specify quarterly service. + */ + @SerializedName("interval_count") + Long intervalCount; + } + } + + /** Recurring credit grant details, present when type is recurring_credit_grant_details. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RecurringCreditGrantDetails extends StripeObject { + /** Credit grant details, present when type is CREDIT_GRANT. */ + @SerializedName("credit_grant_details") + CreditGrantDetails creditGrantDetails; + + /** Credit grant per tenant details, present when type is CREDIT_GRANT_PER_TENANT. */ + @SerializedName("credit_grant_per_tenant_details") + CreditGrantPerTenantDetails creditGrantPerTenantDetails; + + /** The ID of the Recurring Credit Grant. */ + @SerializedName("recurring_credit_grant") + String recurringCreditGrant; + + /** The service cycle configuration. */ + @SerializedName("service_cycle") + ServiceCycle serviceCycle; + + /** + * The type of the recurring credit grant. + * + *

One of {@code credit_grant}, or {@code credit_grant_per_tenant}. + */ + @SerializedName("type") + String type; + + /** Credit grant details, present when type is CREDIT_GRANT. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CreditGrantDetails extends StripeObject { + /** The amount of the credit grant. */ + @SerializedName("amount") + com.stripe.model.v2.billing.PricingPlanSubscription.PricingPlanComponentDetail + .RecurringCreditGrantDetails.CreditGrantDetails.Amount + amount; + + /** Defines the scope where the credit grant is applicable. */ + @SerializedName("applicability_config") + ApplicabilityConfig applicabilityConfig; + + /** The expiry configuration for the credit grant. */ + @SerializedName("expiry_config") + ExpiryConfig expiryConfig; + + /** The amount of the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Amount extends StripeObject { + /** + * The custom pricing unit amount of the credit grant. Required if {@code type} is {@code + * custom_pricing_unit}. + */ + @SerializedName("custom_pricing_unit") + com.stripe.model.v2.billing.PricingPlanSubscription.PricingPlanComponentDetail + .RecurringCreditGrantDetails.CreditGrantDetails.Amount.CustomPricingUnit + customPricingUnit; + + /** + * The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. + */ + @SerializedName("monetary") + com.stripe.v2.Amount monetary; + + /** + * The type of the credit grant amount. We currently support {@code monetary} and {@code + * custom_pricing_unit} billing credits. + * + *

One of {@code custom_pricing_unit}, or {@code monetary}. + */ + @SerializedName("type") + String type; + + /** + * The custom pricing unit amount of the credit grant. Required if {@code type} is {@code + * custom_pricing_unit}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomPricingUnit extends StripeObject implements HasId { + /** The Custom Pricing Unit object. */ + @SerializedName("custom_pricing_unit_details") + com.stripe.model.v2.billing.CustomPricingUnit customPricingUnitDetails; + + /** The id of the custom pricing unit. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** The value of the credit grant, decimal value represented as a string. */ + @SerializedName("value") + BigDecimal value; + } + } + + /** Defines the scope where the credit grant is applicable. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ApplicabilityConfig extends StripeObject { + /** The applicability scope of the credit grant. */ + @SerializedName("scope") + Scope scope; + + /** The applicability scope of the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Scope extends StripeObject { + /** The billable items to apply the credit grant to. */ + @SerializedName("billable_items") + List billableItems; + + /** + * The price type that credit grants can apply to. We currently only support the {@code + * metered} price type. This will apply to metered prices and rate cards. Cannot be used + * in combination with {@code billable_items}. + * + *

Equal to {@code metered}. + */ + @SerializedName("price_type") + String priceType; + } + } + + /** The expiry configuration for the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ExpiryConfig extends StripeObject { + /** + * The type of the expiry configuration. We currently support {@code + * end_of_service_period}. + * + *

Equal to {@code end_of_service_period}. + */ + @SerializedName("type") + String type; + } + } + + /** Credit grant per tenant details, present when type is CREDIT_GRANT_PER_TENANT. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CreditGrantPerTenantDetails extends StripeObject { + /** The amount of the credit grant. */ + @SerializedName("amount") + com.stripe.model.v2.billing.PricingPlanSubscription.PricingPlanComponentDetail + .RecurringCreditGrantDetails.CreditGrantPerTenantDetails.Amount + amount; + + /** Defines the scope where the credit grant is applicable. */ + @SerializedName("applicability_config") + ApplicabilityConfig applicabilityConfig; + + /** The expiry configuration for the credit grant. */ + @SerializedName("expiry_config") + ExpiryConfig expiryConfig; + + /** The amount of the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Amount extends StripeObject { + /** + * The custom pricing unit amount of the credit grant. Required if {@code type} is {@code + * custom_pricing_unit}. + */ + @SerializedName("custom_pricing_unit") + com.stripe.model.v2.billing.PricingPlanSubscription.PricingPlanComponentDetail + .RecurringCreditGrantDetails.CreditGrantPerTenantDetails.Amount.CustomPricingUnit + customPricingUnit; + + /** + * The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. + */ + @SerializedName("monetary") + com.stripe.v2.Amount monetary; + + /** + * The type of the credit grant amount. We currently support {@code monetary} and {@code + * custom_pricing_unit} billing credits. + * + *

One of {@code custom_pricing_unit}, or {@code monetary}. + */ + @SerializedName("type") + String type; + + /** + * The custom pricing unit amount of the credit grant. Required if {@code type} is {@code + * custom_pricing_unit}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomPricingUnit extends StripeObject implements HasId { + /** The Custom Pricing Unit object. */ + @SerializedName("custom_pricing_unit_details") + com.stripe.model.v2.billing.CustomPricingUnit customPricingUnitDetails; + + /** The id of the custom pricing unit. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** The value of the credit grant, decimal value represented as a string. */ + @SerializedName("value") + BigDecimal value; + } + } + + /** Defines the scope where the credit grant is applicable. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ApplicabilityConfig extends StripeObject { + /** The applicability scope of the credit grant. */ + @SerializedName("scope") + Scope scope; + + /** The applicability scope of the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Scope extends StripeObject { + /** The billable items to apply the credit grant to. */ + @SerializedName("billable_items") + List billableItems; + + /** + * The price type that credit grants can apply to. We currently only support the {@code + * metered} price type. This will apply to metered prices and rate cards. Cannot be used + * in combination with {@code billable_items}. + * + *

Equal to {@code metered}. + */ + @SerializedName("price_type") + String priceType; + } + } + + /** The expiry configuration for the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ExpiryConfig extends StripeObject { + /** + * The type of the expiry configuration. We currently support {@code + * end_of_service_period}. + * + *

Equal to {@code end_of_service_period}. + */ + @SerializedName("type") + String type; + } + } + + /** The service cycle configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServiceCycle extends StripeObject { + /** + * The interval for assessing service. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The length of the interval for assessing service. For example, set this to 3 and {@code + * interval} to {@code "month"} in order to specify quarterly service. + */ + @SerializedName("interval_count") + Long intervalCount; + } + } + } + /** Timestamps for servicing status transitions. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscriptionComponents.java b/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscriptionComponents.java deleted file mode 100644 index 6f0971cfed2..00000000000 --- a/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscriptionComponents.java +++ /dev/null @@ -1,64 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.model.v2.billing; - -import com.google.gson.annotations.SerializedName; -import com.stripe.model.StripeObject; -import java.util.List; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; - -/** A set of component subscriptions for a Pricing Plan Subscription. */ -@Getter -@Setter -@EqualsAndHashCode(callSuper = false) -public class PricingPlanSubscriptionComponents extends StripeObject { - /** The component subscriptions of the Pricing Plan Subscription. */ - @SerializedName("components") - List components; - - /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. - */ - @SerializedName("livemode") - Boolean livemode; - - /** - * String representing the object's type. Objects of the same type share the same value of the - * object field. - * - *

Equal to {@code v2.billing.pricing_plan_subscription_components}. - */ - @SerializedName("object") - String object; - - /** - * For more details about Component, please refer to the API - * Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Component extends StripeObject { - /** The ID of the License Fee Subscription. */ - @SerializedName("license_fee_subscription") - String licenseFeeSubscription; - - /** The Pricing Plan Component associated with this component subscription. */ - @SerializedName("pricing_plan_component") - String pricingPlanComponent; - - /** The ID of the Rate Card Subscription. */ - @SerializedName("rate_card_subscription") - String rateCardSubscription; - - /** - * The type of subscription. - * - *

One of {@code license_fee_subscription}, or {@code rate_card_subscription}. - */ - @SerializedName("type") - String type; - } -} diff --git a/src/main/java/com/stripe/model/v2/billing/RateCard.java b/src/main/java/com/stripe/model/v2/billing/RateCard.java index 6ef77aedbaa..ff371550eea 100644 --- a/src/main/java/com/stripe/model/v2/billing/RateCard.java +++ b/src/main/java/com/stripe/model/v2/billing/RateCard.java @@ -47,10 +47,6 @@ public class RateCard extends StripeObject implements HasId { @SerializedName("id") String id; - /** The ID of this rate card's most recently created version. */ - @SerializedName("latest_version") - String latestVersion; - /** * The ID of the Rate Card Version that will be used by all subscriptions when no specific version * is specified. @@ -90,23 +86,14 @@ public class RateCard extends StripeObject implements HasId { String object; /** - * The interval for assessing service. For example, a monthly Rate Card with a rate of $1 for the - * first 10 "workloads" and $2 thereafter means "$1 per workload up to 10 workloads - * during a month of service." This is similar to but distinct from billing interval; the - * service interval deals with the rate at which the customer accumulates fees, while the billing - * interval in Cadence deals with the rate the customer is billed. - * - *

One of {@code day}, {@code month}, {@code week}, or {@code year}. - */ - @SerializedName("service_interval") - String serviceInterval; - - /** - * The length of the interval for assessing service. For example, set this to 3 and {@code - * service_interval} to {@code "month"} in order to specify quarterly service. + * The service cycle configuration for this Rate Card. For example, a monthly Rate Card with a + * rate of $1 for the first 10 "workloads" and $2 thereafter means "$1 per workload + * up to 10 workloads during a month of service." This is similar to but distinct from + * billing interval; the service interval deals with the rate at which the customer accumulates + * fees, while the billing interval in Cadence deals with the rate the customer is billed. */ - @SerializedName("service_interval_count") - Long serviceIntervalCount; + @SerializedName("service_cycle") + ServiceCycle serviceCycle; /** * The Stripe Tax tax behavior - whether the rates are inclusive or exclusive of tax. @@ -115,4 +102,31 @@ public class RateCard extends StripeObject implements HasId { */ @SerializedName("tax_behavior") String taxBehavior; + + /** + * The service cycle configuration for this Rate Card. For example, a monthly Rate Card with a + * rate of $1 for the first 10 "workloads" and $2 thereafter means "$1 per workload + * up to 10 workloads during a month of service." This is similar to but distinct from + * billing interval; the service interval deals with the rate at which the customer accumulates + * fees, while the billing interval in Cadence deals with the rate the customer is billed. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServiceCycle extends StripeObject { + /** + * The interval for assessing service. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The length of the interval for assessing service. For example, set this to 3 and {@code + * interval} to {@code "month"} in order to specify quarterly service. + */ + @SerializedName("interval_count") + Long intervalCount; + } } diff --git a/src/main/java/com/stripe/model/v2/billing/RateCardRate.java b/src/main/java/com/stripe/model/v2/billing/RateCardRate.java index 2ddea4f2c4d..66d8806c178 100644 --- a/src/main/java/com/stripe/model/v2/billing/RateCardRate.java +++ b/src/main/java/com/stripe/model/v2/billing/RateCardRate.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.math.BigDecimal; import java.time.Instant; @@ -168,6 +170,7 @@ public static class Tier extends StripeObject { public static class TransformQuantity extends StripeObject { /** Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** 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 00068aabead..1d78c1a1aec 100644 --- a/src/main/java/com/stripe/model/v2/core/Account.java +++ b/src/main/java/com/stripe/model/v2/core/Account.java @@ -4696,30 +4696,31 @@ public static class DefaultOutboundDestination extends StripeObject implements H * cr_bank_account}, {@code cy_bank_account}, {@code cz_bank_account}, {@code * de_bank_account}, {@code dk_bank_account}, {@code do_bank_account}, {@code * dz_bank_account}, {@code ec_bank_account}, {@code ee_bank_account}, {@code - * es_bank_account}, {@code et_bank_account}, {@code fi_bank_account}, {@code - * fr_bank_account}, {@code gb_bank_account}, {@code gm_bank_account}, {@code - * gr_bank_account}, {@code gt_bank_account}, {@code gy_bank_account}, {@code - * hk_bank_account}, {@code hr_bank_account}, {@code hu_bank_account}, {@code - * id_bank_account}, {@code ie_bank_account}, {@code il_bank_account}, {@code - * in_bank_account}, {@code is_bank_account}, {@code it_bank_account}, {@code - * jm_bank_account}, {@code jo_bank_account}, {@code ke_bank_account}, {@code - * kh_bank_account}, {@code kw_bank_account}, {@code lc_bank_account}, {@code - * li_bank_account}, {@code lk_bank_account}, {@code lt_bank_account}, {@code - * lu_bank_account}, {@code lv_bank_account}, {@code ma_bank_account}, {@code - * mc_bank_account}, {@code md_bank_account}, {@code mg_bank_account}, {@code - * mk_bank_account}, {@code mn_bank_account}, {@code mo_bank_account}, {@code - * mt_bank_account}, {@code mu_bank_account}, {@code mx_bank_account}, {@code - * my_bank_account}, {@code mz_bank_account}, {@code na_bank_account}, {@code - * nl_bank_account}, {@code no_bank_account}, {@code nz_bank_account}, {@code - * om_bank_account}, {@code pa_bank_account}, {@code pe_bank_account}, {@code - * ph_bank_account}, {@code pk_bank_account}, {@code pl_bank_account}, {@code - * pt_bank_account}, {@code qa_bank_account}, {@code ro_bank_account}, {@code - * rs_bank_account}, {@code rw_bank_account}, {@code se_bank_account}, {@code - * sg_bank_account}, {@code si_bank_account}, {@code sk_bank_account}, {@code - * sn_bank_account}, {@code sv_bank_account}, {@code th_bank_account}, {@code - * tn_bank_account}, {@code tr_bank_account}, {@code tt_bank_account}, {@code - * tw_bank_account}, {@code tz_bank_account}, {@code us_bank_account}, {@code - * uz_bank_account}, {@code vn_bank_account}, or {@code za_bank_account}. + * eg_bank_account}, {@code es_bank_account}, {@code et_bank_account}, {@code + * fi_bank_account}, {@code fr_bank_account}, {@code gb_bank_account}, {@code + * gm_bank_account}, {@code gr_bank_account}, {@code gt_bank_account}, {@code + * gy_bank_account}, {@code hk_bank_account}, {@code hr_bank_account}, {@code + * hu_bank_account}, {@code id_bank_account}, {@code ie_bank_account}, {@code + * il_bank_account}, {@code in_bank_account}, {@code is_bank_account}, {@code + * it_bank_account}, {@code jm_bank_account}, {@code jo_bank_account}, {@code + * ke_bank_account}, {@code kh_bank_account}, {@code kw_bank_account}, {@code + * lc_bank_account}, {@code li_bank_account}, {@code lk_bank_account}, {@code + * lt_bank_account}, {@code lu_bank_account}, {@code lv_bank_account}, {@code + * ma_bank_account}, {@code mc_bank_account}, {@code md_bank_account}, {@code + * mg_bank_account}, {@code mk_bank_account}, {@code mn_bank_account}, {@code + * mo_bank_account}, {@code mt_bank_account}, {@code mu_bank_account}, {@code + * mx_bank_account}, {@code my_bank_account}, {@code mz_bank_account}, {@code + * na_bank_account}, {@code nl_bank_account}, {@code no_bank_account}, {@code + * nz_bank_account}, {@code om_bank_account}, {@code pa_bank_account}, {@code + * pe_bank_account}, {@code ph_bank_account}, {@code pk_bank_account}, {@code + * pl_bank_account}, {@code pt_bank_account}, {@code qa_bank_account}, {@code + * ro_bank_account}, {@code rs_bank_account}, {@code rw_bank_account}, {@code + * se_bank_account}, {@code sg_bank_account}, {@code si_bank_account}, {@code + * sk_bank_account}, {@code sn_bank_account}, {@code sv_bank_account}, {@code + * th_bank_account}, {@code tn_bank_account}, {@code tr_bank_account}, {@code + * tt_bank_account}, {@code tw_bank_account}, {@code tz_bank_account}, {@code + * us_bank_account}, {@code uz_bank_account}, {@code vn_bank_account}, or {@code + * za_bank_account}. */ @SerializedName("type") String type; @@ -5845,6 +5846,13 @@ public static class Defaults extends StripeObject { @SerializedName("responsibilities") Responsibilities responsibilities; + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + @SerializedName("timezone") + String timezone; + /** Account profile information. */ @Getter @Setter @@ -6085,7 +6093,7 @@ public static class RestrictsCapability extends StripeObject { * {@code commercial.lead.prepaid_card}, {@code commercial.stripe.charge_card}, {@code * commercial.stripe.prepaid_card}, {@code consumer.celtic.revolving_credit_card}, {@code * consumer.cross_river_bank.prepaid_card}, {@code consumer.holds_currencies.usd}, {@code - * consumer.lead.prepaid_card}, {@code crypto}, {@code eps_payments}, {@code + * consumer.lead.prepaid_card}, {@code crypto_wallets}, {@code eps_payments}, {@code * financial_addresses.bank_accounts}, {@code fpx_payments}, {@code * gb_bank_transfer_payments}, {@code grabpay_payments}, {@code holds_currencies.eur}, * {@code holds_currencies.gbp}, {@code holds_currencies.usd}, {@code ideal_payments}, @@ -9771,7 +9779,7 @@ public static class RestrictsCapability extends StripeObject { * {@code commercial.lead.prepaid_card}, {@code commercial.stripe.charge_card}, {@code * commercial.stripe.prepaid_card}, {@code consumer.celtic.revolving_credit_card}, {@code * consumer.cross_river_bank.prepaid_card}, {@code consumer.holds_currencies.usd}, {@code - * consumer.lead.prepaid_card}, {@code crypto}, {@code eps_payments}, {@code + * consumer.lead.prepaid_card}, {@code crypto_wallets}, {@code eps_payments}, {@code * financial_addresses.bank_accounts}, {@code fpx_payments}, {@code * gb_bank_transfer_payments}, {@code grabpay_payments}, {@code holds_currencies.eur}, * {@code holds_currencies.gbp}, {@code holds_currencies.usd}, {@code ideal_payments}, diff --git a/src/main/java/com/stripe/model/v2/core/AccountEvaluation.java b/src/main/java/com/stripe/model/v2/core/AccountEvaluation.java new file mode 100644 index 00000000000..820c5162674 --- /dev/null +++ b/src/main/java/com/stripe/model/v2/core/AccountEvaluation.java @@ -0,0 +1,116 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.core; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import java.time.Instant; +import java.util.List; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** Account Evaluation resource. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class AccountEvaluation extends StripeObject implements HasId { + /** The account ID if this evaluation is for an existing account. */ + @SerializedName("account") + String account; + + /** Account data if this evaluation is for an account without an existing Stripe entity. */ + @SerializedName("account_data") + AccountData accountData; + + /** Timestamp at which the evaluation was created. */ + @SerializedName("created") + Instant created; + + /** List of signals that were triggered for evaluation. */ + @SerializedName("evaluations_triggered") + List evaluationsTriggered; + + /** Unique identifier for the account evaluation. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + 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. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * String representing the object's type. Objects of the same type share the same value of the + * object field. + * + *

Equal to {@code v2.core.account_evaluation}. + */ + @SerializedName("object") + String object; + + /** Account data if this evaluation is for an account without an existing Stripe entity. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AccountData extends StripeObject { + /** Default account settings. */ + @SerializedName("defaults") + Defaults defaults; + + /** Identity data. */ + @SerializedName("identity") + Identity identity; + + /** Default account settings. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Defaults extends StripeObject { + /** Account profile data. */ + @SerializedName("profile") + Profile profile; + + /** Account profile data. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Profile extends StripeObject { + /** The business URL. */ + @SerializedName("business_url") + String businessUrl; + + /** Doing business as (DBA) name. */ + @SerializedName("doing_business_as") + String doingBusinessAs; + + /** Description of the account's product or service. */ + @SerializedName("product_description") + String productDescription; + } + } + + /** Identity data. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Identity extends StripeObject { + /** Business details for identity data. */ + @SerializedName("business_details") + BusinessDetails businessDetails; + + /** Business details for identity data. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BusinessDetails extends StripeObject { + /** Registered business name. */ + @SerializedName("registered_name") + String registeredName; + } + } + } +} diff --git a/src/main/java/com/stripe/model/v2/core/BatchJob.java b/src/main/java/com/stripe/model/v2/core/BatchJob.java new file mode 100644 index 00000000000..9bc1c8bf3e6 --- /dev/null +++ b/src/main/java/com/stripe/model/v2/core/BatchJob.java @@ -0,0 +1,408 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.core; + +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; +import com.stripe.model.StripeObject; +import java.time.Instant; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** BatchJob resource. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class BatchJob extends StripeObject implements HasId { + /** Timestamp at which BatchJob was created. */ + @SerializedName("created") + Instant created; + + /** Unique identifier for the BatchJob. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + 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. + */ + @SerializedName("livemode") + Boolean livemode; + + /** The maximum rps defined for the {@code BatchJob}. */ + @SerializedName("maximum_rps") + Long maximumRps; + + /** The metadata of the {@code BatchJob} object. */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value of the + * object field. + * + *

Equal to {@code v2.core.batch_job}. + */ + @SerializedName("object") + String object; + + /** If the validation will be run previous to the execution of the {@code BatchJob}. */ + @SerializedName("skip_validation") + Boolean skipValidation; + + /** + * The current status of the {@code BatchJob}. + * + *

One of {@code batch_failed}, {@code canceled}, {@code cancelling}, {@code complete}, {@code + * in_progress}, {@code ready_for_upload}, {@code timeout}, {@code upload_timeout}, {@code + * validating}, or {@code validation_failed}. + */ + @SerializedName("status") + String status; + + /** Additional details about the current state of the {@code BatchJob}. */ + @SerializedName("status_details") + StatusDetails statusDetails; + + /** Additional details about the current state of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StatusDetails extends StripeObject { + /** Additional details for the {@code BATCH_FAILED} status of the {@code BatchJob}. */ + @SerializedName("batch_failed") + BatchFailed batchFailed; + + /** Additional details for the {@code CANCELED} status of the {@code BatchJob}. */ + @SerializedName("canceled") + Canceled canceled; + + /** Additional details for the {@code COMPLETE} status of the {@code BatchJob}. */ + @SerializedName("complete") + Complete complete; + + /** Additional details for the {@code IN_PROGRESS} status of the {@code BatchJob}. */ + @SerializedName("in_progress") + InProgress inProgress; + + /** Additional details for the {@code READY_FOR_UPLOAD} status of the {@code BatchJob}. */ + @SerializedName("ready_for_upload") + ReadyForUpload readyForUpload; + + /** Additional details for the {@code TIMEOUT} status of the {@code BatchJob}. */ + @SerializedName("timeout") + Timeout timeout; + + /** Additional details for the {@code VALIDATING} status of the {@code BatchJob}. */ + @SerializedName("validating") + Validating validating; + + /** Additional details for the {@code VALIDATION_FAILED} status of the {@code BatchJob}. */ + @SerializedName("validation_failed") + ValidationFailed validationFailed; + + /** Additional details for the {@code BATCH_FAILED} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BatchFailed extends StripeObject { + /** Details about the {@code BatchJob} failure. */ + @SerializedName("error") + String error; + } + + /** Additional details for the {@code CANCELED} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Canceled extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + + /** Additional details for the {@code COMPLETE} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Complete extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + + /** Additional details for the {@code IN_PROGRESS} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InProgress extends StripeObject { + /** The number of records that failed processing so far. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** The number of records that were successfully processed so far. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + } + + /** Additional details for the {@code READY_FOR_UPLOAD} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ReadyForUpload extends StripeObject { + /** The upload file details. */ + @SerializedName("upload_url") + UploadUrl uploadUrl; + + /** The upload file details. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UploadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + + /** Additional details for the {@code TIMEOUT} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Timeout extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + + /** Additional details for the {@code VALIDATING} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Validating extends StripeObject { + /** + * The number of records that were validated. Note that there is no failure counter here; once + * we have any validation failures we give up. + */ + @SerializedName("validated_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long validatedCount; + } + + /** Additional details for the {@code VALIDATION_FAILED} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ValidationFailed extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + } +} 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..cc45e0ae021 100644 --- a/src/main/java/com/stripe/model/v2/core/EventDestination.java +++ b/src/main/java/com/stripe/model/v2/core/EventDestination.java @@ -26,6 +26,10 @@ public class EventDestination extends StripeObject implements HasId { @SerializedName("amazon_eventbridge") AmazonEventbridge amazonEventbridge; + /** Azure Event Grid configuration. */ + @SerializedName("azure_event_grid") + AzureEventGrid azureEventGrid; + /** Time at which the object was created. */ @SerializedName("created") Instant created; @@ -46,7 +50,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; @@ -98,7 +109,7 @@ public class EventDestination extends StripeObject implements HasId { /** * Event destination type. * - *

One of {@code amazon_eventbridge}, or {@code webhook_endpoint}. + *

One of {@code amazon_eventbridge}, {@code azure_event_grid}, or {@code webhook_endpoint}. */ @SerializedName("type") String type; @@ -133,6 +144,36 @@ public static class AmazonEventbridge extends StripeObject { String awsEventSourceStatus; } + /** Azure Event Grid configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AzureEventGrid extends StripeObject { + /** The name of the Azure partner topic. */ + @SerializedName("azure_partner_topic_name") + String azurePartnerTopicName; + + /** + * The status of the Azure partner topic. + * + *

One of {@code activated}, {@code deleted}, {@code never_activated}, or {@code unknown}. + */ + @SerializedName("azure_partner_topic_status") + String azurePartnerTopicStatus; + + /** The Azure region. */ + @SerializedName("azure_region") + String azureRegion; + + /** The name of the Azure resource group. */ + @SerializedName("azure_resource_group_name") + String azureResourceGroupName; + + /** The Azure subscription ID. */ + @SerializedName("azure_subscription_id") + String azureSubscriptionId; + } + /** Additional information about event destination status. */ @Getter @Setter @@ -150,7 +191,8 @@ public static class Disabled extends StripeObject { /** * Reason event destination has been disabled. * - *

One of {@code no_aws_event_source_exists}, or {@code user}. + *

One of {@code no_aws_event_source_exists}, {@code no_azure_partner_topic_exists}, or + * {@code user}. */ @SerializedName("reason") String reason; diff --git a/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java b/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java index d1ea223c682..f43af389910 100644 --- a/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java +++ b/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java @@ -5,6 +5,7 @@ import com.stripe.model.HasId; import com.stripe.model.StripeObject; import java.time.Instant; +import java.util.List; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -80,6 +81,10 @@ public class GbBankAccount extends StripeObject implements HasId { @SerializedName("sort_code") String sortCode; + /** The list of currencies supported by this bank account. */ + @SerializedName("supported_currencies") + List supportedCurrencies; + /** The alternative reference for this payout method, if it's a projected payout method. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java b/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java index a4b359adc37..37a3ed55f33 100644 --- a/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java +++ b/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java @@ -5,6 +5,7 @@ import com.stripe.model.HasId; import com.stripe.model.StripeObject; import java.time.Instant; +import java.util.List; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -81,6 +82,10 @@ public class UsBankAccount extends StripeObject implements HasId { @SerializedName("routing_number") String routingNumber; + /** The list of currencies supported by this bank account. */ + @SerializedName("supported_currencies") + List supportedCurrencies; + /** The bank account verification details. */ @SerializedName("verification") Verification verification; diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java b/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java index a723675d246..aac74ce830f 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java @@ -109,6 +109,7 @@ public class FinancialAccount extends StripeObject implements HasId { @SerializedName("status") String status; + /** Additional details related to the status of the FinancialAccount. */ @SerializedName("status_details") StatusDetails statusDetails; @@ -214,6 +215,14 @@ public static class Other extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Payments extends StripeObject { + /** + * The balance of the {@code payments} FinancialAccount is a mix of payment processing and + * stored value funds, and this field describes the breakdown between the two. The sum will + * match the balance of the FinancialAccount. + */ + @SerializedName("balance_by_funds_type") + BalanceByFundsType balanceByFundsType; + /** The currency that non-settlement currency payments will be converted to. */ @SerializedName("default_currency") String defaultCurrency; @@ -229,6 +238,66 @@ public static class Payments extends StripeObject { @SerializedName("starting_balance") StartingBalance startingBalance; + /** + * The balance of the {@code payments} FinancialAccount is a mix of payment processing and + * stored value funds, and this field describes the breakdown between the two. The sum will + * match the balance of the FinancialAccount. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BalanceByFundsType extends StripeObject { + /** + * Payment processing funds are those that are received for goods or services and may only be + * used for payouts to self. These funds may be converted to stored value funds. + */ + @SerializedName("payment_processing") + PaymentProcessing paymentProcessing; + + /** Stored value funds may be used for either payouts to self or payments to others. */ + @SerializedName("stored_value") + StoredValue storedValue; + + /** + * Payment processing funds are those that are received for goods or services and may only be + * used for payouts to self. These funds may be converted to stored value funds. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentProcessing extends StripeObject { + /** Balance that can be used for money movement. */ + @SerializedName("available") + Map available; + + /** Balance of inbound funds that will later transition to the {@code available} balance. */ + @SerializedName("inbound_pending") + Map inboundPending; + + /** Balance of funds that are being used for a pending outbound money movement. */ + @SerializedName("outbound_pending") + Map outboundPending; + } + + /** Stored value funds may be used for either payouts to self or payments to others. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StoredValue extends StripeObject { + /** Balance that can be used for money movement. */ + @SerializedName("available") + Map available; + + /** Balance of inbound funds that will later transition to the {@code available} balance. */ + @SerializedName("inbound_pending") + Map inboundPending; + + /** Balance of funds that are being used for a pending outbound money movement. */ + @SerializedName("outbound_pending") + Map outboundPending; + } + } + /** Describes the available balance when it was projected. */ @Getter @Setter @@ -244,35 +313,33 @@ public static class StartingBalance extends StripeObject { } } - /** - * For more details about StatusDetails, please refer to the API Reference. - */ + /** Additional details related to the status of the FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class StatusDetails extends StripeObject { + /** Details related to the closed state of the FinancialAccount. */ @SerializedName("closed") Closed closed; - /** - * For more details about Closed, please refer to the API - * Reference. - */ + /** Details related to the closed state of the FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class Closed extends StripeObject { + /** The forwarding settings for the closed FinancialAccount. */ @SerializedName("forwarding_settings") ForwardingSettings forwardingSettings; + /** + * The reason the FinancialAccount was closed. + * + *

One of {@code account_closed}, {@code closed_by_platform}, or {@code other}. + */ @SerializedName("reason") String reason; - /** - * For more details about ForwardingSettings, please refer to the API Reference. - */ + /** The forwarding settings for the closed FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java index e90feb2965e..6b1696d10d9 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java @@ -110,8 +110,8 @@ public static class EstimatedFee extends StripeObject { * The fee type. * *

One of {@code cross_border_payout_fee}, {@code foreign_exchange_fee}, {@code - * instant_payout_fee}, {@code real_time_payout_fee}, {@code standard_payout_fee}, or {@code - * wire_payout_fee}. + * instant_payout_fee}, {@code next_day_payout_fee}, {@code real_time_payout_fee}, {@code + * standard_payout_fee}, or {@code wire_payout_fee}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java index 9bbff7ab62e..2187df5a752 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java @@ -64,6 +64,13 @@ public class PayoutMethod extends StripeObject implements HasId { @SerializedName("object") String object; + /** + * Whether the Payout Method is currently unusable for money movement, despite potentially being + * correctly set up. Please reach out to Stripe Support for more information. + */ + @SerializedName("restricted") + Boolean restricted; + /** * Closed Enum. The type of payout method. * @@ -192,6 +199,10 @@ public static class Card extends StripeObject { /** The last 4 digits of the card number. */ @SerializedName("last4") String last4; + + /** The list of currencies supported by this bank account. */ + @SerializedName("supported_currencies") + List supportedCurrencies; } /** The PayoutMethodCryptoWallet object details. */ diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java index 23b774f7353..70c296bc556 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java @@ -54,6 +54,13 @@ public static class Country extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Field extends StripeObject { + /** + * The currencies supported by the corresponding credentials for bank accounts in the + * specified country. + */ + @SerializedName("currencies") + List currencies; + /** The local name of the field. */ @SerializedName("local_name") String localName; diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java b/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java index f5eeaadb119..5521bfcbbe2 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java @@ -57,6 +57,10 @@ public class Transaction extends StripeObject implements HasId { @SerializedName("category") String category; + /** Counterparty to this Transaction. */ + @SerializedName("counterparty") + Counterparty counterparty; + /** * Time at which the object was created. Represented as a RFC 3339 date & time UTC value in * millisecond precision, for example: 2022-09-18T13:22:18.123Z. @@ -64,6 +68,13 @@ public class Transaction extends StripeObject implements HasId { @SerializedName("created") Instant created; + /** + * Description of this Transaction. When applicable, the description is copied from the Flow + * object at the time of transaction creation. + */ + @SerializedName("description") + String description; + /** Indicates the FinancialAccount affected by this Transaction. */ @SerializedName("financial_account") String financialAccount; @@ -109,6 +120,10 @@ public class Transaction extends StripeObject implements HasId { @SerializedName("status_transitions") StatusTransitions statusTransitions; + /** The v1 Treasury transaction associated with this transaction. */ + @SerializedName("treasury_transaction") + String treasuryTransaction; + /** * The delta to the FinancialAccount's balance. The balance_impact for the Transaction is equal to * sum of its TransactionEntries that have {@code effective_at}s in the past. @@ -130,6 +145,16 @@ public static class BalanceImpact extends StripeObject { Amount outboundPending; } + /** Counterparty to this Transaction. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Counterparty extends StripeObject { + /** Name of the counterparty. */ + @SerializedName("name") + String name; + } + /** Details about the Flow object that created the Transaction. */ @Getter @Setter @@ -214,6 +239,38 @@ public static class Flow extends StripeObject { @SerializedName("transfer_reversal") String transferReversal; + /** If applicable, the ID of the Treasury CreditReversal that created this Transaction. */ + @SerializedName("treasury_credit_reversal") + String treasuryCreditReversal; + + /** If applicable, the ID of the Treasury DebitReversal that created this Transaction. */ + @SerializedName("treasury_debit_reversal") + String treasuryDebitReversal; + + /** If applicable, the ID of the Treasury InboundTransfer that created this Transaction. */ + @SerializedName("treasury_inbound_transfer") + String treasuryInboundTransfer; + + /** If applicable, the ID of the Treasury IssuingAuthorization that created this Transaction. */ + @SerializedName("treasury_issuing_authorization") + String treasuryIssuingAuthorization; + + /** If applicable, the ID of the Treasury OutboundPayment that created this Transaction. */ + @SerializedName("treasury_outbound_payment") + String treasuryOutboundPayment; + + /** If applicable, the ID of the Treasury OutboundTransfer that created this Transaction. */ + @SerializedName("treasury_outbound_transfer") + String treasuryOutboundTransfer; + + /** If applicable, the ID of the Treasury ReceivedCredit that created this Transaction. */ + @SerializedName("treasury_received_credit") + String treasuryReceivedCredit; + + /** If applicable, the ID of the Treasury ReceivedDebit that created this Transaction. */ + @SerializedName("treasury_received_debit") + String treasuryReceivedDebit; + /** * Open Enum. Type of the flow that created the Transaction. The field matching this value will * contain the ID of the flow. @@ -222,7 +279,11 @@ public static class Flow extends StripeObject { * charge}, {@code currency_conversion}, {@code dispute}, {@code fee_transaction}, {@code * inbound_transfer}, {@code outbound_payment}, {@code outbound_transfer}, {@code payout}, * {@code received_credit}, {@code received_debit}, {@code refund}, {@code reserve_hold}, {@code - * reserve_release}, {@code topup}, {@code transfer}, or {@code transfer_reversal}. + * reserve_release}, {@code topup}, {@code transfer}, {@code transfer_reversal}, {@code + * treasury_credit_reversal}, {@code treasury_debit_reversal}, {@code + * treasury_inbound_transfer}, {@code treasury_issuing_authorization}, {@code treasury_other}, + * {@code treasury_outbound_payment}, {@code treasury_outbound_transfer}, {@code + * treasury_received_credit}, or {@code treasury_received_debit}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java b/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java index 976e1c09cae..03f6c1275cc 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java @@ -62,6 +62,10 @@ public class TransactionEntry extends StripeObject implements HasId { @SerializedName("transaction_details") TransactionDetails transactionDetails; + /** The v1 Treasury transaction entry associated with this transaction entry. */ + @SerializedName("treasury_transaction_entry") + String treasuryTransactionEntry; + /** The delta to the FinancialAccount's balance. */ @Getter @Setter @@ -203,6 +207,40 @@ public static class Flow extends StripeObject { @SerializedName("transfer_reversal") String transferReversal; + /** If applicable, the ID of the Treasury CreditReversal that created this Transaction. */ + @SerializedName("treasury_credit_reversal") + String treasuryCreditReversal; + + /** If applicable, the ID of the Treasury DebitReversal that created this Transaction. */ + @SerializedName("treasury_debit_reversal") + String treasuryDebitReversal; + + /** If applicable, the ID of the Treasury InboundTransfer that created this Transaction. */ + @SerializedName("treasury_inbound_transfer") + String treasuryInboundTransfer; + + /** + * If applicable, the ID of the Treasury IssuingAuthorization that created this Transaction. + */ + @SerializedName("treasury_issuing_authorization") + String treasuryIssuingAuthorization; + + /** If applicable, the ID of the Treasury OutboundPayment that created this Transaction. */ + @SerializedName("treasury_outbound_payment") + String treasuryOutboundPayment; + + /** If applicable, the ID of the Treasury OutboundTransfer that created this Transaction. */ + @SerializedName("treasury_outbound_transfer") + String treasuryOutboundTransfer; + + /** If applicable, the ID of the Treasury ReceivedCredit that created this Transaction. */ + @SerializedName("treasury_received_credit") + String treasuryReceivedCredit; + + /** If applicable, the ID of the Treasury ReceivedDebit that created this Transaction. */ + @SerializedName("treasury_received_debit") + String treasuryReceivedDebit; + /** * Open Enum. Type of the flow that created the Transaction. The field matching this value * will contain the ID of the flow. @@ -211,8 +249,11 @@ public static class Flow extends StripeObject { * {@code charge}, {@code currency_conversion}, {@code dispute}, {@code fee_transaction}, * {@code inbound_transfer}, {@code outbound_payment}, {@code outbound_transfer}, {@code * payout}, {@code received_credit}, {@code received_debit}, {@code refund}, {@code - * reserve_hold}, {@code reserve_release}, {@code topup}, {@code transfer}, or {@code - * transfer_reversal}. + * reserve_hold}, {@code reserve_release}, {@code topup}, {@code transfer}, {@code + * transfer_reversal}, {@code treasury_credit_reversal}, {@code treasury_debit_reversal}, + * {@code treasury_inbound_transfer}, {@code treasury_issuing_authorization}, {@code + * treasury_other}, {@code treasury_outbound_payment}, {@code treasury_outbound_transfer}, + * {@code treasury_received_credit}, or {@code treasury_received_debit}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java b/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java index da3766cedc3..1966e8230f0 100644 --- a/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java +++ b/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java @@ -63,8 +63,8 @@ public class OffSessionPayment extends StripeObject implements HasId { /** * The reason why the OffSessionPayment failed. * - *

One of {@code authorization_expired}, {@code rejected_by_partner}, or {@code - * retries_exhausted}. + *

One of {@code authorization_expired}, {@code no_valid_payment_method}, {@code + * rejected_by_partner}, or {@code retries_exhausted}. */ @SerializedName("failure_reason") String failureReason; diff --git a/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntentSplit.java b/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntentSplit.java index 06677de52b7..27ce0b6623b 100644 --- a/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntentSplit.java +++ b/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntentSplit.java @@ -6,6 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.v2.Amount; import java.time.Instant; +import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -43,6 +44,10 @@ public class SettlementAllocationIntentSplit extends StripeObject implements Has @SerializedName("livemode") Boolean livemode; + /** Metadata associated with the SettlementAllocationIntentSplit. */ + @SerializedName("metadata") + Map metadata; + /** * String representing the object's type. Objects of the same type share the same value of the * object field. @@ -52,7 +57,7 @@ public class SettlementAllocationIntentSplit extends StripeObject implements Has @SerializedName("object") String object; - /** The ID of the SettlementAllocationIntent that this split belongs too. */ + /** The ID of the SettlementAllocationIntent that this split belongs to. */ @SerializedName("settlement_allocation_intent") String settlementAllocationIntent; diff --git a/src/main/java/com/stripe/model/v2/reporting/ReportRun.java b/src/main/java/com/stripe/model/v2/reporting/ReportRun.java index cd086c1cce2..659323dcc14 100644 --- a/src/main/java/com/stripe/model/v2/reporting/ReportRun.java +++ b/src/main/java/com/stripe/model/v2/reporting/ReportRun.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.reporting; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.time.Instant; import java.util.Map; @@ -122,6 +124,7 @@ public static class File extends StripeObject { /** The total size of the file in bytes. */ @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) Long size; /** A pre-signed URL that allows secure, time-limited access to download the file. */ diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java index a4ae606600f..6eab345b23f 100644 --- a/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java @@ -1,7 +1,9 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; import java.util.HashMap; @@ -1016,6 +1018,7 @@ public Builder setRequestThreeDSecure( public static class MandateOptions { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java index b4eb433b47e..95fb6832134 100644 --- a/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java @@ -1,7 +1,9 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; @@ -1088,6 +1090,7 @@ public Builder setRequestThreeDSecure( public static class MandateOptions { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/param/v2/billing/IntentCreateParams.java b/src/main/java/com/stripe/param/v2/billing/IntentCreateParams.java index 0f70947dd4e..e766ad0b7ba 100644 --- a/src/main/java/com/stripe/param/v2/billing/IntentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/IntentCreateParams.java @@ -43,17 +43,23 @@ public class IntentCreateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Select additional fields to include in the response. */ + @SerializedName("include") + List include; + private IntentCreateParams( List actions, String cadence, CadenceData cadenceData, String currency, - Map extraParams) { + Map extraParams, + List include) { this.actions = actions; this.cadence = cadence; this.cadenceData = cadenceData; this.currency = currency; this.extraParams = extraParams; + this.include = include; } public static Builder builder() { @@ -71,10 +77,17 @@ public static class Builder { private Map extraParams; + private List include; + /** Finalize and obtain parameter instance from this builder. */ public IntentCreateParams build() { return new IntentCreateParams( - this.actions, this.cadence, this.cadenceData, this.currency, this.extraParams); + this.actions, + this.cadence, + this.cadenceData, + this.currency, + this.extraParams, + this.include); } /** @@ -149,6 +162,32 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * IntentCreateParams#include} for the field documentation. + */ + public Builder addInclude(IntentCreateParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * IntentCreateParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } } @Getter @@ -301,7 +340,11 @@ public Builder setType(IntentCreateParams.Action.Type type) { @Getter @EqualsAndHashCode(callSuper = false) public static class Apply { - /** When the apply action will take effect. Defaults to on_reserve if not specified. */ + /** Details for applying a discount. */ + @SerializedName("discount") + Discount discount; + + /** When the apply action will take effect. If not specified, defaults to on_reserve. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -329,11 +372,13 @@ public static class Apply { Type type; private Apply( + Discount discount, EffectiveAt effectiveAt, Map extraParams, InvoiceDiscountRule invoiceDiscountRule, SpendModifierRule spendModifierRule, Type type) { + this.discount = discount; this.effectiveAt = effectiveAt; this.extraParams = extraParams; this.invoiceDiscountRule = invoiceDiscountRule; @@ -346,6 +391,8 @@ public static Builder builder() { } public static class Builder { + private Discount discount; + private EffectiveAt effectiveAt; private Map extraParams; @@ -359,6 +406,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public IntentCreateParams.Action.Apply build() { return new IntentCreateParams.Action.Apply( + this.discount, this.effectiveAt, this.extraParams, this.invoiceDiscountRule, @@ -366,7 +414,13 @@ public IntentCreateParams.Action.Apply build() { this.type); } - /** When the apply action will take effect. Defaults to on_reserve if not specified. */ + /** Details for applying a discount. */ + public Builder setDiscount(IntentCreateParams.Action.Apply.Discount discount) { + this.discount = discount; + return this; + } + + /** When the apply action will take effect. If not specified, defaults to on_reserve. */ public Builder setEffectiveAt(IntentCreateParams.Action.Apply.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; return this; @@ -421,6 +475,121 @@ public Builder setType(IntentCreateParams.Action.Apply.Type type) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Discount { + /** The ID of the Coupon to apply. */ + @SerializedName("coupon") + String coupon; + + /** + * 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 ID of the PromotionCode to apply. */ + @SerializedName("promotion_code") + String promotionCode; + + /** Required. Type of the discount. */ + @SerializedName("type") + Type type; + + private Discount( + String coupon, Map extraParams, String promotionCode, Type type) { + this.coupon = coupon; + this.extraParams = extraParams; + this.promotionCode = promotionCode; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String coupon; + + private Map extraParams; + + private String promotionCode; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public IntentCreateParams.Action.Apply.Discount build() { + return new IntentCreateParams.Action.Apply.Discount( + this.coupon, this.extraParams, this.promotionCode, this.type); + } + + /** The ID of the Coupon to apply. */ + public Builder setCoupon(String coupon) { + this.coupon = coupon; + 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 IntentCreateParams.Action.Apply.Discount#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 IntentCreateParams.Action.Apply.Discount#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 ID of the PromotionCode to apply. */ + public Builder setPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** Required. Type of the discount. */ + public Builder setType(IntentCreateParams.Action.Apply.Discount.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("coupon") + COUPON("coupon"), + + @SerializedName("promotion_code") + PROMOTION_CODE("promotion_code"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class EffectiveAt { @@ -434,12 +603,20 @@ public static class EffectiveAt { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The timestamp at which the apply action will take effect. Only present if type is + * timestamp. Only allowed for discount actions. + */ + @SerializedName("timestamp") + Instant timestamp; + /** Required. When the apply action will take effect. */ @SerializedName("type") Type type; - private EffectiveAt(Map extraParams, Type type) { + private EffectiveAt(Map extraParams, Instant timestamp, Type type) { this.extraParams = extraParams; + this.timestamp = timestamp; this.type = type; } @@ -450,11 +627,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Instant timestamp; + private Type type; /** Finalize and obtain parameter instance from this builder. */ public IntentCreateParams.Action.Apply.EffectiveAt build() { - return new IntentCreateParams.Action.Apply.EffectiveAt(this.extraParams, this.type); + return new IntentCreateParams.Action.Apply.EffectiveAt( + this.extraParams, this.timestamp, this.type); } /** @@ -485,6 +665,15 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The timestamp at which the apply action will take effect. Only present if type is + * timestamp. Only allowed for discount actions. + */ + public Builder setTimestamp(Instant timestamp) { + this.timestamp = timestamp; + return this; + } + /** Required. When the apply action will take effect. */ public Builder setType(IntentCreateParams.Action.Apply.EffectiveAt.Type type) { this.type = type; @@ -496,11 +685,17 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("current_billing_period_end") CURRENT_BILLING_PERIOD_END("current_billing_period_end"), + @SerializedName("current_billing_period_start") + CURRENT_BILLING_PERIOD_START("current_billing_period_start"), + @SerializedName("next_billing_period_start") NEXT_BILLING_PERIOD_START("next_billing_period_start"), @SerializedName("on_reserve") - ON_RESERVE("on_reserve"); + ON_RESERVE("on_reserve"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); @Getter(onMethod_ = {@Override}) private final String value; @@ -962,8 +1157,8 @@ public static class MaxBillingPeriodSpend { Amount amount; /** - * Required. The configration for the overage rate for the custom pricing - * unit. + * Required. The configuration for the overage rate for the custom + * pricing unit. */ @SerializedName("custom_pricing_unit_overage_rate") CustomPricingUnitOverageRate customPricingUnitOverageRate; @@ -1013,7 +1208,7 @@ public Builder setAmount( } /** - * Required. The configration for the overage rate for the custom + * Required. The configuration for the overage rate for the custom * pricing unit. */ public Builder setCustomPricingUnitOverageRate( @@ -1344,6 +1539,9 @@ public enum Type implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("discount") + DISCOUNT("discount"), + @SerializedName("invoice_discount_rule") INVOICE_DISCOUNT_RULE("invoice_discount_rule"), @@ -2175,7 +2373,10 @@ public enum CreditProrationBehavior implements ApiRequestParams.EnumParam { public enum Type implements ApiRequestParams.EnumParam { @SerializedName("license_fee") - LICENSE_FEE("license_fee"); + LICENSE_FEE("license_fee"), + + @SerializedName("recurring_credit_grant") + RECURRING_CREDIT_GRANT("recurring_credit_grant"); @Getter(onMethod_ = {@Override}) private final String value; @@ -3115,7 +3316,10 @@ public enum DebitProrationBehavior implements ApiRequestParams.EnumParam { public enum Type implements ApiRequestParams.EnumParam { @SerializedName("license_fee") - LICENSE_FEE("license_fee"); + LICENSE_FEE("license_fee"), + + @SerializedName("recurring_credit_grant") + RECURRING_CREDIT_GRANT("recurring_credit_grant"); @Getter(onMethod_ = {@Override}) private final String value; @@ -3162,7 +3366,7 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Remove { - /** When the remove action will take effect. Defaults to on_reserve if not specified. */ + /** When the remove action will take effect. If not specified, defaults to on_reserve. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -3225,7 +3429,7 @@ public IntentCreateParams.Action.Remove build() { this.type); } - /** When the remove action will take effect. Defaults to on_reserve if not specified. */ + /** When the remove action will take effect. If not specified, defaults to on_reserve. */ public Builder setEffectiveAt(IntentCreateParams.Action.Remove.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; return this; @@ -4277,7 +4481,10 @@ public enum DebitProrationBehavior implements ApiRequestParams.EnumParam { public enum Type implements ApiRequestParams.EnumParam { @SerializedName("license_fee") - LICENSE_FEE("license_fee"); + LICENSE_FEE("license_fee"), + + @SerializedName("recurring_credit_grant") + RECURRING_CREDIT_GRANT("recurring_credit_grant"); @Getter(onMethod_ = {@Override}) private final String value; @@ -4476,7 +4683,7 @@ public static class Item { @SerializedName("price") String price; - /** Quantity for this item. If not provided, will default to 1. */ + /** Quantity for this item. If not provided, defaults to 1. */ @SerializedName("quantity") Long quantity; @@ -4576,7 +4783,7 @@ public Builder setPrice(String price) { return this; } - /** Quantity for this item. If not provided, will default to 1. */ + /** Quantity for this item. If not provided, defaults to 1. */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; @@ -6295,4 +6502,16 @@ public Builder setVersion(String version) { } } } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("invoice_resources.preview_invoice") + INVOICE_RESOURCES__PREVIEW_INVOICE("invoice_resources.preview_invoice"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } } diff --git a/src/main/java/com/stripe/param/v2/billing/IntentReserveParams.java b/src/main/java/com/stripe/param/v2/billing/IntentReserveParams.java new file mode 100644 index 00000000000..f624819c634 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/IntentReserveParams.java @@ -0,0 +1,113 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class IntentReserveParams extends ApiRequestParams { + /** + * 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; + + /** Select additional fields to include in the response. */ + @SerializedName("include") + List include; + + private IntentReserveParams( + Map extraParams, List include) { + this.extraParams = extraParams; + this.include = include; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List include; + + /** Finalize and obtain parameter instance from this builder. */ + public IntentReserveParams build() { + return new IntentReserveParams(this.extraParams, this.include); + } + + /** + * 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 + * IntentReserveParams#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 IntentReserveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * IntentReserveParams#include} for the field documentation. + */ + public Builder addInclude(IntentReserveParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * IntentReserveParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("invoice_resources.preview_invoice") + INVOICE_RESOURCES__PREVIEW_INVOICE("invoice_resources.preview_invoice"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/LicenseFeeCreateParams.java b/src/main/java/com/stripe/param/v2/billing/LicenseFeeCreateParams.java index 4b752444490..2a9620309ba 100644 --- a/src/main/java/com/stripe/param/v2/billing/LicenseFeeCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/LicenseFeeCreateParams.java @@ -1,7 +1,9 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; import java.math.BigDecimal; import java.util.ArrayList; @@ -517,6 +519,7 @@ public enum UpToInf implements ApiRequestParams.EnumParam { public static class TransformQuantity { /** Required. Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** diff --git a/src/main/java/com/stripe/param/v2/billing/LicenseFeeUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/LicenseFeeUpdateParams.java index 4ca591f88e8..bde2a29bdd9 100644 --- a/src/main/java/com/stripe/param/v2/billing/LicenseFeeUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/LicenseFeeUpdateParams.java @@ -1,7 +1,9 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; @@ -512,6 +514,7 @@ public enum UpToInf implements ApiRequestParams.EnumParam { public static class TransformQuantity { /** Required. Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** diff --git a/src/main/java/com/stripe/param/v2/billing/LicensedItemCreateParams.java b/src/main/java/com/stripe/param/v2/billing/LicensedItemCreateParams.java index e7cfbecb215..7a8d2be36ba 100644 --- a/src/main/java/com/stripe/param/v2/billing/LicensedItemCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/LicensedItemCreateParams.java @@ -28,8 +28,8 @@ public class LicensedItemCreateParams extends ApiRequestParams { Map extraParams; /** - * An internal key you can use to search for a particular billable item. Must be unique among - * billable items. Maximum length of 200 characters. + * An internal key you can use to search for a particular licensed item. Must be unique among + * licensed items. Maximum length of 200 characters. */ @SerializedName("lookup_key") String lookupKey; @@ -134,8 +134,8 @@ public Builder putAllExtraParam(Map map) { } /** - * An internal key you can use to search for a particular billable item. Must be unique among - * billable items. Maximum length of 200 characters. + * An internal key you can use to search for a particular licensed item. Must be unique among + * licensed items. Maximum length of 200 characters. */ public Builder setLookupKey(String lookupKey) { this.lookupKey = lookupKey; diff --git a/src/main/java/com/stripe/param/v2/billing/LicensedItemUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/LicensedItemUpdateParams.java index 8a2b7bc2696..730c53c18f1 100644 --- a/src/main/java/com/stripe/param/v2/billing/LicensedItemUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/LicensedItemUpdateParams.java @@ -28,7 +28,7 @@ public class LicensedItemUpdateParams extends ApiRequestParams { Map extraParams; /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular licensed item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ @SerializedName("lookup_key") @@ -143,7 +143,7 @@ public Builder putAllExtraParam(Map map) { } /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular licensed item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ public Builder setLookupKey(String lookupKey) { @@ -152,7 +152,7 @@ public Builder setLookupKey(String lookupKey) { } /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular licensed item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ public Builder setLookupKey(EmptyParam lookupKey) { diff --git a/src/main/java/com/stripe/param/v2/billing/MeteredItemCreateParams.java b/src/main/java/com/stripe/param/v2/billing/MeteredItemCreateParams.java index 5939e5c3e5d..29f990f702b 100644 --- a/src/main/java/com/stripe/param/v2/billing/MeteredItemCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/MeteredItemCreateParams.java @@ -34,8 +34,8 @@ public class MeteredItemCreateParams extends ApiRequestParams { List invoicePresentationDimensions; /** - * An internal key you can use to search for a particular billable item. Must be unique among - * billable items. Maximum length of 200 characters. + * An internal key you can use to search for a particular metered item. Must be unique among + * metered items. Maximum length of 200 characters. */ @SerializedName("lookup_key") String lookupKey; @@ -189,8 +189,8 @@ public Builder addAllInvoicePresentationDimension(List elements) { } /** - * An internal key you can use to search for a particular billable item. Must be unique among - * billable items. Maximum length of 200 characters. + * An internal key you can use to search for a particular metered item. Must be unique among + * metered items. Maximum length of 200 characters. */ public Builder setLookupKey(String lookupKey) { this.lookupKey = lookupKey; diff --git a/src/main/java/com/stripe/param/v2/billing/MeteredItemUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/MeteredItemUpdateParams.java index 29fa0ba96cc..313f2feb53c 100644 --- a/src/main/java/com/stripe/param/v2/billing/MeteredItemUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/MeteredItemUpdateParams.java @@ -28,7 +28,7 @@ public class MeteredItemUpdateParams extends ApiRequestParams { Map extraParams; /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular metered item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ @SerializedName("lookup_key") @@ -144,7 +144,7 @@ public Builder putAllExtraParam(Map map) { } /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular metered item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ public Builder setLookupKey(String lookupKey) { @@ -153,7 +153,7 @@ public Builder setLookupKey(String lookupKey) { } /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular metered item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ public Builder setLookupKey(EmptyParam lookupKey) { diff --git a/src/main/java/com/stripe/param/v2/billing/OneTimeItemCreateParams.java b/src/main/java/com/stripe/param/v2/billing/OneTimeItemCreateParams.java index fb8ad764f7c..832518f1e90 100644 --- a/src/main/java/com/stripe/param/v2/billing/OneTimeItemCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/OneTimeItemCreateParams.java @@ -29,7 +29,7 @@ public class OneTimeItemCreateParams extends ApiRequestParams { /** * An internal key you can use to search for a particular one-time item. Must be unique among - * billable items. Maximum length of 200 characters. + * one-time items. Maximum length of 200 characters. */ @SerializedName("lookup_key") String lookupKey; @@ -134,7 +134,7 @@ public Builder putAllExtraParam(Map map) { /** * An internal key you can use to search for a particular one-time item. Must be unique among - * billable items. Maximum length of 200 characters. + * one-time items. Maximum length of 200 characters. */ public Builder setLookupKey(String lookupKey) { this.lookupKey = lookupKey; diff --git a/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionListParams.java b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionListParams.java index 178b4fb135f..26c9095bb24 100644 --- a/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionListParams.java +++ b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionListParams.java @@ -3,7 +3,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -27,6 +29,13 @@ public class PricingPlanSubscriptionListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Expand to include additional data such as discount_details, billing_cadence_details, or + * pricing_plan_component_details. + */ + @SerializedName("include") + List include; + /** Optionally set the maximum number of results per page. Defaults to 20. */ @SerializedName("limit") Long limit; @@ -39,14 +48,14 @@ public class PricingPlanSubscriptionListParams extends ApiRequestParams { Payer payer; /** - * Filter by PricingPlan ID. Mutually exlcusive with {@code billing_cadence}, {@code payer}, and + * Filter by PricingPlan ID. Mutually exclusive with {@code billing_cadence}, {@code payer}, and * {@code pricing_plan_version}. */ @SerializedName("pricing_plan") String pricingPlan; /** - * Filter by Pricing Plan Version ID. Mutually exlcusive with {@code billing_cadence}, {@code + * Filter by Pricing Plan Version ID. Mutually exclusive with {@code billing_cadence}, {@code * payer}, and {@code pricing_plan}. */ @SerializedName("pricing_plan_version") @@ -59,6 +68,7 @@ public class PricingPlanSubscriptionListParams extends ApiRequestParams { private PricingPlanSubscriptionListParams( String billingCadence, Map extraParams, + List include, Long limit, Payer payer, String pricingPlan, @@ -66,6 +76,7 @@ private PricingPlanSubscriptionListParams( ServicingStatus servicingStatus) { this.billingCadence = billingCadence; this.extraParams = extraParams; + this.include = include; this.limit = limit; this.payer = payer; this.pricingPlan = pricingPlan; @@ -82,6 +93,8 @@ public static class Builder { private Map extraParams; + private List include; + private Long limit; private Payer payer; @@ -97,6 +110,7 @@ public PricingPlanSubscriptionListParams build() { return new PricingPlanSubscriptionListParams( this.billingCadence, this.extraParams, + this.include, this.limit, this.payer, this.pricingPlan, @@ -139,6 +153,32 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionListParams#include} for the field documentation. + */ + public Builder addInclude(PricingPlanSubscriptionListParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionListParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + /** Optionally set the maximum number of results per page. Defaults to 20. */ public Builder setLimit(Long limit) { this.limit = limit; @@ -155,7 +195,7 @@ public Builder setPayer(PricingPlanSubscriptionListParams.Payer payer) { } /** - * Filter by PricingPlan ID. Mutually exlcusive with {@code billing_cadence}, {@code payer}, and + * Filter by PricingPlan ID. Mutually exclusive with {@code billing_cadence}, {@code payer}, and * {@code pricing_plan_version}. */ public Builder setPricingPlan(String pricingPlan) { @@ -164,7 +204,7 @@ public Builder setPricingPlan(String pricingPlan) { } /** - * Filter by Pricing Plan Version ID. Mutually exlcusive with {@code billing_cadence}, {@code + * Filter by Pricing Plan Version ID. Mutually exclusive with {@code billing_cadence}, {@code * payer}, and {@code pricing_plan}. */ public Builder setPricingPlanVersion(String pricingPlanVersion) { @@ -288,6 +328,21 @@ public enum Type implements ApiRequestParams.EnumParam { } } + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("discount_details") + DISCOUNT_DETAILS("discount_details"), + + @SerializedName("pricing_plan_component_details") + PRICING_PLAN_COMPONENT_DETAILS("pricing_plan_component_details"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } + public enum ServicingStatus implements ApiRequestParams.EnumParam { @SerializedName("active") ACTIVE("active"), diff --git a/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRemoveDiscountsParams.java b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRemoveDiscountsParams.java new file mode 100644 index 00000000000..29dbbe83465 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRemoveDiscountsParams.java @@ -0,0 +1,119 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PricingPlanSubscriptionRemoveDiscountsParams extends ApiRequestParams { + /** + * 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; + + /** Expand to include additional data such as discount_details. */ + @SerializedName("include") + List include; + + private PricingPlanSubscriptionRemoveDiscountsParams( + Map extraParams, + List include) { + this.extraParams = extraParams; + this.include = include; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List include; + + /** Finalize and obtain parameter instance from this builder. */ + public PricingPlanSubscriptionRemoveDiscountsParams build() { + return new PricingPlanSubscriptionRemoveDiscountsParams(this.extraParams, this.include); + } + + /** + * 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 + * PricingPlanSubscriptionRemoveDiscountsParams#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 PricingPlanSubscriptionRemoveDiscountsParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionRemoveDiscountsParams#include} for the field documentation. + */ + public Builder addInclude(PricingPlanSubscriptionRemoveDiscountsParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionRemoveDiscountsParams#include} for the field documentation. + */ + public Builder addAllInclude( + List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("discount_details") + DISCOUNT_DETAILS("discount_details"), + + @SerializedName("pricing_plan_component_details") + PRICING_PLAN_COMPONENT_DETAILS("pricing_plan_component_details"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRetrieveParams.java b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRetrieveParams.java new file mode 100644 index 00000000000..a22e25a5fb7 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRetrieveParams.java @@ -0,0 +1,117 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PricingPlanSubscriptionRetrieveParams extends ApiRequestParams { + /** + * 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; + + /** Expand to include additional data such as discount_details. */ + @SerializedName("include") + List include; + + private PricingPlanSubscriptionRetrieveParams( + Map extraParams, + List include) { + this.extraParams = extraParams; + this.include = include; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List include; + + /** Finalize and obtain parameter instance from this builder. */ + public PricingPlanSubscriptionRetrieveParams build() { + return new PricingPlanSubscriptionRetrieveParams(this.extraParams, this.include); + } + + /** + * 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 + * PricingPlanSubscriptionRetrieveParams#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 PricingPlanSubscriptionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionRetrieveParams#include} for the field documentation. + */ + public Builder addInclude(PricingPlanSubscriptionRetrieveParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionRetrieveParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("discount_details") + DISCOUNT_DETAILS("discount_details"), + + @SerializedName("pricing_plan_component_details") + PRICING_PLAN_COMPONENT_DETAILS("pricing_plan_component_details"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/RateCardModifyRatesParams.java b/src/main/java/com/stripe/param/v2/billing/RateCardModifyRatesParams.java new file mode 100644 index 00000000000..0e1c1791ab8 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/RateCardModifyRatesParams.java @@ -0,0 +1,1013 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; +import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class RateCardModifyRatesParams extends ApiRequestParams { + /** + * 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 list of RateCard rates to create or update. Maximum of 100 + * rates. + */ + @SerializedName("rates_to_create") + List ratesToCreate; + + /** Required. The list of RateCard rates to delete. Maximum of 100 rates. */ + @SerializedName("rates_to_delete") + List ratesToDelete; + + private RateCardModifyRatesParams( + Map extraParams, + List ratesToCreate, + List ratesToDelete) { + this.extraParams = extraParams; + this.ratesToCreate = ratesToCreate; + this.ratesToDelete = ratesToDelete; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List ratesToCreate; + + private List ratesToDelete; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams build() { + return new RateCardModifyRatesParams( + this.extraParams, this.ratesToCreate, this.ratesToDelete); + } + + /** + * 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 + * RateCardModifyRatesParams#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 RateCardModifyRatesParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `ratesToCreate` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams#ratesToCreate} for the field documentation. + */ + public Builder addRatesToCreate(RateCardModifyRatesParams.RatesToCreate element) { + if (this.ratesToCreate == null) { + this.ratesToCreate = new ArrayList<>(); + } + this.ratesToCreate.add(element); + return this; + } + + /** + * Add all elements to `ratesToCreate` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams#ratesToCreate} for the field documentation. + */ + public Builder addAllRatesToCreate(List elements) { + if (this.ratesToCreate == null) { + this.ratesToCreate = new ArrayList<>(); + } + this.ratesToCreate.addAll(elements); + return this; + } + + /** + * Add an element to `ratesToDelete` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams#ratesToDelete} for the field documentation. + */ + public Builder addRatesToDelete(RateCardModifyRatesParams.RatesToDelete element) { + if (this.ratesToDelete == null) { + this.ratesToDelete = new ArrayList<>(); + } + this.ratesToDelete.add(element); + return this; + } + + /** + * Add all elements to `ratesToDelete` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams#ratesToDelete} for the field documentation. + */ + public Builder addAllRatesToDelete(List elements) { + if (this.ratesToDelete == null) { + this.ratesToDelete = new ArrayList<>(); + } + this.ratesToDelete.addAll(elements); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RatesToCreate { + /** + * 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; + + /** + * 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. + */ + @SerializedName("metadata") + Map metadata; + + /** + * The Metered Item that this rate binds to. Cannot be set if {@code metered_item_data} is + * provided, and must be set if it isn't. + */ + @SerializedName("metered_item") + String meteredItem; + + /** + * The data to create a metered item that binds to this rate. Cannot be set if {@code + * metered_item} is provided, and must be set if it isn't. + */ + @SerializedName("metered_item_data") + MeteredItemData meteredItemData; + + /** + * Defines whether the tiered price should be graduated or volume-based. In volume-based + * tiering, the maximum quantity within a period determines the per-unit price. In graduated + * tiering, the pricing changes as the quantity grows into new tiers. Can only be set if {@code + * tiers} is set. + */ + @SerializedName("tiering_mode") + TieringMode tieringMode; + + /** Each element represents a pricing tier. Cannot be set if {@code unit_amount} is provided. */ + @SerializedName("tiers") + List tiers; + + /** + * Apply a transformation to the reported usage or set quantity before computing the amount + * billed. + */ + @SerializedName("transform_quantity") + TransformQuantity transformQuantity; + + /** + * The per-unit amount to be charged, represented as a decimal string in minor currency units + * with at most 12 decimal places. Cannot be set if {@code tiers} is provided. + */ + @SerializedName("unit_amount") + String unitAmount; + + private RatesToCreate( + Map extraParams, + Map metadata, + String meteredItem, + MeteredItemData meteredItemData, + TieringMode tieringMode, + List tiers, + TransformQuantity transformQuantity, + String unitAmount) { + this.extraParams = extraParams; + this.metadata = metadata; + this.meteredItem = meteredItem; + this.meteredItemData = meteredItemData; + this.tieringMode = tieringMode; + this.tiers = tiers; + this.transformQuantity = transformQuantity; + this.unitAmount = unitAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Map metadata; + + private String meteredItem; + + private MeteredItemData meteredItemData; + + private TieringMode tieringMode; + + private List tiers; + + private TransformQuantity transformQuantity; + + private String unitAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToCreate build() { + return new RateCardModifyRatesParams.RatesToCreate( + this.extraParams, + this.metadata, + this.meteredItem, + this.meteredItemData, + this.tieringMode, + this.tiers, + this.transformQuantity, + this.unitAmount); + } + + /** + * 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 + * RateCardModifyRatesParams.RatesToCreate#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 RateCardModifyRatesParams.RatesToCreate#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + 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 + * RateCardModifyRatesParams.RatesToCreate#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 RateCardModifyRatesParams.RatesToCreate#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 Metered Item that this rate binds to. Cannot be set if {@code metered_item_data} is + * provided, and must be set if it isn't. + */ + public Builder setMeteredItem(String meteredItem) { + this.meteredItem = meteredItem; + return this; + } + + /** + * The data to create a metered item that binds to this rate. Cannot be set if {@code + * metered_item} is provided, and must be set if it isn't. + */ + public Builder setMeteredItemData( + RateCardModifyRatesParams.RatesToCreate.MeteredItemData meteredItemData) { + this.meteredItemData = meteredItemData; + return this; + } + + /** + * Defines whether the tiered price should be graduated or volume-based. In volume-based + * tiering, the maximum quantity within a period determines the per-unit price. In graduated + * tiering, the pricing changes as the quantity grows into new tiers. Can only be set if + * {@code tiers} is set. + */ + public Builder setTieringMode( + RateCardModifyRatesParams.RatesToCreate.TieringMode tieringMode) { + this.tieringMode = tieringMode; + return this; + } + + /** + * Add an element to `tiers` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams.RatesToCreate#tiers} for the field documentation. + */ + public Builder addTier(RateCardModifyRatesParams.RatesToCreate.Tier element) { + if (this.tiers == null) { + this.tiers = new ArrayList<>(); + } + this.tiers.add(element); + return this; + } + + /** + * Add all elements to `tiers` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams.RatesToCreate#tiers} for the field documentation. + */ + public Builder addAllTier(List elements) { + if (this.tiers == null) { + this.tiers = new ArrayList<>(); + } + this.tiers.addAll(elements); + return this; + } + + /** + * Apply a transformation to the reported usage or set quantity before computing the amount + * billed. + */ + public Builder setTransformQuantity( + RateCardModifyRatesParams.RatesToCreate.TransformQuantity transformQuantity) { + this.transformQuantity = transformQuantity; + return this; + } + + /** + * The per-unit amount to be charged, represented as a decimal string in minor currency units + * with at most 12 decimal places. Cannot be set if {@code tiers} is provided. + */ + public Builder setUnitAmount(String unitAmount) { + this.unitAmount = unitAmount; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MeteredItemData { + /** + * Required. Description that customers will see in the invoice line item. + * Maximum length of 250 characters. + */ + @SerializedName("display_name") + String displayName; + + /** + * 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; + + /** + * An internal key you can use to search for a particular metered item. Must be unique among + * metered items. Maximum length of 200 characters. + */ + @SerializedName("lookup_key") + String lookupKey; + + /** Required. ID of the Meter that measures usage for this Metered Item. */ + @SerializedName("meter") + String meter; + + /** + * Required. Optional array of Meter segments to filter event dimension keys + * for billing. + */ + @SerializedName("meter_segment_conditions") + List + meterSegmentConditions; + + /** + * The unit to use when displaying prices for this billable item in places like Checkout. For + * example, set this field to "CPU-hour" for Checkout to display "(price) per + * CPU-hour", or "1 million events" to display "(price) per 1 million + * events". Maximum length of 100 characters. + */ + @SerializedName("unit_label") + String unitLabel; + + private MeteredItemData( + String displayName, + Map extraParams, + String lookupKey, + String meter, + List + meterSegmentConditions, + String unitLabel) { + this.displayName = displayName; + this.extraParams = extraParams; + this.lookupKey = lookupKey; + this.meter = meter; + this.meterSegmentConditions = meterSegmentConditions; + this.unitLabel = unitLabel; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String displayName; + + private Map extraParams; + + private String lookupKey; + + private String meter; + + private List + meterSegmentConditions; + + private String unitLabel; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToCreate.MeteredItemData build() { + return new RateCardModifyRatesParams.RatesToCreate.MeteredItemData( + this.displayName, + this.extraParams, + this.lookupKey, + this.meter, + this.meterSegmentConditions, + this.unitLabel); + } + + /** + * Required. Description that customers will see in the invoice line item. + * Maximum length of 250 characters. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + 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 RateCardModifyRatesParams.RatesToCreate.MeteredItemData#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 RateCardModifyRatesParams.RatesToCreate.MeteredItemData#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * An internal key you can use to search for a particular metered item. Must be unique among + * metered items. Maximum length of 200 characters. + */ + public Builder setLookupKey(String lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** Required. ID of the Meter that measures usage for this Metered Item. */ + public Builder setMeter(String meter) { + this.meter = meter; + return this; + } + + /** + * Add an element to `meterSegmentConditions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link + * RateCardModifyRatesParams.RatesToCreate.MeteredItemData#meterSegmentConditions} for the + * field documentation. + */ + public Builder addMeterSegmentCondition( + RateCardModifyRatesParams.RatesToCreate.MeteredItemData.MeterSegmentCondition element) { + if (this.meterSegmentConditions == null) { + this.meterSegmentConditions = new ArrayList<>(); + } + this.meterSegmentConditions.add(element); + return this; + } + + /** + * Add all elements to `meterSegmentConditions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link + * RateCardModifyRatesParams.RatesToCreate.MeteredItemData#meterSegmentConditions} for the + * field documentation. + */ + public Builder addAllMeterSegmentCondition( + List + elements) { + if (this.meterSegmentConditions == null) { + this.meterSegmentConditions = new ArrayList<>(); + } + this.meterSegmentConditions.addAll(elements); + return this; + } + + /** + * The unit to use when displaying prices for this billable item in places like Checkout. + * For example, set this field to "CPU-hour" for Checkout to display "(price) + * per CPU-hour", or "1 million events" to display "(price) per 1 + * million events". Maximum length of 100 characters. + */ + public Builder setUnitLabel(String unitLabel) { + this.unitLabel = unitLabel; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MeterSegmentCondition { + /** Required. A Meter dimension. */ + @SerializedName("dimension") + String dimension; + + /** + * 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. To count usage towards this metered item, the dimension must + * have this value. + */ + @SerializedName("value") + String value; + + private MeterSegmentCondition( + String dimension, Map extraParams, String value) { + this.dimension = dimension; + this.extraParams = extraParams; + this.value = value; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String dimension; + + private Map extraParams; + + private String value; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToCreate.MeteredItemData.MeterSegmentCondition + build() { + return new RateCardModifyRatesParams.RatesToCreate.MeteredItemData + .MeterSegmentCondition(this.dimension, this.extraParams, this.value); + } + + /** Required. A Meter dimension. */ + public Builder setDimension(String dimension) { + this.dimension = dimension; + 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 + * RateCardModifyRatesParams.RatesToCreate.MeteredItemData.MeterSegmentCondition#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 + * RateCardModifyRatesParams.RatesToCreate.MeteredItemData.MeterSegmentCondition#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. To count usage towards this metered item, the dimension must + * have this value. + */ + public Builder setValue(String value) { + this.value = value; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tier { + /** + * 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; + + /** + * Price for the entire tier, represented as a decimal string in minor currency units with at + * most 12 decimal places. + */ + @SerializedName("flat_amount") + String flatAmount; + + /** + * Per-unit price for units included in this tier, represented as a decimal string in minor + * currency units with at most 12 decimal places. + */ + @SerializedName("unit_amount") + String unitAmount; + + /** + * Up to and including this quantity will be contained in the tier. Only one of {@code + * up_to_decimal} and {@code up_to_inf} may be set. + */ + @SerializedName("up_to_decimal") + BigDecimal upToDecimal; + + /** + * No upper bound to this tier. Only one of {@code up_to_decimal} and {@code up_to_inf} may be + * set. + */ + @SerializedName("up_to_inf") + UpToInf upToInf; + + private Tier( + Map extraParams, + String flatAmount, + String unitAmount, + BigDecimal upToDecimal, + UpToInf upToInf) { + this.extraParams = extraParams; + this.flatAmount = flatAmount; + this.unitAmount = unitAmount; + this.upToDecimal = upToDecimal; + this.upToInf = upToInf; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String flatAmount; + + private String unitAmount; + + private BigDecimal upToDecimal; + + private UpToInf upToInf; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToCreate.Tier build() { + return new RateCardModifyRatesParams.RatesToCreate.Tier( + this.extraParams, this.flatAmount, this.unitAmount, this.upToDecimal, this.upToInf); + } + + /** + * 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 RateCardModifyRatesParams.RatesToCreate.Tier#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 RateCardModifyRatesParams.RatesToCreate.Tier#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Price for the entire tier, represented as a decimal string in minor currency units with + * at most 12 decimal places. + */ + public Builder setFlatAmount(String flatAmount) { + this.flatAmount = flatAmount; + return this; + } + + /** + * Per-unit price for units included in this tier, represented as a decimal string in minor + * currency units with at most 12 decimal places. + */ + public Builder setUnitAmount(String unitAmount) { + this.unitAmount = unitAmount; + return this; + } + + /** + * Up to and including this quantity will be contained in the tier. Only one of {@code + * up_to_decimal} and {@code up_to_inf} may be set. + */ + public Builder setUpToDecimal(BigDecimal upToDecimal) { + this.upToDecimal = upToDecimal; + return this; + } + + /** + * No upper bound to this tier. Only one of {@code up_to_decimal} and {@code up_to_inf} may + * be set. + */ + public Builder setUpToInf(RateCardModifyRatesParams.RatesToCreate.Tier.UpToInf upToInf) { + this.upToInf = upToInf; + return this; + } + } + + public enum UpToInf implements ApiRequestParams.EnumParam { + @SerializedName("inf") + INF("inf"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + UpToInf(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TransformQuantity { + /** Required. Divide usage by this number. */ + @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) + Long divideBy; + + /** + * 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. After division, round the result up or down. */ + @SerializedName("round") + Round round; + + private TransformQuantity(Long divideBy, Map extraParams, Round round) { + this.divideBy = divideBy; + this.extraParams = extraParams; + this.round = round; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long divideBy; + + private Map extraParams; + + private Round round; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToCreate.TransformQuantity build() { + return new RateCardModifyRatesParams.RatesToCreate.TransformQuantity( + this.divideBy, this.extraParams, this.round); + } + + /** Required. Divide usage by this number. */ + public Builder setDivideBy(Long divideBy) { + this.divideBy = divideBy; + 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 RateCardModifyRatesParams.RatesToCreate.TransformQuantity#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 RateCardModifyRatesParams.RatesToCreate.TransformQuantity#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. After division, round the result up or down. */ + public Builder setRound( + RateCardModifyRatesParams.RatesToCreate.TransformQuantity.Round round) { + this.round = round; + return this; + } + } + + public enum Round implements ApiRequestParams.EnumParam { + @SerializedName("down") + DOWN("down"), + + @SerializedName("up") + UP("up"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Round(String value) { + this.value = value; + } + } + } + + public enum TieringMode implements ApiRequestParams.EnumParam { + @SerializedName("graduated") + GRADUATED("graduated"), + + @SerializedName("volume") + VOLUME("volume"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TieringMode(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RatesToDelete { + /** + * 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 ID of the RateCard rate to delete. */ + @SerializedName("id") + String id; + + private RatesToDelete(Map extraParams, String id) { + this.extraParams = extraParams; + this.id = id; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String id; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToDelete build() { + return new RateCardModifyRatesParams.RatesToDelete(this.extraParams, this.id); + } + + /** + * 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 + * RateCardModifyRatesParams.RatesToDelete#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 RateCardModifyRatesParams.RatesToDelete#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 ID of the RateCard rate to delete. */ + public Builder setId(String id) { + this.id = id; + return this; + } + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/RateCardSubscriptionListParams.java b/src/main/java/com/stripe/param/v2/billing/RateCardSubscriptionListParams.java index 3e6def0f721..a43c51bdf54 100644 --- a/src/main/java/com/stripe/param/v2/billing/RateCardSubscriptionListParams.java +++ b/src/main/java/com/stripe/param/v2/billing/RateCardSubscriptionListParams.java @@ -27,7 +27,7 @@ public class RateCardSubscriptionListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The page size limit, if not provided the default is 20. */ + /** The page size limit. Defaults to 20. */ @SerializedName("limit") Long limit; @@ -140,7 +140,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The page size limit, if not provided the default is 20. */ + /** The page size limit. Defaults to 20. */ public Builder setLimit(Long limit) { this.limit = limit; return this; diff --git a/src/main/java/com/stripe/param/v2/billing/pricingplans/ComponentCreateParams.java b/src/main/java/com/stripe/param/v2/billing/pricingplans/ComponentCreateParams.java index 66f1f0f786d..6594e61eb5b 100644 --- a/src/main/java/com/stripe/param/v2/billing/pricingplans/ComponentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/pricingplans/ComponentCreateParams.java @@ -195,7 +195,7 @@ public static class LicenseFee { @SerializedName("id") String id; - /** The version of the LicenseFee. Defaults to 'latest', if not specified. */ + /** The ID of the License Fee Version. If not specified, defaults to 'latest'. */ @SerializedName("version") String version; @@ -253,7 +253,7 @@ public Builder setId(String id) { return this; } - /** The version of the LicenseFee. Defaults to 'latest', if not specified. */ + /** The ID of the License Fee Version. If not specified, defaults to 'latest'. */ public Builder setVersion(String version) { this.version = version; return this; @@ -277,7 +277,7 @@ public static class RateCard { @SerializedName("id") String id; - /** The version of the RateCard. Defaults to 'latest', if not specified. */ + /** The ID of the Rate Card Version. If not specified, defaults to 'latest'. */ @SerializedName("version") String version; @@ -335,7 +335,7 @@ public Builder setId(String id) { return this; } - /** The version of the RateCard. Defaults to 'latest', if not specified. */ + /** The ID of the Rate Card Version. If not specified, defaults to 'latest'. */ public Builder setVersion(String version) { this.version = version; return this; diff --git a/src/main/java/com/stripe/param/v2/billing/ratecards/RateCreateParams.java b/src/main/java/com/stripe/param/v2/billing/ratecards/RateCreateParams.java index 1b6b6c0e219..e9286bce9c8 100644 --- a/src/main/java/com/stripe/param/v2/billing/ratecards/RateCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/ratecards/RateCreateParams.java @@ -1,7 +1,9 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing.ratecards; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; import java.math.BigDecimal; import java.util.ArrayList; @@ -489,6 +491,7 @@ public enum UpToInf implements ApiRequestParams.EnumParam { public static class TransformQuantity { /** Required. Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** 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 d59bf7731c8..c8f28ae8c5a 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java @@ -13585,17 +13585,26 @@ public static class Defaults { @SerializedName("responsibilities") Responsibilities responsibilities; + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + @SerializedName("timezone") + String timezone; + private Defaults( String currency, Map extraParams, List locales, Profile profile, - Responsibilities responsibilities) { + Responsibilities responsibilities, + String timezone) { this.currency = currency; this.extraParams = extraParams; this.locales = locales; this.profile = profile; this.responsibilities = responsibilities; + this.timezone = timezone; } public static Builder builder() { @@ -13613,10 +13622,17 @@ public static class Builder { private Responsibilities responsibilities; + private String timezone; + /** Finalize and obtain parameter instance from this builder. */ public AccountCreateParams.Defaults build() { return new AccountCreateParams.Defaults( - this.currency, this.extraParams, this.locales, this.profile, this.responsibilities); + this.currency, + this.extraParams, + this.locales, + this.profile, + this.responsibilities, + this.timezone); } /** @@ -13693,6 +13709,15 @@ public Builder setResponsibilities( this.responsibilities = responsibilities; return this; } + + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + public Builder setTimezone(String timezone) { + this.timezone = timezone; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/v2/core/AccountEvaluationCreateParams.java b/src/main/java/com/stripe/param/v2/core/AccountEvaluationCreateParams.java new file mode 100644 index 00000000000..60026c95e24 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/AccountEvaluationCreateParams.java @@ -0,0 +1,557 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class AccountEvaluationCreateParams extends ApiRequestParams { + /** The account ID to evaluate. Exactly one of account or account_data must be provided. */ + @SerializedName("account") + String account; + + /** + * Account data for entity-less evaluation. Exactly one of account or account_data must be + * provided. + */ + @SerializedName("account_data") + AccountData accountData; + + /** + * 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. List of signals to evaluate. */ + @SerializedName("signals") + List signals; + + private AccountEvaluationCreateParams( + String account, + AccountData accountData, + Map extraParams, + List signals) { + this.account = account; + this.accountData = accountData; + this.extraParams = extraParams; + this.signals = signals; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String account; + + private AccountData accountData; + + private Map extraParams; + + private List signals; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams build() { + return new AccountEvaluationCreateParams( + this.account, this.accountData, this.extraParams, this.signals); + } + + /** The account ID to evaluate. Exactly one of account or account_data must be provided. */ + public Builder setAccount(String account) { + this.account = account; + return this; + } + + /** + * Account data for entity-less evaluation. Exactly one of account or account_data must be + * provided. + */ + public Builder setAccountData(AccountEvaluationCreateParams.AccountData accountData) { + this.accountData = accountData; + 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 + * AccountEvaluationCreateParams#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 AccountEvaluationCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `signals` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * AccountEvaluationCreateParams#signals} for the field documentation. + */ + public Builder addSignal(AccountEvaluationCreateParams.Signal element) { + if (this.signals == null) { + this.signals = new ArrayList<>(); + } + this.signals.add(element); + return this; + } + + /** + * Add all elements to `signals` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * AccountEvaluationCreateParams#signals} for the field documentation. + */ + public Builder addAllSignal(List elements) { + if (this.signals == null) { + this.signals = new ArrayList<>(); + } + this.signals.addAll(elements); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AccountData { + /** Default account settings. */ + @SerializedName("defaults") + Defaults defaults; + + /** + * 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; + + /** Identity data. */ + @SerializedName("identity") + Identity identity; + + private AccountData(Defaults defaults, Map extraParams, Identity identity) { + this.defaults = defaults; + this.extraParams = extraParams; + this.identity = identity; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Defaults defaults; + + private Map extraParams; + + private Identity identity; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams.AccountData build() { + return new AccountEvaluationCreateParams.AccountData( + this.defaults, this.extraParams, this.identity); + } + + /** Default account settings. */ + public Builder setDefaults(AccountEvaluationCreateParams.AccountData.Defaults defaults) { + this.defaults = defaults; + 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 + * AccountEvaluationCreateParams.AccountData#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 AccountEvaluationCreateParams.AccountData#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Identity data. */ + public Builder setIdentity(AccountEvaluationCreateParams.AccountData.Identity identity) { + this.identity = identity; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Defaults { + /** + * 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. Account profile data. */ + @SerializedName("profile") + Profile profile; + + private Defaults(Map extraParams, Profile profile) { + this.extraParams = extraParams; + this.profile = profile; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Profile profile; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams.AccountData.Defaults build() { + return new AccountEvaluationCreateParams.AccountData.Defaults( + this.extraParams, this.profile); + } + + /** + * 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 AccountEvaluationCreateParams.AccountData.Defaults#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 AccountEvaluationCreateParams.AccountData.Defaults#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. Account profile data. */ + public Builder setProfile( + AccountEvaluationCreateParams.AccountData.Defaults.Profile profile) { + this.profile = profile; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Profile { + /** Required. The business URL. */ + @SerializedName("business_url") + String businessUrl; + + /** Doing business as (DBA) name. */ + @SerializedName("doing_business_as") + String doingBusinessAs; + + /** + * 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; + + /** Description of the account's product or service. */ + @SerializedName("product_description") + String productDescription; + + private Profile( + String businessUrl, + String doingBusinessAs, + Map extraParams, + String productDescription) { + this.businessUrl = businessUrl; + this.doingBusinessAs = doingBusinessAs; + this.extraParams = extraParams; + this.productDescription = productDescription; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String businessUrl; + + private String doingBusinessAs; + + private Map extraParams; + + private String productDescription; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams.AccountData.Defaults.Profile build() { + return new AccountEvaluationCreateParams.AccountData.Defaults.Profile( + this.businessUrl, this.doingBusinessAs, this.extraParams, this.productDescription); + } + + /** Required. The business URL. */ + public Builder setBusinessUrl(String businessUrl) { + this.businessUrl = businessUrl; + return this; + } + + /** Doing business as (DBA) name. */ + public Builder setDoingBusinessAs(String doingBusinessAs) { + this.doingBusinessAs = doingBusinessAs; + 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 AccountEvaluationCreateParams.AccountData.Defaults.Profile#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 AccountEvaluationCreateParams.AccountData.Defaults.Profile#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Description of the account's product or service. */ + public Builder setProductDescription(String productDescription) { + this.productDescription = productDescription; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Identity { + /** Required. Business details for identity data. */ + @SerializedName("business_details") + BusinessDetails businessDetails; + + /** + * 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 Identity(BusinessDetails businessDetails, Map extraParams) { + this.businessDetails = businessDetails; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BusinessDetails businessDetails; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams.AccountData.Identity build() { + return new AccountEvaluationCreateParams.AccountData.Identity( + this.businessDetails, this.extraParams); + } + + /** Required. Business details for identity data. */ + public Builder setBusinessDetails( + AccountEvaluationCreateParams.AccountData.Identity.BusinessDetails businessDetails) { + this.businessDetails = businessDetails; + 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 AccountEvaluationCreateParams.AccountData.Identity#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 AccountEvaluationCreateParams.AccountData.Identity#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 BusinessDetails { + /** + * 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; + + /** Registered business name. */ + @SerializedName("registered_name") + String registeredName; + + private BusinessDetails(Map extraParams, String registeredName) { + this.extraParams = extraParams; + this.registeredName = registeredName; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String registeredName; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams.AccountData.Identity.BusinessDetails build() { + return new AccountEvaluationCreateParams.AccountData.Identity.BusinessDetails( + this.extraParams, this.registeredName); + } + + /** + * 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 + * AccountEvaluationCreateParams.AccountData.Identity.BusinessDetails#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 + * AccountEvaluationCreateParams.AccountData.Identity.BusinessDetails#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Registered business name. */ + public Builder setRegisteredName(String registeredName) { + this.registeredName = registeredName; + return this; + } + } + } + } + } + + public enum Signal implements ApiRequestParams.EnumParam { + @SerializedName("fraudulent_website") + FRAUDULENT_WEBSITE("fraudulent_website"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Signal(String value) { + this.value = value; + } + } +} 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 7d2d124fe49..6d17da5fb8d 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java @@ -14239,17 +14239,26 @@ public static class Defaults { @SerializedName("responsibilities") Responsibilities responsibilities; + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + @SerializedName("timezone") + Object timezone; + private Defaults( Object currency, Map extraParams, List locales, Profile profile, - Responsibilities responsibilities) { + Responsibilities responsibilities, + Object timezone) { this.currency = currency; this.extraParams = extraParams; this.locales = locales; this.profile = profile; this.responsibilities = responsibilities; + this.timezone = timezone; } public static Builder builder() { @@ -14267,10 +14276,17 @@ public static class Builder { private Responsibilities responsibilities; + private Object timezone; + /** Finalize and obtain parameter instance from this builder. */ public AccountUpdateParams.Defaults build() { return new AccountUpdateParams.Defaults( - this.currency, this.extraParams, this.locales, this.profile, this.responsibilities); + this.currency, + this.extraParams, + this.locales, + this.profile, + this.responsibilities, + this.timezone); } /** @@ -14357,6 +14373,24 @@ public Builder setResponsibilities( this.responsibilities = responsibilities; return this; } + + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + public Builder setTimezone(String timezone) { + this.timezone = timezone; + return this; + } + + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + public Builder setTimezone(EmptyParam timezone) { + this.timezone = timezone; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/v2/core/BatchJobCreateParams.java b/src/main/java/com/stripe/param/v2/core/BatchJobCreateParams.java new file mode 100644 index 00000000000..34c67d543af --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/BatchJobCreateParams.java @@ -0,0 +1,356 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class BatchJobCreateParams extends ApiRequestParams { + /** Required. The endpoint configuration for the batch job. */ + @SerializedName("endpoint") + Endpoint endpoint; + + /** + * 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; + + /** + * Optional field that allows the user to control how fast they want this batch job to run. Gives + * them a control over the number of webhooks they receive. + */ + @SerializedName("maximum_rps") + Long maximumRps; + + /** Required. The metadata of the {@code BatchJob} object. */ + @SerializedName("metadata") + Map metadata; + + /** Notification suppression settings for the batch job. */ + @SerializedName("notification_suppression") + NotificationSuppression notificationSuppression; + + /** Required. Allows the user to skip validation. */ + @SerializedName("skip_validation") + Boolean skipValidation; + + private BatchJobCreateParams( + Endpoint endpoint, + Map extraParams, + Long maximumRps, + Map metadata, + NotificationSuppression notificationSuppression, + Boolean skipValidation) { + this.endpoint = endpoint; + this.extraParams = extraParams; + this.maximumRps = maximumRps; + this.metadata = metadata; + this.notificationSuppression = notificationSuppression; + this.skipValidation = skipValidation; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Endpoint endpoint; + + private Map extraParams; + + private Long maximumRps; + + private Map metadata; + + private NotificationSuppression notificationSuppression; + + private Boolean skipValidation; + + /** Finalize and obtain parameter instance from this builder. */ + public BatchJobCreateParams build() { + return new BatchJobCreateParams( + this.endpoint, + this.extraParams, + this.maximumRps, + this.metadata, + this.notificationSuppression, + this.skipValidation); + } + + /** Required. The endpoint configuration for the batch job. */ + public Builder setEndpoint(BatchJobCreateParams.Endpoint endpoint) { + this.endpoint = endpoint; + 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 + * BatchJobCreateParams#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 BatchJobCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Optional field that allows the user to control how fast they want this batch job to run. + * Gives them a control over the number of webhooks they receive. + */ + public Builder setMaximumRps(Long maximumRps) { + this.maximumRps = maximumRps; + 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 + * BatchJobCreateParams#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 BatchJobCreateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** Notification suppression settings for the batch job. */ + public Builder setNotificationSuppression( + BatchJobCreateParams.NotificationSuppression notificationSuppression) { + this.notificationSuppression = notificationSuppression; + return this; + } + + /** Required. Allows the user to skip validation. */ + public Builder setSkipValidation(Boolean skipValidation) { + this.skipValidation = skipValidation; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Endpoint { + /** + * 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 HTTP method to use when calling the endpoint. */ + @SerializedName("http_method") + HttpMethod httpMethod; + + /** + * Required. The path of the endpoint to run this batch job against. In the + * form used in the documentation. For instance, for subscription migration this would be {@code + * /v1/subscriptions/:id/migrate}. + */ + @SerializedName("path") + String path; + + private Endpoint(Map extraParams, HttpMethod httpMethod, String path) { + this.extraParams = extraParams; + this.httpMethod = httpMethod; + this.path = path; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private HttpMethod httpMethod; + + private String path; + + /** Finalize and obtain parameter instance from this builder. */ + public BatchJobCreateParams.Endpoint build() { + return new BatchJobCreateParams.Endpoint(this.extraParams, this.httpMethod, this.path); + } + + /** + * 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 + * BatchJobCreateParams.Endpoint#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 BatchJobCreateParams.Endpoint#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 HTTP method to use when calling the endpoint. */ + public Builder setHttpMethod(BatchJobCreateParams.Endpoint.HttpMethod httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + /** + * Required. The path of the endpoint to run this batch job against. In the + * form used in the documentation. For instance, for subscription migration this would be + * {@code /v1/subscriptions/:id/migrate}. + */ + public Builder setPath(String path) { + this.path = path; + return this; + } + } + + public enum HttpMethod implements ApiRequestParams.EnumParam { + @SerializedName("post") + POST("post"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + HttpMethod(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NotificationSuppression { + /** + * 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 scope of notification suppression. */ + @SerializedName("scope") + Scope scope; + + private NotificationSuppression(Map extraParams, Scope scope) { + this.extraParams = extraParams; + this.scope = scope; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Scope scope; + + /** Finalize and obtain parameter instance from this builder. */ + public BatchJobCreateParams.NotificationSuppression build() { + return new BatchJobCreateParams.NotificationSuppression(this.extraParams, this.scope); + } + + /** + * 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 + * BatchJobCreateParams.NotificationSuppression#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 BatchJobCreateParams.NotificationSuppression#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 scope of notification suppression. */ + public Builder setScope(BatchJobCreateParams.NotificationSuppression.Scope scope) { + this.scope = scope; + return this; + } + } + + public enum Scope implements ApiRequestParams.EnumParam { + @SerializedName("all") + ALL("all"), + + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Scope(String value) { + this.value = value; + } + } + } +} 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..ac0f1c63ee2 100644 --- a/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java @@ -17,6 +17,10 @@ public class EventDestinationCreateParams extends ApiRequestParams { @SerializedName("amazon_eventbridge") AmazonEventbridge amazonEventbridge; + /** Azure Event Grid configuration. */ + @SerializedName("azure_event_grid") + AzureEventGrid azureEventGrid; + /** An optional description of what the event destination is used for. */ @SerializedName("description") String description; @@ -29,9 +33,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 @@ -68,10 +79,11 @@ public class EventDestinationCreateParams extends ApiRequestParams { private EventDestinationCreateParams( AmazonEventbridge amazonEventbridge, + AzureEventGrid azureEventGrid, String description, List enabledEvents, EventPayload eventPayload, - List eventsFrom, + List eventsFrom, Map extraParams, List include, Map metadata, @@ -80,6 +92,7 @@ private EventDestinationCreateParams( Type type, WebhookEndpoint webhookEndpoint) { this.amazonEventbridge = amazonEventbridge; + this.azureEventGrid = azureEventGrid; this.description = description; this.enabledEvents = enabledEvents; this.eventPayload = eventPayload; @@ -100,13 +113,15 @@ public static Builder builder() { public static class Builder { private AmazonEventbridge amazonEventbridge; + private AzureEventGrid azureEventGrid; + private String description; private List enabledEvents; private EventPayload eventPayload; - private List eventsFrom; + private List eventsFrom; private Map extraParams; @@ -126,6 +141,7 @@ public static class Builder { public EventDestinationCreateParams build() { return new EventDestinationCreateParams( this.amazonEventbridge, + this.azureEventGrid, this.description, this.enabledEvents, this.eventPayload, @@ -146,6 +162,12 @@ public Builder setAmazonEventbridge( return this; } + /** Azure Event Grid configuration. */ + public Builder setAzureEventGrid(EventDestinationCreateParams.AzureEventGrid azureEventGrid) { + this.azureEventGrid = azureEventGrid; + return this; + } + /** An optional description of what the event destination is used for. */ public Builder setDescription(String description) { this.description = description; @@ -189,7 +211,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 +224,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<>(); } @@ -399,6 +421,110 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AzureEventGrid { + /** Required. The Azure region. */ + @SerializedName("azure_region") + String azureRegion; + + /** Required. The name of the Azure resource group. */ + @SerializedName("azure_resource_group_name") + String azureResourceGroupName; + + /** Required. The Azure subscription ID. */ + @SerializedName("azure_subscription_id") + String azureSubscriptionId; + + /** + * 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 AzureEventGrid( + String azureRegion, + String azureResourceGroupName, + String azureSubscriptionId, + Map extraParams) { + this.azureRegion = azureRegion; + this.azureResourceGroupName = azureResourceGroupName; + this.azureSubscriptionId = azureSubscriptionId; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String azureRegion; + + private String azureResourceGroupName; + + private String azureSubscriptionId; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public EventDestinationCreateParams.AzureEventGrid build() { + return new EventDestinationCreateParams.AzureEventGrid( + this.azureRegion, + this.azureResourceGroupName, + this.azureSubscriptionId, + this.extraParams); + } + + /** Required. The Azure region. */ + public Builder setAzureRegion(String azureRegion) { + this.azureRegion = azureRegion; + return this; + } + + /** Required. The name of the Azure resource group. */ + public Builder setAzureResourceGroupName(String azureResourceGroupName) { + this.azureResourceGroupName = azureResourceGroupName; + return this; + } + + /** Required. The Azure subscription ID. */ + public Builder setAzureSubscriptionId(String azureSubscriptionId) { + this.azureSubscriptionId = azureSubscriptionId; + 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 + * EventDestinationCreateParams.AzureEventGrid#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 EventDestinationCreateParams.AzureEventGrid#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 WebhookEndpoint { @@ -484,21 +610,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"), @@ -518,6 +629,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("amazon_eventbridge") AMAZON_EVENTBRIDGE("amazon_eventbridge"), + @SerializedName("azure_event_grid") + AZURE_EVENT_GRID("azure_event_grid"), + @SerializedName("webhook_endpoint") WEBHOOK_ENDPOINT("webhook_endpoint"); diff --git a/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java b/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java index 99bab7392cc..d2d92082548 100644 --- a/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java @@ -11,7 +11,7 @@ @Getter @EqualsAndHashCode(callSuper = false) public class GbBankAccountCreateParams extends ApiRequestParams { - /** Required. The Account Number of the bank account. */ + /** The Account Number of the bank account. */ @SerializedName("account_number") String accountNumber; @@ -27,6 +27,10 @@ public class GbBankAccountCreateParams extends ApiRequestParams { @SerializedName("confirmation_of_payee") ConfirmationOfPayee confirmationOfPayee; + /** Required. The currency of the bank account. */ + @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 @@ -36,7 +40,11 @@ public class GbBankAccountCreateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. The Sort Code of the bank account. */ + /** The IBAN of the bank account. */ + @SerializedName("iban") + String iban; + + /** The Sort Code of the bank account. */ @SerializedName("sort_code") String sortCode; @@ -44,12 +52,16 @@ private GbBankAccountCreateParams( String accountNumber, BankAccountType bankAccountType, ConfirmationOfPayee confirmationOfPayee, + String currency, Map extraParams, + String iban, String sortCode) { this.accountNumber = accountNumber; this.bankAccountType = bankAccountType; this.confirmationOfPayee = confirmationOfPayee; + this.currency = currency; this.extraParams = extraParams; + this.iban = iban; this.sortCode = sortCode; } @@ -64,8 +76,12 @@ public static class Builder { private ConfirmationOfPayee confirmationOfPayee; + private String currency; + private Map extraParams; + private String iban; + private String sortCode; /** Finalize and obtain parameter instance from this builder. */ @@ -74,11 +90,13 @@ public GbBankAccountCreateParams build() { this.accountNumber, this.bankAccountType, this.confirmationOfPayee, + this.currency, this.extraParams, + this.iban, this.sortCode); } - /** Required. The Account Number of the bank account. */ + /** The Account Number of the bank account. */ public Builder setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; return this; @@ -101,6 +119,12 @@ public Builder setConfirmationOfPayee( return this; } + /** Required. The currency of the bank account. */ + 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 @@ -127,7 +151,13 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. The Sort Code of the bank account. */ + /** The IBAN of the bank account. */ + public Builder setIban(String iban) { + this.iban = iban; + return this; + } + + /** The Sort Code of the bank account. */ public Builder setSortCode(String sortCode) { this.sortCode = sortCode; return this; diff --git a/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java index a4e185f8968..fbfcc96efce 100644 --- a/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java @@ -19,6 +19,10 @@ public class UsBankAccountCreateParams extends ApiRequestParams { @SerializedName("bank_account_type") BankAccountType bankAccountType; + /** Required. The currency of the bank account. */ + @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 @@ -45,11 +49,13 @@ public class UsBankAccountCreateParams extends ApiRequestParams { private UsBankAccountCreateParams( String accountNumber, BankAccountType bankAccountType, + String currency, Map extraParams, String fedwireRoutingNumber, String routingNumber) { this.accountNumber = accountNumber; this.bankAccountType = bankAccountType; + this.currency = currency; this.extraParams = extraParams; this.fedwireRoutingNumber = fedwireRoutingNumber; this.routingNumber = routingNumber; @@ -64,6 +70,8 @@ public static class Builder { private BankAccountType bankAccountType; + private String currency; + private Map extraParams; private String fedwireRoutingNumber; @@ -75,6 +83,7 @@ public UsBankAccountCreateParams build() { return new UsBankAccountCreateParams( this.accountNumber, this.bankAccountType, + this.currency, this.extraParams, this.fedwireRoutingNumber, this.routingNumber); @@ -92,6 +101,12 @@ public Builder setBankAccountType(UsBankAccountCreateParams.BankAccountType bank return this; } + /** Required. The currency of the bank account. */ + 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 diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountListParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountListParams.java index 4be827660d7..66e16693045 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountListParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountListParams.java @@ -22,6 +22,10 @@ public class FinancialAccountListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Additional fields to include in the response. */ + @SerializedName("include") + List include; + /** The page limit. */ @SerializedName("limit") Long limit; @@ -42,10 +46,12 @@ public class FinancialAccountListParams extends ApiRequestParams { private FinancialAccountListParams( Map extraParams, + List include, Long limit, Status status, List types) { this.extraParams = extraParams; + this.include = include; this.limit = limit; this.status = status; this.types = types; @@ -58,6 +64,8 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private List include; + private Long limit; private Status status; @@ -66,7 +74,8 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public FinancialAccountListParams build() { - return new FinancialAccountListParams(this.extraParams, this.limit, this.status, this.types); + return new FinancialAccountListParams( + this.extraParams, this.include, this.limit, this.status, this.types); } /** @@ -95,6 +104,32 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancialAccountListParams#include} for the field documentation. + */ + public Builder addInclude(FinancialAccountListParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * FinancialAccountListParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + /** The page limit. */ public Builder setLimit(Long limit) { this.limit = limit; @@ -137,6 +172,18 @@ public Builder addAllType(List elements) { } } + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("payments.balance_by_funds_type") + PAYMENTS__BALANCE_BY_FUNDS_TYPE("payments.balance_by_funds_type"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } + public enum Status implements ApiRequestParams.EnumParam { @SerializedName("closed") CLOSED("closed"), diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountRetrieveParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountRetrieveParams.java new file mode 100644 index 00000000000..2fa4a2b63a0 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountRetrieveParams.java @@ -0,0 +1,113 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.moneymanagement; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class FinancialAccountRetrieveParams extends ApiRequestParams { + /** + * 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 to include in the response. */ + @SerializedName("include") + List include; + + private FinancialAccountRetrieveParams( + Map extraParams, List include) { + this.extraParams = extraParams; + this.include = include; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List include; + + /** Finalize and obtain parameter instance from this builder. */ + public FinancialAccountRetrieveParams build() { + return new FinancialAccountRetrieveParams(this.extraParams, this.include); + } + + /** + * 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 + * FinancialAccountRetrieveParams#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 FinancialAccountRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancialAccountRetrieveParams#include} for the field documentation. + */ + public Builder addInclude(FinancialAccountRetrieveParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * FinancialAccountRetrieveParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("payments.balance_by_funds_type") + PAYMENTS__BALANCE_BY_FUNDS_TYPE("payments.balance_by_funds_type"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java index f18ec62fcb8..6fe4644f9ad 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java @@ -66,6 +66,13 @@ public class OutboundPaymentCreateParams extends ApiRequestParams { @SerializedName("recipient_verification") String recipientVerification; + /** + * The description that appears on the receiving end for an OutboundPayment (for example, on a + * bank statement). Must be between 3 and 22 characters long, and not contain profanity. + */ + @SerializedName("statement_descriptor") + String statementDescriptor; + /** Required. To which payout method to send the OutboundPayment. */ @SerializedName("to") To to; @@ -81,6 +88,7 @@ private OutboundPaymentCreateParams( Purpose purpose, RecipientNotification recipientNotification, String recipientVerification, + String statementDescriptor, To to) { this.amount = amount; this.deliveryOptions = deliveryOptions; @@ -92,6 +100,7 @@ private OutboundPaymentCreateParams( this.purpose = purpose; this.recipientNotification = recipientNotification; this.recipientVerification = recipientVerification; + this.statementDescriptor = statementDescriptor; this.to = to; } @@ -120,6 +129,8 @@ public static class Builder { private String recipientVerification; + private String statementDescriptor; + private To to; /** Finalize and obtain parameter instance from this builder. */ @@ -135,6 +146,7 @@ public OutboundPaymentCreateParams build() { this.purpose, this.recipientNotification, this.recipientVerification, + this.statementDescriptor, this.to); } @@ -251,6 +263,15 @@ public Builder setRecipientVerification(String recipientVerification) { return this; } + /** + * The description that appears on the receiving end for an OutboundPayment (for example, on a + * bank statement). Must be between 3 and 22 characters long, and not contain profanity. + */ + public Builder setStatementDescriptor(String statementDescriptor) { + this.statementDescriptor = statementDescriptor; + return this; + } + /** Required. To which payout method to send the OutboundPayment. */ public Builder setTo(OutboundPaymentCreateParams.To to) { this.to = to; diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java index a26592fb16e..8f7a6c6b4b6 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java @@ -265,6 +265,10 @@ public static class BankAccount { @SerializedName("country") String country; + /** Required. The currency of the bank account. */ + @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. @@ -287,6 +291,7 @@ private BankAccount( BankAccountType bankAccountType, String branchNumber, String country, + String currency, Map extraParams, String routingNumber, String swiftCode) { @@ -294,6 +299,7 @@ private BankAccount( this.bankAccountType = bankAccountType; this.branchNumber = branchNumber; this.country = country; + this.currency = currency; this.extraParams = extraParams; this.routingNumber = routingNumber; this.swiftCode = swiftCode; @@ -312,6 +318,8 @@ public static class Builder { private String country; + private String currency; + private Map extraParams; private String routingNumber; @@ -325,6 +333,7 @@ public OutboundSetupIntentCreateParams.PayoutMethodData.BankAccount build() { this.bankAccountType, this.branchNumber, this.country, + this.currency, this.extraParams, this.routingNumber, this.swiftCode); @@ -356,6 +365,12 @@ public Builder setCountry(String country) { return this; } + /** Required. The currency of the bank account. */ + 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 @@ -416,6 +431,10 @@ public enum BankAccountType implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Card { + /** Required. The currency of the card. */ + @SerializedName("currency") + String currency; + /** Required. The expiration month of the card. */ @SerializedName("exp_month") String expMonth; @@ -438,7 +457,12 @@ public static class Card { String number; private Card( - String expMonth, String expYear, Map extraParams, String number) { + String currency, + String expMonth, + String expYear, + Map extraParams, + String number) { + this.currency = currency; this.expMonth = expMonth; this.expYear = expYear; this.extraParams = extraParams; @@ -450,6 +474,8 @@ public static Builder builder() { } public static class Builder { + private String currency; + private String expMonth; private String expYear; @@ -461,7 +487,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public OutboundSetupIntentCreateParams.PayoutMethodData.Card build() { return new OutboundSetupIntentCreateParams.PayoutMethodData.Card( - this.expMonth, this.expYear, this.extraParams, this.number); + this.currency, this.expMonth, this.expYear, this.extraParams, this.number); + } + + /** Required. The currency of the card. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; } /** Required. The expiration month of the card. */ diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java index d40727bc9b0..6b0199fbf5d 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java @@ -226,6 +226,10 @@ public static class BankAccount { @SerializedName("country") Object country; + /** Required. The currency of the bank account. */ + @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. @@ -248,6 +252,7 @@ private BankAccount( BankAccountType bankAccountType, Object branchNumber, Object country, + Object currency, Map extraParams, Object routingNumber, Object swiftCode) { @@ -255,6 +260,7 @@ private BankAccount( this.bankAccountType = bankAccountType; this.branchNumber = branchNumber; this.country = country; + this.currency = currency; this.extraParams = extraParams; this.routingNumber = routingNumber; this.swiftCode = swiftCode; @@ -273,6 +279,8 @@ public static class Builder { private Object country; + private Object currency; + private Map extraParams; private Object routingNumber; @@ -286,6 +294,7 @@ public OutboundSetupIntentUpdateParams.PayoutMethodData.BankAccount build() { this.bankAccountType, this.branchNumber, this.country, + this.currency, this.extraParams, this.routingNumber, this.swiftCode); @@ -335,6 +344,18 @@ public Builder setCountry(EmptyParam country) { return this; } + /** Required. The currency of the bank account. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** Required. The currency of the bank account. */ + 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 @@ -407,6 +428,10 @@ public enum BankAccountType implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Card { + /** The currency of the card. */ + @SerializedName("currency") + Object currency; + /** The expiration month of the card. */ @SerializedName("exp_month") Object expMonth; @@ -432,7 +457,12 @@ public static class Card { Object number; private Card( - Object expMonth, Object expYear, Map extraParams, Object number) { + Object currency, + Object expMonth, + Object expYear, + Map extraParams, + Object number) { + this.currency = currency; this.expMonth = expMonth; this.expYear = expYear; this.extraParams = extraParams; @@ -444,6 +474,8 @@ public static Builder builder() { } public static class Builder { + private Object currency; + private Object expMonth; private Object expYear; @@ -455,7 +487,19 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public OutboundSetupIntentUpdateParams.PayoutMethodData.Card build() { return new OutboundSetupIntentUpdateParams.PayoutMethodData.Card( - this.expMonth, this.expYear, this.extraParams, this.number); + this.currency, this.expMonth, this.expYear, this.extraParams, this.number); + } + + /** The currency of the card. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** The currency of the card. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + return this; } /** The expiration month of the card. */ diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java index b738831fc9b..3002be4543b 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java @@ -51,6 +51,13 @@ public class OutboundTransferCreateParams extends ApiRequestParams { @SerializedName("recipient_verification") String recipientVerification; + /** + * The description that appears on the receiving end for an OutboundTransfer (for example, on a + * bank statement). Must be between 3 and 22 characters long, and not contain profanity. + */ + @SerializedName("statement_descriptor") + String statementDescriptor; + /** Required. To which payout method to send the OutboundTransfer. */ @SerializedName("to") To to; @@ -63,6 +70,7 @@ private OutboundTransferCreateParams( From from, Map metadata, String recipientVerification, + String statementDescriptor, To to) { this.amount = amount; this.deliveryOptions = deliveryOptions; @@ -71,6 +79,7 @@ private OutboundTransferCreateParams( this.from = from; this.metadata = metadata; this.recipientVerification = recipientVerification; + this.statementDescriptor = statementDescriptor; this.to = to; } @@ -93,6 +102,8 @@ public static class Builder { private String recipientVerification; + private String statementDescriptor; + private To to; /** Finalize and obtain parameter instance from this builder. */ @@ -105,6 +116,7 @@ public OutboundTransferCreateParams build() { this.from, this.metadata, this.recipientVerification, + this.statementDescriptor, this.to); } @@ -196,6 +208,15 @@ public Builder setRecipientVerification(String recipientVerification) { return this; } + /** + * The description that appears on the receiving end for an OutboundTransfer (for example, on a + * bank statement). Must be between 3 and 22 characters long, and not contain profanity. + */ + public Builder setStatementDescriptor(String statementDescriptor) { + this.statementDescriptor = statementDescriptor; + return this; + } + /** Required. To which payout method to send the OutboundTransfer. */ public Builder setTo(OutboundTransferCreateParams.To to) { this.to = to; diff --git a/src/main/java/com/stripe/service/v2/BillingService.java b/src/main/java/com/stripe/service/v2/BillingService.java index ab9f1dbf960..415e10e9c96 100644 --- a/src/main/java/com/stripe/service/v2/BillingService.java +++ b/src/main/java/com/stripe/service/v2/BillingService.java @@ -29,11 +29,6 @@ public com.stripe.service.v2.billing.IntentService intents() { return new com.stripe.service.v2.billing.IntentService(this.getResponseGetter()); } - public com.stripe.service.v2.billing.LicenseFeeSubscriptionService licenseFeeSubscriptions() { - return new com.stripe.service.v2.billing.LicenseFeeSubscriptionService( - this.getResponseGetter()); - } - public com.stripe.service.v2.billing.LicenseFeeService licenseFees() { return new com.stripe.service.v2.billing.LicenseFeeService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/v2/CoreService.java b/src/main/java/com/stripe/service/v2/CoreService.java index 12aa1f729ac..c9b3483b610 100644 --- a/src/main/java/com/stripe/service/v2/CoreService.java +++ b/src/main/java/com/stripe/service/v2/CoreService.java @@ -9,6 +9,10 @@ public CoreService(StripeResponseGetter responseGetter) { super(responseGetter); } + public com.stripe.service.v2.core.AccountEvaluationService accountEvaluations() { + return new com.stripe.service.v2.core.AccountEvaluationService(this.getResponseGetter()); + } + public com.stripe.service.v2.core.AccountLinkService accountLinks() { return new com.stripe.service.v2.core.AccountLinkService(this.getResponseGetter()); } @@ -21,6 +25,10 @@ public com.stripe.service.v2.core.AccountService accounts() { return new com.stripe.service.v2.core.AccountService(this.getResponseGetter()); } + public com.stripe.service.v2.core.BatchJobService batchJobs() { + return new com.stripe.service.v2.core.BatchJobService(this.getResponseGetter()); + } + public com.stripe.service.v2.core.ClaimableSandboxService claimableSandboxes() { return new com.stripe.service.v2.core.ClaimableSandboxService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/v2/billing/IntentService.java b/src/main/java/com/stripe/service/v2/billing/IntentService.java index c5a24a174dc..1f023ff54c8 100644 --- a/src/main/java/com/stripe/service/v2/billing/IntentService.java +++ b/src/main/java/com/stripe/service/v2/billing/IntentService.java @@ -15,6 +15,7 @@ import com.stripe.param.v2.billing.IntentCommitParams; import com.stripe.param.v2.billing.IntentCreateParams; import com.stripe.param.v2.billing.IntentListParams; +import com.stripe.param.v2.billing.IntentReserveParams; public final class IntentService extends ApiService { public IntentService(StripeResponseGetter responseGetter) { @@ -122,14 +123,28 @@ public Intent releaseReservation(String id, RequestOptions options) throws Strip return this.request(request, Intent.class); } /** Reserve a Billing Intent. */ - public Intent reserve(String id) throws StripeException { - return reserve(id, (RequestOptions) null); + public Intent reserve(String id, IntentReserveParams params) throws StripeException { + return reserve(id, params, (RequestOptions) null); } /** Reserve a Billing Intent. */ public Intent reserve(String id, RequestOptions options) throws StripeException { + return reserve(id, (IntentReserveParams) null, options); + } + /** Reserve a Billing Intent. */ + public Intent reserve(String id) throws StripeException { + return reserve(id, (IntentReserveParams) null, (RequestOptions) null); + } + /** Reserve a Billing Intent. */ + public Intent reserve(String id, IntentReserveParams params, RequestOptions options) + throws StripeException { String path = String.format("/v2/billing/intents/%s/reserve", ApiResource.urlEncodeId(id)); ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); return this.request(request, Intent.class); } diff --git a/src/main/java/com/stripe/service/v2/billing/LicenseFeeSubscriptionService.java b/src/main/java/com/stripe/service/v2/billing/LicenseFeeSubscriptionService.java deleted file mode 100644 index a31dc9e4366..00000000000 --- a/src/main/java/com/stripe/service/v2/billing/LicenseFeeSubscriptionService.java +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.service.v2.billing; - -import com.stripe.exception.StripeException; -import com.stripe.model.v2.billing.LicenseFeeSubscription; -import com.stripe.net.ApiRequest; -import com.stripe.net.ApiResource; -import com.stripe.net.ApiService; -import com.stripe.net.BaseAddress; -import com.stripe.net.RequestOptions; -import com.stripe.net.StripeResponseGetter; - -public final class LicenseFeeSubscriptionService extends ApiService { - public LicenseFeeSubscriptionService(StripeResponseGetter responseGetter) { - super(responseGetter); - } - - /** Retrieve a License Fee Subscription object. */ - public LicenseFeeSubscription retrieve(String id) throws StripeException { - return retrieve(id, (RequestOptions) null); - } - /** Retrieve a License Fee Subscription object. */ - public LicenseFeeSubscription retrieve(String id, RequestOptions options) throws StripeException { - String path = - String.format("/v2/billing/license_fee_subscriptions/%s", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); - return this.request(request, LicenseFeeSubscription.class); - } -} diff --git a/src/main/java/com/stripe/service/v2/billing/PricingPlanSubscriptionService.java b/src/main/java/com/stripe/service/v2/billing/PricingPlanSubscriptionService.java index 6cd752e267f..8e1366e3e83 100644 --- a/src/main/java/com/stripe/service/v2/billing/PricingPlanSubscriptionService.java +++ b/src/main/java/com/stripe/service/v2/billing/PricingPlanSubscriptionService.java @@ -13,6 +13,8 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.v2.billing.PricingPlanSubscriptionListParams; +import com.stripe.param.v2.billing.PricingPlanSubscriptionRemoveDiscountsParams; +import com.stripe.param.v2.billing.PricingPlanSubscriptionRetrieveParams; import com.stripe.param.v2.billing.PricingPlanSubscriptionUpdateParams; public final class PricingPlanSubscriptionService extends ApiService { @@ -49,16 +51,32 @@ public StripeCollection list( request, new TypeToken>() {}.getType()); } /** Retrieve a Pricing Plan Subscription object. */ - public PricingPlanSubscription retrieve(String id) throws StripeException { - return retrieve(id, (RequestOptions) null); + public PricingPlanSubscription retrieve(String id, PricingPlanSubscriptionRetrieveParams params) + throws StripeException { + return retrieve(id, params, (RequestOptions) null); } /** Retrieve a Pricing Plan Subscription object. */ public PricingPlanSubscription retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (PricingPlanSubscriptionRetrieveParams) null, options); + } + /** Retrieve a Pricing Plan Subscription object. */ + public PricingPlanSubscription retrieve(String id) throws StripeException { + return retrieve(id, (PricingPlanSubscriptionRetrieveParams) null, (RequestOptions) null); + } + /** Retrieve a Pricing Plan Subscription object. */ + public PricingPlanSubscription retrieve( + String id, PricingPlanSubscriptionRetrieveParams params, RequestOptions options) + throws StripeException { String path = String.format("/v2/billing/pricing_plan_subscriptions/%s", ApiResource.urlEncodeId(id)); ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); return this.request(request, PricingPlanSubscription.class); } /** Update a Pricing Plan Subscription object. */ @@ -89,9 +107,36 @@ public PricingPlanSubscription update( options); return this.request(request, PricingPlanSubscription.class); } - - public com.stripe.service.v2.billing.pricingplansubscriptions.ComponentService components() { - return new com.stripe.service.v2.billing.pricingplansubscriptions.ComponentService( - this.getResponseGetter()); + /** Remove Discounts from a Pricing Plan Subscription. */ + public PricingPlanSubscription removeDiscounts( + String id, PricingPlanSubscriptionRemoveDiscountsParams params) throws StripeException { + return removeDiscounts(id, params, (RequestOptions) null); + } + /** Remove Discounts from a Pricing Plan Subscription. */ + public PricingPlanSubscription removeDiscounts(String id, RequestOptions options) + throws StripeException { + return removeDiscounts(id, (PricingPlanSubscriptionRemoveDiscountsParams) null, options); + } + /** Remove Discounts from a Pricing Plan Subscription. */ + public PricingPlanSubscription removeDiscounts(String id) throws StripeException { + return removeDiscounts( + id, (PricingPlanSubscriptionRemoveDiscountsParams) null, (RequestOptions) null); + } + /** Remove Discounts from a Pricing Plan Subscription. */ + public PricingPlanSubscription removeDiscounts( + String id, PricingPlanSubscriptionRemoveDiscountsParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v2/billing/pricing_plan_subscriptions/%s/remove_discounts", + ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PricingPlanSubscription.class); } } diff --git a/src/main/java/com/stripe/service/v2/billing/RateCardService.java b/src/main/java/com/stripe/service/v2/billing/RateCardService.java index 13da3ce7fb6..e56d818dc58 100644 --- a/src/main/java/com/stripe/service/v2/billing/RateCardService.java +++ b/src/main/java/com/stripe/service/v2/billing/RateCardService.java @@ -5,6 +5,7 @@ import com.stripe.exception.StripeException; import com.stripe.model.v2.StripeCollection; import com.stripe.model.v2.billing.RateCard; +import com.stripe.model.v2.billing.RateCardVersion; import com.stripe.net.ApiRequest; import com.stripe.net.ApiRequestParams; import com.stripe.net.ApiResource; @@ -14,6 +15,7 @@ import com.stripe.net.StripeResponseGetter; import com.stripe.param.v2.billing.RateCardCreateParams; import com.stripe.param.v2.billing.RateCardListParams; +import com.stripe.param.v2.billing.RateCardModifyRatesParams; import com.stripe.param.v2.billing.RateCardUpdateParams; public final class RateCardService extends ApiService { @@ -99,6 +101,25 @@ public RateCard update(String id, RateCardUpdateParams params, RequestOptions op options); return this.request(request, RateCard.class); } + /** Creates, updates, and/or deletes multiple Rates on a Rate Card atomically. */ + public RateCardVersion modifyRates(String id, RateCardModifyRatesParams params) + throws StripeException { + return modifyRates(id, params, (RequestOptions) null); + } + /** Creates, updates, and/or deletes multiple Rates on a Rate Card atomically. */ + public RateCardVersion modifyRates( + String id, RateCardModifyRatesParams params, RequestOptions options) throws StripeException { + String path = + String.format("/v2/billing/rate_cards/%s/modify_rates", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, RateCardVersion.class); + } public com.stripe.service.v2.billing.ratecards.CustomPricingUnitOverageRateService customPricingUnitOverageRates() { diff --git a/src/main/java/com/stripe/service/v2/billing/pricingplansubscriptions/ComponentService.java b/src/main/java/com/stripe/service/v2/billing/pricingplansubscriptions/ComponentService.java deleted file mode 100644 index 5275dc18ee0..00000000000 --- a/src/main/java/com/stripe/service/v2/billing/pricingplansubscriptions/ComponentService.java +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.service.v2.billing.pricingplansubscriptions; - -import com.stripe.exception.StripeException; -import com.stripe.model.v2.billing.PricingPlanSubscriptionComponents; -import com.stripe.net.ApiRequest; -import com.stripe.net.ApiResource; -import com.stripe.net.ApiService; -import com.stripe.net.BaseAddress; -import com.stripe.net.RequestOptions; -import com.stripe.net.StripeResponseGetter; - -public final class ComponentService extends ApiService { - public ComponentService(StripeResponseGetter responseGetter) { - super(responseGetter); - } - - /** Retrieve a Pricing Plan Subscription's components. */ - public PricingPlanSubscriptionComponents retrieve(String id) throws StripeException { - return retrieve(id, (RequestOptions) null); - } - /** Retrieve a Pricing Plan Subscription's components. */ - public PricingPlanSubscriptionComponents retrieve(String id, RequestOptions options) - throws StripeException { - String path = - String.format( - "/v2/billing/pricing_plan_subscriptions/%s/components", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); - return this.request(request, PricingPlanSubscriptionComponents.class); - } -} diff --git a/src/main/java/com/stripe/service/v2/billing/ratecards/RateService.java b/src/main/java/com/stripe/service/v2/billing/ratecards/RateService.java index f1b9cfcaeef..b89c10a866c 100644 --- a/src/main/java/com/stripe/service/v2/billing/ratecards/RateService.java +++ b/src/main/java/com/stripe/service/v2/billing/ratecards/RateService.java @@ -22,7 +22,7 @@ public RateService(StripeResponseGetter responseGetter) { } /** - * List all Rates associated with a Rate Card for a specific version (defaults to latest). Rates + * List all Rates associated with a Rate Card for a specific version. Defaults to latest. Rates * remain active for all subsequent versions until a new rate is created for the same Metered * Item. */ @@ -31,7 +31,7 @@ public StripeCollection list(String rateCardId, RateListParams par return list(rateCardId, params, (RequestOptions) null); } /** - * List all Rates associated with a Rate Card for a specific version (defaults to latest). Rates + * List all Rates associated with a Rate Card for a specific version. Defaults to latest. Rates * remain active for all subsequent versions until a new rate is created for the same Metered * Item. */ @@ -40,7 +40,7 @@ public StripeCollection list(String rateCardId, RequestOptions opt return list(rateCardId, (RateListParams) null, options); } /** - * List all Rates associated with a Rate Card for a specific version (defaults to latest). Rates + * List all Rates associated with a Rate Card for a specific version. Defaults to latest. Rates * remain active for all subsequent versions until a new rate is created for the same Metered * Item. */ @@ -48,7 +48,7 @@ public StripeCollection list(String rateCardId) throws StripeExcep return list(rateCardId, (RateListParams) null, (RequestOptions) null); } /** - * List all Rates associated with a Rate Card for a specific version (defaults to latest). Rates + * List all Rates associated with a Rate Card for a specific version. Defaults to latest. Rates * remain active for all subsequent versions until a new rate is created for the same Metered * Item. */ diff --git a/src/main/java/com/stripe/service/v2/core/AccountEvaluationService.java b/src/main/java/com/stripe/service/v2/core/AccountEvaluationService.java new file mode 100644 index 00000000000..b01a4e244e7 --- /dev/null +++ b/src/main/java/com/stripe/service/v2/core/AccountEvaluationService.java @@ -0,0 +1,41 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.core; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.AccountEvaluation; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.ApiService; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.v2.core.AccountEvaluationCreateParams; + +public final class AccountEvaluationService extends ApiService { + public AccountEvaluationService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** + * Creates a new account evaluation to trigger signal evaluations on an account or account data. + */ + public AccountEvaluation create(AccountEvaluationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** + * Creates a new account evaluation to trigger signal evaluations on an account or account data. + */ + public AccountEvaluation create(AccountEvaluationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v2/core/account_evaluations"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, AccountEvaluation.class); + } +} diff --git a/src/main/java/com/stripe/service/v2/core/BatchJobService.java b/src/main/java/com/stripe/service/v2/core/BatchJobService.java new file mode 100644 index 00000000000..49f56c52677 --- /dev/null +++ b/src/main/java/com/stripe/service/v2/core/BatchJobService.java @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.core; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.ApiService; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.v2.core.BatchJobCreateParams; + +public final class BatchJobService extends ApiService { + public BatchJobService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Creates a new batch job. */ + public BatchJob create(BatchJobCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** Creates a new batch job. */ + public BatchJob create(BatchJobCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v2/core/batch_jobs"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, BatchJob.class); + } + /** Retrieves an existing batch job. */ + public BatchJob retrieve(String id) throws StripeException { + return retrieve(id, (RequestOptions) null); + } + /** Retrieves an existing batch job. */ + public BatchJob retrieve(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/core/batch_jobs/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + return this.request(request, BatchJob.class); + } + /** Cancels an existing batch job. */ + public BatchJob cancel(String id) throws StripeException { + return cancel(id, (RequestOptions) null); + } + /** Cancels an existing batch job. */ + public BatchJob cancel(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/core/batch_jobs/%s/cancel", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); + return this.request(request, BatchJob.class); + } +} diff --git a/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java b/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java index c5a8104c4d8..a7b9fd6f4df 100644 --- a/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java +++ b/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java @@ -18,6 +18,7 @@ import com.stripe.param.v2.moneymanagement.FinancialAccountCloseParams; import com.stripe.param.v2.moneymanagement.FinancialAccountCreateParams; import com.stripe.param.v2.moneymanagement.FinancialAccountListParams; +import com.stripe.param.v2.moneymanagement.FinancialAccountRetrieveParams; import com.stripe.param.v2.moneymanagement.FinancialAccountUpdateParams; public final class FinancialAccountService extends ApiService { @@ -70,15 +71,31 @@ public FinancialAccount create(FinancialAccountCreateParams params, RequestOptio return this.request(request, FinancialAccount.class); } /** Retrieves the details of an existing FinancialAccount. */ - public FinancialAccount retrieve(String id) throws StripeException { - return retrieve(id, (RequestOptions) null); + public FinancialAccount retrieve(String id, FinancialAccountRetrieveParams params) + throws StripeException { + return retrieve(id, params, (RequestOptions) null); } /** Retrieves the details of an existing FinancialAccount. */ public FinancialAccount retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (FinancialAccountRetrieveParams) null, options); + } + /** Retrieves the details of an existing FinancialAccount. */ + public FinancialAccount retrieve(String id) throws StripeException { + return retrieve(id, (FinancialAccountRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves the details of an existing FinancialAccount. */ + public FinancialAccount retrieve( + String id, FinancialAccountRetrieveParams params, RequestOptions options) + throws StripeException { String path = String.format("/v2/money_management/financial_accounts/%s", ApiResource.urlEncodeId(id)); ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); return this.request(request, FinancialAccount.class); } /** Updates an existing FinancialAccount. */ diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index a2f052be3bb..20b115c3d5b 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -25056,7 +25056,7 @@ public void testV2BillingIntentGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.billing.Intent>>() {}.getType(), - "{\"data\":[{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.IntentListParams params = @@ -25082,7 +25082,7 @@ public void testV2BillingIntentPostServices() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.IntentCreateParams params = @@ -25095,13 +25095,23 @@ public void testV2BillingIntentPostServices() throws StripeException { .setEffectiveAt( com.stripe.param.v2.billing.IntentCreateParams.Action.Apply .EffectiveAt.builder() + .setTimestamp(Instant.parse("1970-01-01T15:18:46.294Z")) .setType( com.stripe.param.v2.billing.IntentCreateParams.Action.Apply .EffectiveAt.Type.CURRENT_BILLING_PERIOD_END) .build()) .setType( com.stripe.param.v2.billing.IntentCreateParams.Action.Apply.Type - .INVOICE_DISCOUNT_RULE) + .DISCOUNT) + .setDiscount( + com.stripe.param.v2.billing.IntentCreateParams.Action.Apply.Discount + .builder() + .setCoupon("coupon") + .setPromotionCode("promotion_code") + .setType( + com.stripe.param.v2.billing.IntentCreateParams.Action.Apply + .Discount.Type.COUPON) + .build()) .setInvoiceDiscountRule( com.stripe.param.v2.billing.IntentCreateParams.Action.Apply .InvoiceDiscountRule.builder() @@ -25415,7 +25425,7 @@ public void testV2BillingIntentGet2Services() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.Intent intent = client.v2().billing().intents().retrieve("id_123"); @@ -25433,7 +25443,7 @@ public void testV2BillingIntentPost2Services() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.Intent intent = client.v2().billing().intents().cancel("id_123"); @@ -25455,7 +25465,7 @@ public void testV2BillingIntentPost3Services() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.IntentCommitParams params = @@ -25481,7 +25491,7 @@ public void testV2BillingIntentPost4Services() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.Intent intent = @@ -25504,16 +25514,20 @@ public void testV2BillingIntentPost5Services() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); - com.stripe.model.v2.billing.Intent intent = client.v2().billing().intents().reserve("id_123"); + com.stripe.param.v2.billing.IntentReserveParams params = + com.stripe.param.v2.billing.IntentReserveParams.builder().build(); + + com.stripe.model.v2.billing.Intent intent = + client.v2().billing().intents().reserve("id_123", params); assertNotNull(intent); verifyRequest( BaseAddress.API, ApiResource.RequestMethod.POST, "/v2/billing/intents/id_123/reserve", - null, + params.toMap(), null); } @@ -25579,7 +25593,7 @@ public void testV2BillingLicenseFeeGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.billing.LicenseFee>>() {}.getType(), - "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.LicenseFeeListParams params = @@ -25607,7 +25621,7 @@ public void testV2BillingLicenseFeePostServices() throws StripeException { null, null, com.stripe.model.v2.billing.LicenseFee.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.LicenseFeeCreateParams params = @@ -25642,7 +25656,7 @@ public void testV2BillingLicenseFeeGet2Services() throws StripeException { null, null, com.stripe.model.v2.billing.LicenseFee.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.LicenseFee licenseFee = @@ -25665,7 +25679,7 @@ public void testV2BillingLicenseFeePost2Services() throws StripeException { null, null, com.stripe.model.v2.billing.LicenseFee.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.LicenseFeeUpdateParams params = @@ -25734,29 +25748,6 @@ public void testV2BillingLicenseFeesVersionGet2Services() throws StripeException null); } - @Test - public void testV2BillingLicenseFeeSubscriptionGetServices() throws StripeException { - stubRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/billing/license_fee_subscriptions/id_123", - null, - null, - com.stripe.model.v2.billing.LicenseFeeSubscription.class, - "{\"billing_cadence\":\"billing_cadence\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"license_fee\":\"license_fee\",\"license_fee_version\":\"license_fee_version\",\"object\":\"v2.billing.license_fee_subscription\",\"quantity\":1285004149,\"livemode\":true}"); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.model.v2.billing.LicenseFeeSubscription licenseFeeSubscription = - client.v2().billing().licenseFeeSubscriptions().retrieve("id_123"); - assertNotNull(licenseFeeSubscription); - verifyRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/billing/license_fee_subscriptions/id_123", - null, - null); - } - @Test public void testV2BillingLicensedItemGetServices() throws StripeException { stubRequest( @@ -26201,7 +26192,7 @@ public void testV2BillingPricingPlanGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.billing.PricingPlan>>() {}.getType(), - "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.PricingPlanListParams params = @@ -26227,7 +26218,7 @@ public void testV2BillingPricingPlanPostServices() throws StripeException { null, null, com.stripe.model.v2.billing.PricingPlan.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.PricingPlanCreateParams params = @@ -26258,7 +26249,7 @@ public void testV2BillingPricingPlanGet2Services() throws StripeException { null, null, com.stripe.model.v2.billing.PricingPlan.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.PricingPlan pricingPlan = @@ -26281,7 +26272,7 @@ public void testV2BillingPricingPlanPost2Services() throws StripeException { null, null, com.stripe.model.v2.billing.PricingPlan.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.PricingPlanUpdateParams params = @@ -26525,14 +26516,17 @@ public void testV2BillingPricingPlanSubscriptionGet2Services() throws StripeExce "{\"billing_cadence\":\"billing_cadence\",\"collection_status\":\"past_due\",\"collection_status_transitions\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan_subscription\",\"pricing_plan\":\"pricing_plan\",\"pricing_plan_version\":\"pricing_plan_version\",\"servicing_status\":\"pending\",\"servicing_status_transitions\":{},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); + com.stripe.param.v2.billing.PricingPlanSubscriptionRetrieveParams params = + com.stripe.param.v2.billing.PricingPlanSubscriptionRetrieveParams.builder().build(); + com.stripe.model.v2.billing.PricingPlanSubscription pricingPlanSubscription = - client.v2().billing().pricingPlanSubscriptions().retrieve("id_123"); + client.v2().billing().pricingPlanSubscriptions().retrieve("id_123", params); assertNotNull(pricingPlanSubscription); verifyRequest( BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/billing/pricing_plan_subscriptions/id_123", - null, + params.toMap(), null); } @@ -26563,26 +26557,28 @@ public void testV2BillingPricingPlanSubscriptionPostServices() throws StripeExce } @Test - public void testV2BillingPricingPlanSubscriptionsComponentGetServices() throws StripeException { + public void testV2BillingPricingPlanSubscriptionPost2Services() throws StripeException { stubRequest( BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/billing/pricing_plan_subscriptions/id_123/components", + ApiResource.RequestMethod.POST, + "/v2/billing/pricing_plan_subscriptions/id_123/remove_discounts", null, null, - com.stripe.model.v2.billing.PricingPlanSubscriptionComponents.class, - "{\"components\":[{\"pricing_plan_component\":\"pricing_plan_component\",\"type\":\"license_fee_subscription\"}],\"object\":\"v2.billing.pricing_plan_subscription_components\",\"livemode\":true}"); + com.stripe.model.v2.billing.PricingPlanSubscription.class, + "{\"billing_cadence\":\"billing_cadence\",\"collection_status\":\"past_due\",\"collection_status_transitions\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan_subscription\",\"pricing_plan\":\"pricing_plan\",\"pricing_plan_version\":\"pricing_plan_version\",\"servicing_status\":\"pending\",\"servicing_status_transitions\":{},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); - com.stripe.model.v2.billing.PricingPlanSubscriptionComponents - pricingPlanSubscriptionComponents = - client.v2().billing().pricingPlanSubscriptions().components().retrieve("id_123"); - assertNotNull(pricingPlanSubscriptionComponents); + com.stripe.param.v2.billing.PricingPlanSubscriptionRemoveDiscountsParams params = + com.stripe.param.v2.billing.PricingPlanSubscriptionRemoveDiscountsParams.builder().build(); + + com.stripe.model.v2.billing.PricingPlanSubscription pricingPlanSubscription = + client.v2().billing().pricingPlanSubscriptions().removeDiscounts("id_123", params); + assertNotNull(pricingPlanSubscription); verifyRequest( BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/billing/pricing_plan_subscriptions/id_123/components", - null, + ApiResource.RequestMethod.POST, + "/v2/billing/pricing_plan_subscriptions/id_123/remove_discounts", + params.toMap(), null); } @@ -26695,7 +26691,7 @@ public void testV2BillingRateCardGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.billing.RateCard>>() {}.getType(), - "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.RateCardListParams params = @@ -26721,7 +26717,7 @@ public void testV2BillingRateCardPostServices() throws StripeException { null, null, com.stripe.model.v2.billing.RateCard.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.RateCardCreateParams params = @@ -26754,7 +26750,7 @@ public void testV2BillingRateCardGet2Services() throws StripeException { null, null, com.stripe.model.v2.billing.RateCard.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.RateCard rateCard = @@ -26777,7 +26773,7 @@ public void testV2BillingRateCardPost2Services() throws StripeException { null, null, com.stripe.model.v2.billing.RateCard.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.RateCardUpdateParams params = @@ -26794,6 +26790,78 @@ public void testV2BillingRateCardPost2Services() throws StripeException { null); } + @Test + public void testV2BillingRateCardPost3Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/rate_cards/id_123/modify_rates", + null, + null, + com.stripe.model.v2.billing.RateCardVersion.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.rate_card_version\",\"rate_card_id\":\"rate_card_id\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.RateCardModifyRatesParams params = + com.stripe.param.v2.billing.RateCardModifyRatesParams.builder() + .addRatesToCreate( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate.builder() + .putMetadata("key", "metadata") + .setMeteredItem("metered_item") + .setMeteredItemData( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .MeteredItemData.builder() + .setDisplayName("display_name") + .setLookupKey("lookup_key") + .setMeter("meter") + .addMeterSegmentCondition( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .MeteredItemData.MeterSegmentCondition.builder() + .setDimension("dimension") + .setValue("value") + .build()) + .setUnitLabel("unit_label") + .build()) + .setTieringMode( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .TieringMode.GRADUATED) + .addTier( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate.Tier + .builder() + .setFlatAmount("flat_amount") + .setUnitAmount("unit_amount") + .setUpToDecimal(new BigDecimal("1387931359.3333333")) + .setUpToInf( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .Tier.UpToInf.INF) + .build()) + .setTransformQuantity( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .TransformQuantity.builder() + .setDivideBy(1592560163L) + .setRound( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .TransformQuantity.Round.DOWN) + .build()) + .setUnitAmount("unit_amount") + .build()) + .addRatesToDelete( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToDelete.builder() + .setId("obj_123") + .build()) + .build(); + + com.stripe.model.v2.billing.RateCardVersion rateCardVersion = + client.v2().billing().rateCards().modifyRates("id_123", params); + assertNotNull(rateCardVersion); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/rate_cards/id_123/modify_rates", + params.toMap(), + null); + } + @Test public void testV2BillingRateCardsCustomPricingUnitOverageRateGetServices() throws StripeException { @@ -27588,6 +27656,35 @@ public void testV2CoreAccountsPersonTokenGetServices() throws StripeException { null); } + @Test + public void testV2CoreAccountEvaluationPostServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/account_evaluations", + null, + null, + com.stripe.model.v2.core.AccountEvaluation.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"evaluations_triggered\":[\"fraudulent_website\"],\"id\":\"obj_123\",\"object\":\"v2.core.account_evaluation\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.AccountEvaluationCreateParams params = + com.stripe.param.v2.core.AccountEvaluationCreateParams.builder() + .addSignal( + com.stripe.param.v2.core.AccountEvaluationCreateParams.Signal.FRAUDULENT_WEBSITE) + .build(); + + com.stripe.model.v2.core.AccountEvaluation accountEvaluation = + client.v2().core().accountEvaluations().create(params); + assertNotNull(accountEvaluation); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/account_evaluations", + params.toMap(), + null); + } + @Test public void testV2CoreAccountLinkPostServices() throws StripeException { stubRequest( @@ -27754,6 +27851,80 @@ public void testV2CoreAccountTokenGetServices() throws StripeException { null); } + @Test + public void testV2CoreBatchJobPostServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs", + null, + null, + com.stripe.model.v2.core.BatchJob.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"maximum_rps\":1686015830,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.core.batch_job\",\"skip_validation\":true,\"status\":\"batch_failed\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.BatchJobCreateParams params = + com.stripe.param.v2.core.BatchJobCreateParams.builder() + .setEndpoint( + com.stripe.param.v2.core.BatchJobCreateParams.Endpoint.builder() + .setHttpMethod( + com.stripe.param.v2.core.BatchJobCreateParams.Endpoint.HttpMethod.POST) + .setPath("path") + .build()) + .putMetadata("key", "metadata") + .setSkipValidation(true) + .build(); + + com.stripe.model.v2.core.BatchJob batchJob = client.v2().core().batchJobs().create(params); + assertNotNull(batchJob); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs", + params.toMap(), + null); + } + + @Test + public void testV2CoreBatchJobGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/batch_jobs/id_123", + null, + null, + com.stripe.model.v2.core.BatchJob.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"maximum_rps\":1686015830,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.core.batch_job\",\"skip_validation\":true,\"status\":\"batch_failed\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.core.BatchJob batchJob = client.v2().core().batchJobs().retrieve("id_123"); + assertNotNull(batchJob); + verifyRequest( + BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/batch_jobs/id_123", null, null); + } + + @Test + public void testV2CoreBatchJobPost2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs/id_123/cancel", + null, + null, + com.stripe.model.v2.core.BatchJob.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"maximum_rps\":1686015830,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.core.batch_job\",\"skip_validation\":true,\"status\":\"batch_failed\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.core.BatchJob batchJob = client.v2().core().batchJobs().cancel("id_123"); + assertNotNull(batchJob); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs/id_123/cancel", + null, + null); + } + @Test public void testV2CoreClaimableSandboxPostServices() throws StripeException { stubRequest( @@ -28124,7 +28295,7 @@ public void testV2CoreVaultGbBankAccountGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.core.vault.GbBankAccount>>() {}.getType(), - "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.GbBankAccountListParams params = @@ -28150,13 +28321,12 @@ public void testV2CoreVaultGbBankAccountPostServices() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.GbBankAccountCreateParams params = com.stripe.param.v2.core.vault.GbBankAccountCreateParams.builder() - .setAccountNumber("account_number") - .setSortCode("sort_code") + .setCurrency("usd") .build(); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -28179,7 +28349,7 @@ public void testV2CoreVaultGbBankAccountGet2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -28202,7 +28372,7 @@ public void testV2CoreVaultGbBankAccountPost2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -28225,7 +28395,7 @@ public void testV2CoreVaultGbBankAccountPost3Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -28248,7 +28418,7 @@ public void testV2CoreVaultGbBankAccountPost4Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.GbBankAccountInitiateConfirmationOfPayeeParams params = @@ -28277,7 +28447,7 @@ public void testV2CoreVaultUsBankAccountGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.core.vault.UsBankAccount>>() {}.getType(), - "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountListParams params = @@ -28303,12 +28473,13 @@ public void testV2CoreVaultUsBankAccountPostServices() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -28331,7 +28502,7 @@ public void testV2CoreVaultUsBankAccountGet2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -28354,7 +28525,7 @@ public void testV2CoreVaultUsBankAccountPost2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountUpdateParams params = @@ -28380,7 +28551,7 @@ public void testV2CoreVaultUsBankAccountPost3Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -28403,7 +28574,7 @@ public void testV2CoreVaultUsBankAccountPost4Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountConfirmMicrodepositsParams params = @@ -28429,7 +28600,7 @@ public void testV2CoreVaultUsBankAccountPost5Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -28787,14 +28958,17 @@ public void testV2MoneyManagementFinancialAccountGet2Services() throws StripeExc "{\"balance\":{\"available\":{\"key\":{\"currency\":\"USD\",\"value\":35}},\"inbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":11}},\"outbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":60}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"payments\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); + com.stripe.param.v2.moneymanagement.FinancialAccountRetrieveParams params = + com.stripe.param.v2.moneymanagement.FinancialAccountRetrieveParams.builder().build(); + com.stripe.model.v2.moneymanagement.FinancialAccount financialAccount = - client.v2().moneyManagement().financialAccounts().retrieve("id_123"); + client.v2().moneyManagement().financialAccounts().retrieve("id_123", params); assertNotNull(financialAccount); verifyRequest( BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/money_management/financial_accounts/id_123", - null, + params.toMap(), null); } @@ -29146,7 +29320,7 @@ public void testV2MoneyManagementOutboundPaymentQuotePostServices() throws Strip null, null, com.stripe.model.v2.moneymanagement.OutboundPaymentQuote.class, - "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"next_day_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundPaymentQuoteCreateParams params = @@ -29185,7 +29359,7 @@ public void testV2MoneyManagementOutboundPaymentQuoteGetServices() throws Stripe null, null, com.stripe.model.v2.moneymanagement.OutboundPaymentQuote.class, - "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"next_day_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundPaymentQuote outboundPaymentQuote = @@ -29210,7 +29384,7 @@ public void testV2MoneyManagementOutboundSetupIntentGetServices() throws StripeE new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.OutboundSetupIntent>>() {}.getType(), - "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundSetupIntentListParams params = @@ -29236,7 +29410,7 @@ public void testV2MoneyManagementOutboundSetupIntentPostServices() throws Stripe null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundSetupIntentCreateParams params = @@ -29262,7 +29436,7 @@ public void testV2MoneyManagementOutboundSetupIntentGet2Services() throws Stripe null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundSetupIntent outboundSetupIntent = @@ -29285,7 +29459,7 @@ public void testV2MoneyManagementOutboundSetupIntentPost2Services() throws Strip null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundSetupIntentUpdateParams params = @@ -29311,7 +29485,7 @@ public void testV2MoneyManagementOutboundSetupIntentPost3Services() throws Strip null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundSetupIntent outboundSetupIntent = @@ -29448,7 +29622,7 @@ public void testV2MoneyManagementPayoutMethodGetServices() throws StripeExceptio new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.PayoutMethod>>() {}.getType(), - "{\"data\":[{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.PayoutMethodListParams params = @@ -29474,7 +29648,7 @@ public void testV2MoneyManagementPayoutMethodGet2Services() throws StripeExcepti null, null, com.stripe.model.v2.moneymanagement.PayoutMethod.class, - "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); + "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.PayoutMethod payoutMethod = @@ -29497,7 +29671,7 @@ public void testV2MoneyManagementPayoutMethodPostServices() throws StripeExcepti null, null, com.stripe.model.v2.moneymanagement.PayoutMethod.class, - "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); + "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.PayoutMethod payoutMethod = @@ -29520,7 +29694,7 @@ public void testV2MoneyManagementPayoutMethodPost2Services() throws StripeExcept null, null, com.stripe.model.v2.moneymanagement.PayoutMethod.class, - "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); + "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.PayoutMethod payoutMethod = @@ -30649,6 +30823,7 @@ public void testBlockedByStripeErrorServices() throws StripeException { com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); try { @@ -30846,6 +31021,7 @@ public void testInvalidPaymentMethodErrorServices() throws StripeException { com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); try { @@ -30961,6 +31137,7 @@ public void testQuotaExceededErrorServices() throws StripeException { com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); try {