From 9163b7598ff3370778ff35bafdf338ff690021e1 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Tue, 23 Aug 2022 09:28:51 -0700 Subject: [PATCH 01/24] Add beta readme.md section (#1425) --- README.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 90d6a09a313..98b54203a93 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,6 @@ The official [Stripe][stripe] Java client library. -## Support - -New features and bug fixes are released on the latest major version of the Stripe Java client library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates. - ## Installation ### Requirements @@ -80,7 +76,7 @@ public class StripeExample { public static void main(String[] args) { Stripe.apiKey = "sk_test_..."; - + CustomerCreateParams params = CustomerCreateParams .builder() @@ -242,6 +238,26 @@ You can disable this behavior if you prefer: Stripe.enableTelemetry = false; ``` +### Beta SDKs + +Stripe has features in the beta phase that can be accessed via the beta version of this package. +We would love for you to try these and share feedback with us before these features reach the stable phase. +To install a beta version of stripe-java follow steps [installation steps above](#installation) using the beta library version. + +> Note: There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific version. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version. + +We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version. + +If your beta feature requires a `Stripe-Version` header to be sent, use the `Stripe.stripeVersion` field to set it: + +```java +Stripe.stripeVersion += "; feature_beta=v3"; +``` + +## Support + +New features and bug fixes are released on the latest major version of the Stripe Java client library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates. + ## Development JDK 18 is required to build the Stripe Java library. By default, tests use the same Java runtime as the build. From 9d7effe6664d0d1de6543e4302b4a2ffb6e17609 Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik <99290280+kamil-stripe@users.noreply.github.com> Date: Tue, 23 Aug 2022 14:03:12 -0700 Subject: [PATCH 02/24] Codegen for openapi v184 (#1422) --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Account.java | 437 +++---- .../java/com/stripe/model/AccountLink.java | 7 + .../java/com/stripe/model/ApplePayDomain.java | 104 +- src/main/java/com/stripe/model/Balance.java | 14 + .../com/stripe/model/BalanceTransaction.java | 7 + .../java/com/stripe/model/BankAccount.java | 11 + .../java/com/stripe/model/Capability.java | 6 + src/main/java/com/stripe/model/Card.java | 6 + .../java/com/stripe/model/CashBalance.java | 5 + src/main/java/com/stripe/model/Charge.java | 328 ++--- .../java/com/stripe/model/CountrySpec.java | 8 + src/main/java/com/stripe/model/Coupon.java | 150 +-- .../java/com/stripe/model/CreditNote.java | 54 +- src/main/java/com/stripe/model/Customer.java | 537 ++++---- .../model/CustomerBalanceTransaction.java | 12 + .../CustomerBalanceTransactionCollection.java | 100 +- .../model/CustomerCashBalanceTransaction.java | 259 ++++ ...tomerCashBalanceTransactionCollection.java | 104 ++ src/main/java/com/stripe/model/Discount.java | 9 + src/main/java/com/stripe/model/Dispute.java | 160 +-- src/main/java/com/stripe/model/Event.java | 28 + .../stripe/model/EventDataClassLookup.java | 1 + .../java/com/stripe/model/ExchangeRate.java | 11 + .../model/ExternalAccountCollection.java | 54 +- src/main/java/com/stripe/model/FeeRefund.java | 9 + src/main/java/com/stripe/model/FileLink.java | 105 +- .../com/stripe/model/FundingInstructions.java | 14 + src/main/java/com/stripe/model/Invoice.java | 805 ++++++------ .../java/com/stripe/model/InvoiceItem.java | 156 +-- .../com/stripe/model/InvoiceLineItem.java | 8 +- src/main/java/com/stripe/model/LineItem.java | 1 + src/main/java/com/stripe/model/Mandate.java | 3 + .../java/com/stripe/model/PaymentIntent.java | 1113 +++++++++-------- .../java/com/stripe/model/PaymentLink.java | 124 +- .../java/com/stripe/model/PaymentMethod.java | 366 +++--- .../stripe/model/PaymentSourceCollection.java | 116 +- src/main/java/com/stripe/model/Payout.java | 256 ++-- src/main/java/com/stripe/model/Person.java | 85 +- .../com/stripe/model/PersonCollection.java | 46 +- src/main/java/com/stripe/model/Plan.java | 117 +- src/main/java/com/stripe/model/Price.java | 149 ++- src/main/java/com/stripe/model/Product.java | 267 ++-- .../java/com/stripe/model/PromotionCode.java | 131 +- src/main/java/com/stripe/model/Quote.java | 366 +++--- src/main/java/com/stripe/model/Refund.java | 194 +-- src/main/java/com/stripe/model/Review.java | 86 +- .../java/com/stripe/model/SetupAttempt.java | 5 + .../java/com/stripe/model/SetupIntent.java | 405 +++--- .../java/com/stripe/model/ShippingRate.java | 57 +- src/main/java/com/stripe/model/Sku.java | 164 +-- src/main/java/com/stripe/model/Source.java | 130 +- .../model/SourceMandateNotification.java | 4 + .../com/stripe/model/SourceTransaction.java | 5 + .../com/stripe/model/StripeErrorResponse.java | 1 + .../java/com/stripe/model/Subscription.java | 435 ++++--- .../com/stripe/model/SubscriptionItem.java | 182 +-- .../stripe/model/SubscriptionSchedule.java | 321 ++--- src/main/java/com/stripe/model/TaxCode.java | 4 + src/main/java/com/stripe/model/TaxId.java | 8 + .../com/stripe/model/TaxIdCollection.java | 48 +- src/main/java/com/stripe/model/TaxRate.java | 57 +- src/main/java/com/stripe/model/Token.java | 84 +- src/main/java/com/stripe/model/Topup.java | 96 +- src/main/java/com/stripe/model/Transfer.java | 13 + .../com/stripe/model/TransferReversal.java | 16 + .../java/com/stripe/model/UsageRecord.java | 7 + .../com/stripe/model/WebhookEndpoint.java | 212 ++-- .../java/com/stripe/model/apps/Secret.java | 66 +- .../model/billingportal/Configuration.java | 107 +- .../stripe/model/billingportal/Session.java | 16 + .../com/stripe/model/checkout/Session.java | 208 +-- .../model/financialconnections/Account.java | 176 +-- .../AccountOwnership.java | 1 + .../model/financialconnections/Session.java | 4 + .../model/identity/VerificationReport.java | 75 +- .../model/identity/VerificationSession.java | 300 ++--- .../stripe/model/issuing/Authorization.java | 253 ++-- .../java/com/stripe/model/issuing/Card.java | 52 +- .../com/stripe/model/issuing/Cardholder.java | 59 +- .../com/stripe/model/issuing/Dispute.java | 159 +-- .../com/stripe/model/issuing/Transaction.java | 8 + .../stripe/model/radar/EarlyFraudWarning.java | 7 + .../com/stripe/model/radar/ValueList.java | 136 +- .../com/stripe/model/radar/ValueListItem.java | 137 +- .../com/stripe/model/reporting/ReportRun.java | 83 +- .../stripe/model/reporting/ReportType.java | 59 +- .../stripe/model/sigma/ScheduledQueryRun.java | 6 + .../stripe/model/terminal/Configuration.java | 55 +- .../model/terminal/ConnectionToken.java | 6 + .../com/stripe/model/terminal/Location.java | 162 +-- .../com/stripe/model/terminal/Reader.java | 226 ++-- .../stripe/model/testhelpers/TestClock.java | 139 +- .../stripe/model/treasury/CreditReversal.java | 57 +- .../stripe/model/treasury/DebitReversal.java | 55 +- .../model/treasury/FinancialAccount.java | 187 +-- .../treasury/FinancialAccountFeatures.java | 28 + .../model/treasury/InboundTransfer.java | 57 +- .../model/treasury/OutboundPayment.java | 152 +-- .../model/treasury/OutboundTransfer.java | 157 +-- .../stripe/model/treasury/ReceivedCredit.java | 5 + .../stripe/model/treasury/ReceivedDebit.java | 5 + .../stripe/model/treasury/Transaction.java | 53 +- .../model/treasury/TransactionEntry.java | 55 +- .../com/stripe/param/AccountCreateParams.java | 8 +- .../com/stripe/param/AccountUpdateParams.java | 11 +- ...alanceTransactionCollectionListParams.java | 170 +++ ...ceTransactionCollectionRetrieveParams.java | 102 ++ .../param/PaymentMethodCreateParams.java | 132 +- .../param/SetupIntentConfirmParams.java | 65 +- .../stripe/param/SetupIntentCreateParams.java | 65 +- .../stripe/param/SetupIntentUpdateParams.java | 65 +- .../param/SubscriptionCreateParams.java | 62 +- .../param/SubscriptionUpdateParams.java | 62 +- .../param/WebhookEndpointCreateParams.java | 3 + .../param/WebhookEndpointUpdateParams.java | 3 + .../stripe/functional/GeneratedExamples.java | 4 +- 117 files changed, 7564 insertions(+), 5684 deletions(-) create mode 100644 src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java create mode 100644 src/main/java/com/stripe/model/CustomerCashBalanceTransactionCollection.java create mode 100644 src/main/java/com/stripe/param/CustomerCashBalanceTransactionCollectionListParams.java create mode 100644 src/main/java/com/stripe/param/CustomerCashBalanceTransactionCollectionRetrieveParams.java diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index fe5aa3c0196..c13f8f95980 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v178 \ No newline at end of file +v184 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/Account.java b/src/main/java/com/stripe/model/Account.java index 467827e927e..f20124c79f0 100644 --- a/src/main/java/com/stripe/model/Account.java +++ b/src/main/java/com/stripe/model/Account.java @@ -19,6 +19,13 @@ import lombok.Getter; import lombok.Setter; +/** + * This is an object representing a Stripe account. You can retrieve it to see properties on the + * account like its current e-mail address or if the account is enabled yet to make live charges. + * + *

Some properties, marked below, are available only to platforms that want to create and manage Express or Custom accounts. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -146,176 +153,57 @@ public class Account extends ApiResource implements MetadataStore, Paym @SerializedName("type") String type; - /** Retrieves the details of an account. */ - public static Account retrieve() throws StripeException { - return retrieve((Map) null, (RequestOptions) null); - } - - /** Retrieves the details of an account. */ - public static Account retrieve(RequestOptions options) throws StripeException { - return retrieve((Map) null, options); - } - - /** Retrieves the details of an account. */ - public static Account retrieve(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account"); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options); - } - - /** Retrieves the details of an account. */ - public static Account retrieve(AccountRetrieveParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account"); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options); - } - - /** Retrieves the details of an account. */ - public static Account retrieve(String account) throws StripeException { - return retrieve(account, (Map) null, (RequestOptions) null); - } - - /** Retrieves the details of an account. */ - public static Account retrieve(String account, RequestOptions options) throws StripeException { - return retrieve(account, (Map) null, options); - } - - /** Retrieves the details of an account. */ - public static Account retrieve(String account, Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options); - } - - /** Retrieves the details of an account. */ - public static Account retrieve( - String account, AccountRetrieveParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options); - } - /** - * Updates a connected account by setting - * the values of the parameters passed. Any parameters not provided are left unchanged. Most - * parameters can be changed only for Custom accounts. (These are marked Custom - * Only below.) Parameters marked Custom and Express are not supported - * for Standard accounts. - * - *

To update your own account, use the Dashboard. Refer to our Connect documentation to learn - * more about updating accounts. - */ - @Override - public Account update(Map params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** - * Updates a connected account by setting - * the values of the parameters passed. Any parameters not provided are left unchanged. Most - * parameters can be changed only for Custom accounts. (These are marked Custom - * Only below.) Parameters marked Custom and Express are not supported - * for Standard accounts. - * - *

To update your own account, use the Dashboard. Refer to our Connect documentation to learn - * more about updating accounts. + * Returns a list of capabilities associated with the account. The capabilities are returned + * sorted by creation date, with the most recent capability appearing first. */ - @Override - public Account update(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options); + public CapabilityCollection capabilities() throws StripeException { + return capabilities((Map) null, (RequestOptions) null); } /** - * Updates a connected account by setting - * the values of the parameters passed. Any parameters not provided are left unchanged. Most - * parameters can be changed only for Custom accounts. (These are marked Custom - * Only below.) Parameters marked Custom and Express are not supported - * for Standard accounts. - * - *

To update your own account, use the Dashboard. Refer to our Connect documentation to learn - * more about updating accounts. + * Returns a list of capabilities associated with the account. The capabilities are returned + * sorted by creation date, with the most recent capability appearing first. */ - public Account update(AccountUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + public CapabilityCollection capabilities(Map params) throws StripeException { + return capabilities(params, (RequestOptions) null); } /** - * Updates a connected account by setting - * the values of the parameters passed. Any parameters not provided are left unchanged. Most - * parameters can be changed only for Custom accounts. (These are marked Custom - * Only below.) Parameters marked Custom and Express are not supported - * for Standard accounts. - * - *

To update your own account, use the Dashboard. Refer to our Connect documentation to learn - * more about updating accounts. + * Returns a list of capabilities associated with the account. The capabilities are returned + * sorted by creation date, with the most recent capability appearing first. */ - public Account update(AccountUpdateParams params, RequestOptions options) throws StripeException { + public CapabilityCollection capabilities(Map params, RequestOptions options) + throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options); - } - - /** - * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is - * empty. - */ - public static AccountCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); + String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.requestCollection(url, params, CapabilityCollection.class, options); } /** - * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is - * empty. + * Returns a list of capabilities associated with the account. The capabilities are returned + * sorted by creation date, with the most recent capability appearing first. */ - public static AccountCollection list(Map params, RequestOptions options) + public CapabilityCollection capabilities(AccountCapabilitiesParams params) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts"); - return ApiResource.requestCollection(url, params, AccountCollection.class, options); - } - - /** - * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is - * empty. - */ - public static AccountCollection list(AccountListParams params) throws StripeException { - return list(params, (RequestOptions) null); + return capabilities(params, (RequestOptions) null); } /** - * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is - * empty. + * Returns a list of capabilities associated with the account. The capabilities are returned + * sorted by creation date, with the most recent capability appearing first. */ - public static AccountCollection list(AccountListParams params, RequestOptions options) + public CapabilityCollection capabilities(AccountCapabilitiesParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts"); - return ApiResource.requestCollection(url, params, AccountCollection.class, options); + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.requestCollection(url, params, CapabilityCollection.class, options); } /** @@ -425,57 +313,43 @@ public Account delete(Map params, RequestOptions options) throws } /** - * With Connect, you may flag accounts as - * suspicious. - * - *

Test-mode Custom and Express accounts can be rejected at any time. Accounts created using - * live-mode keys may only be rejected once all balances are zero. + * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is + * empty. */ - public Account reject(Map params) throws StripeException { - return reject(params, (RequestOptions) null); + public static AccountCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); } /** - * With Connect, you may flag accounts as - * suspicious. - * - *

Test-mode Custom and Express accounts can be rejected at any time. Accounts created using - * live-mode keys may only be rejected once all balances are zero. + * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is + * empty. */ - public Account reject(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/accounts/%s/reject", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options); + public static AccountCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts"); + return ApiResource.requestCollection(url, params, AccountCollection.class, options); } /** - * With Connect, you may flag accounts as - * suspicious. - * - *

Test-mode Custom and Express accounts can be rejected at any time. Accounts created using - * live-mode keys may only be rejected once all balances are zero. + * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is + * empty. */ - public Account reject(AccountRejectParams params) throws StripeException { - return reject(params, (RequestOptions) null); + public static AccountCollection list(AccountListParams params) throws StripeException { + return list(params, (RequestOptions) null); } /** - * With Connect, you may flag accounts as - * suspicious. - * - *

Test-mode Custom and Express accounts can be rejected at any time. Accounts created using - * live-mode keys may only be rejected once all balances are zero. + * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is + * empty. */ - public Account reject(AccountRejectParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/accounts/%s/reject", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options); + public static AccountCollection list(AccountListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts"); + return ApiResource.requestCollection(url, params, AccountCollection.class, options); } /** @@ -531,56 +405,189 @@ public PersonCollection persons(AccountPersonsParams params, RequestOptions opti } /** - * Returns a list of capabilities associated with the account. The capabilities are returned - * sorted by creation date, with the most recent capability appearing first. + * With Connect, you may flag accounts as + * suspicious. + * + *

Test-mode Custom and Express accounts can be rejected at any time. Accounts created using + * live-mode keys may only be rejected once all balances are zero. */ - public CapabilityCollection capabilities() throws StripeException { - return capabilities((Map) null, (RequestOptions) null); + public Account reject(Map params) throws StripeException { + return reject(params, (RequestOptions) null); } /** - * Returns a list of capabilities associated with the account. The capabilities are returned - * sorted by creation date, with the most recent capability appearing first. + * With Connect, you may flag accounts as + * suspicious. + * + *

Test-mode Custom and Express accounts can be rejected at any time. Accounts created using + * live-mode keys may only be rejected once all balances are zero. */ - public CapabilityCollection capabilities(Map params) throws StripeException { - return capabilities(params, (RequestOptions) null); + public Account reject(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/accounts/%s/reject", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options); } /** - * Returns a list of capabilities associated with the account. The capabilities are returned - * sorted by creation date, with the most recent capability appearing first. + * With Connect, you may flag accounts as + * suspicious. + * + *

Test-mode Custom and Express accounts can be rejected at any time. Accounts created using + * live-mode keys may only be rejected once all balances are zero. */ - public CapabilityCollection capabilities(Map params, RequestOptions options) + public Account reject(AccountRejectParams params) throws StripeException { + return reject(params, (RequestOptions) null); + } + + /** + * With Connect, you may flag accounts as + * suspicious. + * + *

Test-mode Custom and Express accounts can be rejected at any time. Accounts created using + * live-mode keys may only be rejected once all balances are zero. + */ + public Account reject(AccountRejectParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/accounts/%s/reject", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options); + } + + /** Retrieves the details of an account. */ + public static Account retrieve() throws StripeException { + return retrieve((Map) null, (RequestOptions) null); + } + + /** Retrieves the details of an account. */ + public static Account retrieve(RequestOptions options) throws StripeException { + return retrieve((Map) null, options); + } + + /** Retrieves the details of an account. */ + public static Account retrieve(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account"); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options); + } + + /** Retrieves the details of an account. */ + public static Account retrieve(AccountRetrieveParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account"); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options); + } + + /** Retrieves the details of an account. */ + public static Account retrieve(String account) throws StripeException { + return retrieve(account, (Map) null, (RequestOptions) null); + } + + /** Retrieves the details of an account. */ + public static Account retrieve(String account, RequestOptions options) throws StripeException { + return retrieve(account, (Map) null, options); + } + + /** Retrieves the details of an account. */ + public static Account retrieve(String account, Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.requestCollection(url, params, CapabilityCollection.class, options); + String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options); + } + + /** Retrieves the details of an account. */ + public static Account retrieve( + String account, AccountRetrieveParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options); } /** - * Returns a list of capabilities associated with the account. The capabilities are returned - * sorted by creation date, with the most recent capability appearing first. + * Updates a connected account by setting + * the values of the parameters passed. Any parameters not provided are left unchanged. Most + * parameters can be changed only for Custom accounts. (These are marked Custom + * Only below.) Parameters marked Custom and Express are not supported + * for Standard accounts. + * + *

To update your own account, use the Dashboard. Refer to our Connect documentation to learn + * more about updating accounts. */ - public CapabilityCollection capabilities(AccountCapabilitiesParams params) - throws StripeException { - return capabilities(params, (RequestOptions) null); + @Override + public Account update(Map params) throws StripeException { + return update(params, (RequestOptions) null); } /** - * Returns a list of capabilities associated with the account. The capabilities are returned - * sorted by creation date, with the most recent capability appearing first. + * Updates a connected account by setting + * the values of the parameters passed. Any parameters not provided are left unchanged. Most + * parameters can be changed only for Custom accounts. (These are marked Custom + * Only below.) Parameters marked Custom and Express are not supported + * for Standard accounts. + * + *

To update your own account, use the Dashboard. Refer to our Connect documentation to learn + * more about updating accounts. */ - public CapabilityCollection capabilities(AccountCapabilitiesParams params, RequestOptions options) - throws StripeException { + @Override + public Account update(Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.requestCollection(url, params, CapabilityCollection.class, options); + String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options); + } + + /** + * Updates a connected account by setting + * the values of the parameters passed. Any parameters not provided are left unchanged. Most + * parameters can be changed only for Custom accounts. (These are marked Custom + * Only below.) Parameters marked Custom and Express are not supported + * for Standard accounts. + * + *

To update your own account, use the Dashboard. Refer to our Connect documentation to learn + * more about updating accounts. + */ + public Account update(AccountUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates a connected account by setting + * the values of the parameters passed. Any parameters not provided are left unchanged. Most + * parameters can be changed only for Custom accounts. (These are marked Custom + * Only below.) Parameters marked Custom and Express are not supported + * for Standard accounts. + * + *

To update your own account, use the Dashboard. Refer to our Connect documentation to learn + * more about updating accounts. + */ + public Account update(AccountUpdateParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options); } @Getter @@ -971,13 +978,6 @@ public static class Company extends StripeObject { @SerializedName("name_kanji") String nameKanji; - /** - * This hash is used to attest that the beneficial owner information provided to Stripe is both - * current and correct. - */ - @SerializedName("ownership_declaration") - OwnershipDeclaration ownershipDeclaration; - /** * Whether the company's owners have been provided. This Boolean will be {@code true} if you've * manually indicated that all owners are provided via Related guide: Connect + * Onboarding. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/ApplePayDomain.java b/src/main/java/com/stripe/model/ApplePayDomain.java index e23d63b90bb..d80fd050754 100644 --- a/src/main/java/com/stripe/model/ApplePayDomain.java +++ b/src/main/java/com/stripe/model/ApplePayDomain.java @@ -49,31 +49,6 @@ public class ApplePayDomain extends ApiResource implements HasId { @SerializedName("object") String object; - /** List apple pay domains. */ - public static ApplePayDomainCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** List apple pay domains. */ - public static ApplePayDomainCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains"); - return ApiResource.requestCollection(url, params, ApplePayDomainCollection.class, options); - } - - /** List apple pay domains. */ - public static ApplePayDomainCollection list(ApplePayDomainListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** List apple pay domains. */ - public static ApplePayDomainCollection list( - ApplePayDomainListParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains"); - return ApiResource.requestCollection(url, params, ApplePayDomainCollection.class, options); - } - /** Create an apple pay domain. */ public static ApplePayDomain create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -100,6 +75,58 @@ public static ApplePayDomain create(ApplePayDomainCreateParams params, RequestOp ApiResource.RequestMethod.POST, url, params, ApplePayDomain.class, options); } + /** Delete an apple pay domain. */ + public ApplePayDomain delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); + } + + /** Delete an apple pay domain. */ + public ApplePayDomain delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** Delete an apple pay domain. */ + public ApplePayDomain delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** Delete an apple pay domain. */ + public ApplePayDomain delete(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/apple_pay/domains/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, ApplePayDomain.class, options); + } + + /** List apple pay domains. */ + public static ApplePayDomainCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** List apple pay domains. */ + public static ApplePayDomainCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains"); + return ApiResource.requestCollection(url, params, ApplePayDomainCollection.class, options); + } + + /** List apple pay domains. */ + public static ApplePayDomainCollection list(ApplePayDomainListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** List apple pay domains. */ + public static ApplePayDomainCollection list( + ApplePayDomainListParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains"); + return ApiResource.requestCollection(url, params, ApplePayDomainCollection.class, options); + } + /** Retrieve an apple pay domain. */ public static ApplePayDomain retrieve(String domain) throws StripeException { return retrieve(domain, (Map) null, (RequestOptions) null); @@ -135,31 +162,4 @@ public static ApplePayDomain retrieve( return ApiResource.request( ApiResource.RequestMethod.GET, url, params, ApplePayDomain.class, options); } - - /** Delete an apple pay domain. */ - public ApplePayDomain delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** Delete an apple pay domain. */ - public ApplePayDomain delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** Delete an apple pay domain. */ - public ApplePayDomain delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** Delete an apple pay domain. */ - public ApplePayDomain delete(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/apple_pay/domains/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, ApplePayDomain.class, options); - } } diff --git a/src/main/java/com/stripe/model/Balance.java b/src/main/java/com/stripe/model/Balance.java index 2a5d50622f0..f15ea717791 100644 --- a/src/main/java/com/stripe/model/Balance.java +++ b/src/main/java/com/stripe/model/Balance.java @@ -13,6 +13,20 @@ import lombok.Getter; import lombok.Setter; +/** + * This is an object representing your Stripe balance. You can retrieve it to see the balance + * currently on your Stripe account. + * + *

You can also retrieve the balance history, which contains a list of transactions that + * contributed to the balance (charges, payouts, and so forth). + * + *

The available and pending amounts for each currency are broken down further by payment source + * types. + * + *

Related guide: Understanding + * Connect Account Balances. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/BalanceTransaction.java b/src/main/java/com/stripe/model/BalanceTransaction.java index 5e8ceb1e506..eb01d4db328 100644 --- a/src/main/java/com/stripe/model/BalanceTransaction.java +++ b/src/main/java/com/stripe/model/BalanceTransaction.java @@ -15,6 +15,13 @@ import lombok.Getter; import lombok.Setter; +/** + * Balance transactions represent funds moving through your Stripe account. They're created for + * every type of transaction that comes into or flows out of your Stripe account balance. + * + *

Related guide: Balance + * Transaction Types. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/BankAccount.java b/src/main/java/com/stripe/model/BankAccount.java index 5a7e71ae810..116b4612309 100644 --- a/src/main/java/com/stripe/model/BankAccount.java +++ b/src/main/java/com/stripe/model/BankAccount.java @@ -16,6 +16,17 @@ import lombok.Getter; import lombok.Setter; +/** + * These bank accounts are payment methods on {@code Customer} objects. + * + *

On the other hand External + * Accounts are transfer destinations on {@code Account} objects for Custom accounts. They can be bank + * accounts or debit cards as well, and are documented in the links above. + * + *

Related guide: Bank Debits + * and Transfers. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Capability.java b/src/main/java/com/stripe/model/Capability.java index 27da638fe3a..f22bf7eeec4 100644 --- a/src/main/java/com/stripe/model/Capability.java +++ b/src/main/java/com/stripe/model/Capability.java @@ -13,6 +13,12 @@ import lombok.Getter; import lombok.Setter; +/** + * This is an object representing a capability for a Stripe account. + * + *

Related guide: Account + * capabilities. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Card.java b/src/main/java/com/stripe/model/Card.java index ecb6b519163..72a92276fec 100644 --- a/src/main/java/com/stripe/model/Card.java +++ b/src/main/java/com/stripe/model/Card.java @@ -15,6 +15,12 @@ import lombok.Getter; import lombok.Setter; +/** + * You can store multiple cards on a customer in order to charge the customer later. You can also + * store multiple debit cards on a recipient in order to transfer to those cards later. + * + *

Related guide: Card Payments with Sources. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/CashBalance.java b/src/main/java/com/stripe/model/CashBalance.java index 2802bbb8289..c74bb869812 100644 --- a/src/main/java/com/stripe/model/CashBalance.java +++ b/src/main/java/com/stripe/model/CashBalance.java @@ -13,6 +13,11 @@ import lombok.Getter; import lombok.Setter; +/** + * A customer's {@code Cash balance} represents real funds. Customers can add funds to their cash + * balance by sending a bank transfer. These funds can be used for payment and can eventually be + * paid out to your bank account. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index e29e63aca00..26bbc83cb1d 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -19,6 +19,14 @@ import lombok.Getter; import lombok.Setter; +/** + * To charge a credit or a debit card, you create a {@code Charge} object. You can retrieve and + * refund individual charges as well as list all charges. Charges are identified by a unique, random + * ID. + * + *

Related guide: Accept a + * payment with the Charges API. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -600,91 +608,97 @@ public void setTransferObject(Transfer expandableObject) { } /** - * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static ChargeSearchResult search(Map params) throws StripeException { - return search(params, (RequestOptions) null); - } - - /** - * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static ChargeSearchResult search(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges/search"); - return ApiResource.requestSearchResult(url, params, ChargeSearchResult.class, options); - } - - /** - * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step + * payment flow, where first you created a + * charge with the capture option set to false. + * + *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not + * captured by that point in time, they will be marked as refunded and will no longer be + * capturable. */ - public static ChargeSearchResult search(ChargeSearchParams params) throws StripeException { - return search(params, (RequestOptions) null); + public Charge capture() throws StripeException { + return capture((Map) null, (RequestOptions) null); } /** - * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step + * payment flow, where first you created a + * charge with the capture option set to false. + * + *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not + * captured by that point in time, they will be marked as refunded and will no longer be + * capturable. */ - public static ChargeSearchResult search(ChargeSearchParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges/search"); - return ApiResource.requestSearchResult(url, params, ChargeSearchResult.class, options); + public Charge capture(RequestOptions options) throws StripeException { + return capture((Map) null, options); } /** - * Returns a list of charges you’ve previously created. The charges are returned in sorted order, - * with the most recent charges appearing first. + * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step + * payment flow, where first you created a + * charge with the capture option set to false. + * + *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not + * captured by that point in time, they will be marked as refunded and will no longer be + * capturable. */ - public static ChargeCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); + public Charge capture(Map params) throws StripeException { + return capture(params, (RequestOptions) null); } /** - * Returns a list of charges you’ve previously created. The charges are returned in sorted order, - * with the most recent charges appearing first. + * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step + * payment flow, where first you created a + * charge with the capture option set to false. + * + *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not + * captured by that point in time, they will be marked as refunded and will no longer be + * capturable. */ - public static ChargeCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges"); - return ApiResource.requestCollection(url, params, ChargeCollection.class, options); + public Charge capture(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/charges/%s/capture", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options); } /** - * Returns a list of charges you’ve previously created. The charges are returned in sorted order, - * with the most recent charges appearing first. + * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step + * payment flow, where first you created a + * charge with the capture option set to false. + * + *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not + * captured by that point in time, they will be marked as refunded and will no longer be + * capturable. */ - public static ChargeCollection list(ChargeListParams params) throws StripeException { - return list(params, (RequestOptions) null); + public Charge capture(ChargeCaptureParams params) throws StripeException { + return capture(params, (RequestOptions) null); } /** - * Returns a list of charges you’ve previously created. The charges are returned in sorted order, - * with the most recent charges appearing first. + * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step + * payment flow, where first you created a + * charge with the capture option set to false. + * + *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not + * captured by that point in time, they will be marked as refunded and will no longer be + * capturable. */ - public static ChargeCollection list(ChargeListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges"); - return ApiResource.requestCollection(url, params, ChargeCollection.class, options); + public Charge capture(ChargeCaptureParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/charges/%s/capture", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options); } /** @@ -731,6 +745,42 @@ public static Charge create(ChargeCreateParams params, RequestOptions options) return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options); } + /** + * Returns a list of charges you’ve previously created. The charges are returned in sorted order, + * with the most recent charges appearing first. + */ + public static ChargeCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of charges you’ve previously created. The charges are returned in sorted order, + * with the most recent charges appearing first. + */ + public static ChargeCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges"); + return ApiResource.requestCollection(url, params, ChargeCollection.class, options); + } + + /** + * Returns a list of charges you’ve previously created. The charges are returned in sorted order, + * with the most recent charges appearing first. + */ + public static ChargeCollection list(ChargeListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of charges you’ve previously created. The charges are returned in sorted order, + * with the most recent charges appearing first. + */ + public static ChargeCollection list(ChargeListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges"); + return ApiResource.requestCollection(url, params, ChargeCollection.class, options); + } + /** * Retrieves the details of a charge that has previously been created. Supply the unique charge ID * that was returned from your previous request, and Stripe will return the corresponding charge @@ -777,6 +827,58 @@ public static Charge retrieve(String charge, ChargeRetrieveParams params, Reques return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Charge.class, options); } + /** + * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static ChargeSearchResult search(Map params) throws StripeException { + return search(params, (RequestOptions) null); + } + + /** + * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static ChargeSearchResult search(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges/search"); + return ApiResource.requestSearchResult(url, params, ChargeSearchResult.class, options); + } + + /** + * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static ChargeSearchResult search(ChargeSearchParams params) throws StripeException { + return search(params, (RequestOptions) null); + } + + /** + * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static ChargeSearchResult search(ChargeSearchParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges/search"); + return ApiResource.requestSearchResult(url, params, ChargeSearchResult.class, options); + } + /** * Updates the specified charge by setting the values of the parameters passed. Any parameters not * provided will be left unchanged. @@ -821,100 +923,6 @@ public Charge update(ChargeUpdateParams params, RequestOptions options) throws S return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options); } - /** - * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step - * payment flow, where first you created a - * charge with the capture option set to false. - * - *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not - * captured by that point in time, they will be marked as refunded and will no longer be - * capturable. - */ - public Charge capture() throws StripeException { - return capture((Map) null, (RequestOptions) null); - } - - /** - * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step - * payment flow, where first you created a - * charge with the capture option set to false. - * - *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not - * captured by that point in time, they will be marked as refunded and will no longer be - * capturable. - */ - public Charge capture(RequestOptions options) throws StripeException { - return capture((Map) null, options); - } - - /** - * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step - * payment flow, where first you created a - * charge with the capture option set to false. - * - *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not - * captured by that point in time, they will be marked as refunded and will no longer be - * capturable. - */ - public Charge capture(Map params) throws StripeException { - return capture(params, (RequestOptions) null); - } - - /** - * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step - * payment flow, where first you created a - * charge with the capture option set to false. - * - *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not - * captured by that point in time, they will be marked as refunded and will no longer be - * capturable. - */ - public Charge capture(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/charges/%s/capture", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options); - } - - /** - * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step - * payment flow, where first you created a - * charge with the capture option set to false. - * - *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not - * captured by that point in time, they will be marked as refunded and will no longer be - * capturable. - */ - public Charge capture(ChargeCaptureParams params) throws StripeException { - return capture(params, (RequestOptions) null); - } - - /** - * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step - * payment flow, where first you created a - * charge with the capture option set to false. - * - *

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not - * captured by that point in time, they will be marked as refunded and will no longer be - * capturable. - */ - public Charge capture(ChargeCaptureParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/charges/%s/capture", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -2658,6 +2666,10 @@ public static class WechatPay extends StripeObject { } } + /** + * Options to configure Radar. See Radar + * Session for more information. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/CountrySpec.java b/src/main/java/com/stripe/model/CountrySpec.java index aeacd627422..0305dfbb6a3 100644 --- a/src/main/java/com/stripe/model/CountrySpec.java +++ b/src/main/java/com/stripe/model/CountrySpec.java @@ -14,6 +14,14 @@ import lombok.Getter; import lombok.Setter; +/** + * Stripe needs to collect certain pieces of information about each account created. These + * requirements can differ depending on the account's country. The Country Specs API makes these + * rules available to your integration. + * + *

You can also view the information from this API call as an online guide. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Coupon.java b/src/main/java/com/stripe/model/Coupon.java index 6e3bd1a9473..605feebbbd8 100644 --- a/src/main/java/com/stripe/model/Coupon.java +++ b/src/main/java/com/stripe/model/Coupon.java @@ -17,6 +17,16 @@ import lombok.Getter; import lombok.Setter; +/** + * A coupon contains information about a percent-off or amount-off discount you might want to apply + * to a customer. Coupons may be applied to subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not work with + * conventional one-off charges or payment intents. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -131,30 +141,6 @@ public class Coupon extends ApiResource implements HasId, MetadataStore @SerializedName("valid") Boolean valid; - /** Returns a list of your coupons. */ - public static CouponCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of your coupons. */ - public static CouponCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/coupons"); - return ApiResource.requestCollection(url, params, CouponCollection.class, options); - } - - /** Returns a list of your coupons. */ - public static CouponCollection list(CouponListParams params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of your coupons. */ - public static CouponCollection list(CouponListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/coupons"); - return ApiResource.requestCollection(url, params, CouponCollection.class, options); - } - /** * You can create coupons easily via the coupon * management page of the Stripe dashboard. Coupon creation is also accessible via the API if @@ -223,6 +209,76 @@ public static Coupon create(CouponCreateParams params, RequestOptions options) return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Coupon.class, options); } + /** + * You can delete coupons via the coupon + * management page of the Stripe dashboard. However, deleting a coupon does not affect any + * customers who have already applied the coupon; it means that new customers can’t redeem the + * coupon. You can also delete coupons via the API. + */ + public Coupon delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); + } + + /** + * You can delete coupons via the coupon + * management page of the Stripe dashboard. However, deleting a coupon does not affect any + * customers who have already applied the coupon; it means that new customers can’t redeem the + * coupon. You can also delete coupons via the API. + */ + public Coupon delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** + * You can delete coupons via the coupon + * management page of the Stripe dashboard. However, deleting a coupon does not affect any + * customers who have already applied the coupon; it means that new customers can’t redeem the + * coupon. You can also delete coupons via the API. + */ + public Coupon delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** + * You can delete coupons via the coupon + * management page of the Stripe dashboard. However, deleting a coupon does not affect any + * customers who have already applied the coupon; it means that new customers can’t redeem the + * coupon. You can also delete coupons via the API. + */ + public Coupon delete(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/coupons/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, Coupon.class, options); + } + + /** Returns a list of your coupons. */ + public static CouponCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of your coupons. */ + public static CouponCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/coupons"); + return ApiResource.requestCollection(url, params, CouponCollection.class, options); + } + + /** Returns a list of your coupons. */ + public static CouponCollection list(CouponListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of your coupons. */ + public static CouponCollection list(CouponListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/coupons"); + return ApiResource.requestCollection(url, params, CouponCollection.class, options); + } + /** Retrieves the coupon with the given ID. */ public static Coupon retrieve(String coupon) throws StripeException { return retrieve(coupon, (Map) null, (RequestOptions) null); @@ -297,52 +353,6 @@ public Coupon update(CouponUpdateParams params, RequestOptions options) throws S return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Coupon.class, options); } - /** - * You can delete coupons via the coupon - * management page of the Stripe dashboard. However, deleting a coupon does not affect any - * customers who have already applied the coupon; it means that new customers can’t redeem the - * coupon. You can also delete coupons via the API. - */ - public Coupon delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** - * You can delete coupons via the coupon - * management page of the Stripe dashboard. However, deleting a coupon does not affect any - * customers who have already applied the coupon; it means that new customers can’t redeem the - * coupon. You can also delete coupons via the API. - */ - public Coupon delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** - * You can delete coupons via the coupon - * management page of the Stripe dashboard. However, deleting a coupon does not affect any - * customers who have already applied the coupon; it means that new customers can’t redeem the - * coupon. You can also delete coupons via the API. - */ - public Coupon delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** - * You can delete coupons via the coupon - * management page of the Stripe dashboard. However, deleting a coupon does not affect any - * customers who have already applied the coupon; it means that new customers can’t redeem the - * coupon. You can also delete coupons via the API. - */ - public Coupon delete(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/coupons/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, Coupon.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/CreditNote.java b/src/main/java/com/stripe/model/CreditNote.java index 5af4775f951..c0d208b2d00 100644 --- a/src/main/java/com/stripe/model/CreditNote.java +++ b/src/main/java/com/stripe/model/CreditNote.java @@ -18,6 +18,12 @@ import lombok.Getter; import lombok.Setter; +/** + * Issue a credit note to adjust an invoice's amount after the invoice is finalized. + * + *

Related guide: Credit + * Notes. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -371,6 +377,30 @@ public static CreditNote create(CreditNoteCreateParams params, RequestOptions op ApiResource.RequestMethod.POST, url, params, CreditNote.class, options); } + /** Returns a list of credit notes. */ + public static CreditNoteCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of credit notes. */ + public static CreditNoteCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/credit_notes"); + return ApiResource.requestCollection(url, params, CreditNoteCollection.class, options); + } + + /** Returns a list of credit notes. */ + public static CreditNoteCollection list(CreditNoteListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of credit notes. */ + public static CreditNoteCollection list(CreditNoteListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/credit_notes"); + return ApiResource.requestCollection(url, params, CreditNoteCollection.class, options); + } + /** Get a preview of a credit note without creating it. */ public static CreditNote preview(Map params) throws StripeException { return preview(params, (RequestOptions) null); @@ -429,30 +459,6 @@ public static CreditNote retrieve( ApiResource.RequestMethod.GET, url, params, CreditNote.class, options); } - /** Returns a list of credit notes. */ - public static CreditNoteCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of credit notes. */ - public static CreditNoteCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/credit_notes"); - return ApiResource.requestCollection(url, params, CreditNoteCollection.class, options); - } - - /** Returns a list of credit notes. */ - public static CreditNoteCollection list(CreditNoteListParams params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of credit notes. */ - public static CreditNoteCollection list(CreditNoteListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/credit_notes"); - return ApiResource.requestCollection(url, params, CreditNoteCollection.class, options); - } - /** Updates an existing credit note. */ @Override public CreditNote update(Map params) throws StripeException { diff --git a/src/main/java/com/stripe/model/Customer.java b/src/main/java/com/stripe/model/Customer.java index dabc8ddd71d..fb817a0ccf7 100644 --- a/src/main/java/com/stripe/model/Customer.java +++ b/src/main/java/com/stripe/model/Customer.java @@ -23,6 +23,13 @@ import lombok.Getter; import lombok.Setter; +/** + * This object represents a customer of your business. It lets you create recurring charges and + * track payments that belong to the same customer. + * + *

Related guide: Save a card + * during payment. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -238,91 +245,61 @@ public void setTestClockObject(TestClock expandableObject) { } /** - * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static CustomerSearchResult search(Map params) throws StripeException { - return search(params, (RequestOptions) null); - } - - /** - * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static CustomerSearchResult search(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers/search"); - return ApiResource.requestSearchResult(url, params, CustomerSearchResult.class, options); - } - - /** - * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * Returns a list of transactions that updated the customer’s balances. */ - public static CustomerSearchResult search(CustomerSearchParams params) throws StripeException { - return search(params, (RequestOptions) null); + public CustomerBalanceTransactionCollection balanceTransactions() throws StripeException { + return balanceTransactions((Map) null, (RequestOptions) null); } /** - * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * Returns a list of transactions that updated the customer’s balances. */ - public static CustomerSearchResult search(CustomerSearchParams params, RequestOptions options) + public CustomerBalanceTransactionCollection balanceTransactions(Map params) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers/search"); - return ApiResource.requestSearchResult(url, params, CustomerSearchResult.class, options); - } - - /** - * Returns a list of your customers. The customers are returned sorted by creation date, with the - * most recent customers appearing first. - */ - public static CustomerCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); + return balanceTransactions(params, (RequestOptions) null); } /** - * Returns a list of your customers. The customers are returned sorted by creation date, with the - * most recent customers appearing first. + * Returns a list of transactions that updated the customer’s balances. */ - public static CustomerCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers"); - return ApiResource.requestCollection(url, params, CustomerCollection.class, options); + public CustomerBalanceTransactionCollection balanceTransactions( + Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/customers/%s/balance_transactions", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.requestCollection( + url, params, CustomerBalanceTransactionCollection.class, options); } /** - * Returns a list of your customers. The customers are returned sorted by creation date, with the - * most recent customers appearing first. + * Returns a list of transactions that updated the customer’s balances. */ - public static CustomerCollection list(CustomerListParams params) throws StripeException { - return list(params, (RequestOptions) null); + public CustomerBalanceTransactionCollection balanceTransactions( + CustomerBalanceTransactionsParams params) throws StripeException { + return balanceTransactions(params, (RequestOptions) null); } /** - * Returns a list of your customers. The customers are returned sorted by creation date, with the - * most recent customers appearing first. + * Returns a list of transactions that updated the customer’s balances. */ - public static CustomerCollection list(CustomerListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers"); - return ApiResource.requestCollection(url, params, CustomerCollection.class, options); + public CustomerBalanceTransactionCollection balanceTransactions( + CustomerBalanceTransactionsParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/customers/%s/balance_transactions", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.requestCollection( + url, params, CustomerBalanceTransactionCollection.class, options); } /** Creates a new customer object. */ @@ -351,125 +328,63 @@ public static Customer create(CustomerCreateParams params, RequestOptions option ApiResource.RequestMethod.POST, url, params, Customer.class, options); } - /** Retrieves a Customer object. */ - public static Customer retrieve(String customer) throws StripeException { - return retrieve(customer, (Map) null, (RequestOptions) null); - } - - /** Retrieves a Customer object. */ - public static Customer retrieve(String customer, RequestOptions options) throws StripeException { - return retrieve(customer, (Map) null, options); - } - - /** Retrieves a Customer object. */ - public static Customer retrieve( - String customer, Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/customers/%s", ApiResource.urlEncodeId(customer))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Customer.class, options); - } - - /** Retrieves a Customer object. */ - public static Customer retrieve( - String customer, CustomerRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/customers/%s", ApiResource.urlEncodeId(customer))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Customer.class, options); - } - /** - * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the - * source parameter: for each of the customer’s current subscriptions, if the - * subscription bills automatically and is in the past_due state, then the latest - * open invoice for the subscription with automatic collection enabled will be retried. This retry - * will not count as an automatic retry, and will not affect the next regularly scheduled payment - * for the invoice. Changing the default_source for a customer will not trigger - * this behavior. - * - *

This request accepts mostly the same arguments as the customer creation call. + * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet + * exist for the customer, new funding instructions will be created. If funding instructions have + * already been created for a given customer, the same funding instructions will be retrieved. In + * other words, we will return the same funding instructions each time. */ - @Override - public Customer update(Map params) throws StripeException { - return update(params, (RequestOptions) null); + public FundingInstructions createFundingInstructions(Map params) + throws StripeException { + return createFundingInstructions(params, (RequestOptions) null); } /** - * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the - * source parameter: for each of the customer’s current subscriptions, if the - * subscription bills automatically and is in the past_due state, then the latest - * open invoice for the subscription with automatic collection enabled will be retried. This retry - * will not count as an automatic retry, and will not affect the next regularly scheduled payment - * for the invoice. Changing the default_source for a customer will not trigger - * this behavior. - * - *

This request accepts mostly the same arguments as the customer creation call. + * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet + * exist for the customer, new funding instructions will be created. If funding instructions have + * already been created for a given customer, the same funding instructions will be retrieved. In + * other words, we will return the same funding instructions each time. */ - @Override - public Customer update(Map params, RequestOptions options) - throws StripeException { + public FundingInstructions createFundingInstructions( + Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/customers/%s", ApiResource.urlEncodeId(this.getId()))); + String.format( + "/v1/customers/%s/funding_instructions", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Customer.class, options); + ApiResource.RequestMethod.POST, url, params, FundingInstructions.class, options); } /** - * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the - * source parameter: for each of the customer’s current subscriptions, if the - * subscription bills automatically and is in the past_due state, then the latest - * open invoice for the subscription with automatic collection enabled will be retried. This retry - * will not count as an automatic retry, and will not affect the next regularly scheduled payment - * for the invoice. Changing the default_source for a customer will not trigger - * this behavior. - * - *

This request accepts mostly the same arguments as the customer creation call. + * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet + * exist for the customer, new funding instructions will be created. If funding instructions have + * already been created for a given customer, the same funding instructions will be retrieved. In + * other words, we will return the same funding instructions each time. */ - public Customer update(CustomerUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + public FundingInstructions createFundingInstructions( + CustomerCreateFundingInstructionsParams params) throws StripeException { + return createFundingInstructions(params, (RequestOptions) null); } /** - * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the - * source parameter: for each of the customer’s current subscriptions, if the - * subscription bills automatically and is in the past_due state, then the latest - * open invoice for the subscription with automatic collection enabled will be retried. This retry - * will not count as an automatic retry, and will not affect the next regularly scheduled payment - * for the invoice. Changing the default_source for a customer will not trigger - * this behavior. - * - *

This request accepts mostly the same arguments as the customer creation call. + * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet + * exist for the customer, new funding instructions will be created. If funding instructions have + * already been created for a given customer, the same funding instructions will be retrieved. In + * other words, we will return the same funding instructions each time. */ - public Customer update(CustomerUpdateParams params, RequestOptions options) + public FundingInstructions createFundingInstructions( + CustomerCreateFundingInstructionsParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/customers/%s", ApiResource.urlEncodeId(this.getId()))); + String.format( + "/v1/customers/%s/funding_instructions", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Customer.class, options); + ApiResource.RequestMethod.POST, url, params, FundingInstructions.class, options); } /** @@ -511,6 +426,64 @@ public Customer delete(Map params, RequestOptions options) ApiResource.RequestMethod.DELETE, url, params, Customer.class, options); } + /** Removes the currently applied discount on a customer. */ + public Discount deleteDiscount() throws StripeException { + return deleteDiscount((Map) null, (RequestOptions) null); + } + + /** Removes the currently applied discount on a customer. */ + public Discount deleteDiscount(Map params) throws StripeException { + return deleteDiscount(params, (RequestOptions) null); + } + + /** Removes the currently applied discount on a customer. */ + public Discount deleteDiscount(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/customers/%s/discount", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, Discount.class, options); + } + + /** + * Returns a list of your customers. The customers are returned sorted by creation date, with the + * most recent customers appearing first. + */ + public static CustomerCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of your customers. The customers are returned sorted by creation date, with the + * most recent customers appearing first. + */ + public static CustomerCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers"); + return ApiResource.requestCollection(url, params, CustomerCollection.class, options); + } + + /** + * Returns a list of your customers. The customers are returned sorted by creation date, with the + * most recent customers appearing first. + */ + public static CustomerCollection list(CustomerListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of your customers. The customers are returned sorted by creation date, with the + * most recent customers appearing first. + */ + public static CustomerCollection list(CustomerListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers"); + return ApiResource.requestCollection(url, params, CustomerCollection.class, options); + } + /** Returns a list of PaymentMethods for a given Customer. */ public PaymentMethodCollection listPaymentMethods(Map params) throws StripeException { @@ -547,6 +520,39 @@ public PaymentMethodCollection listPaymentMethods( return ApiResource.requestCollection(url, params, PaymentMethodCollection.class, options); } + /** Retrieves a Customer object. */ + public static Customer retrieve(String customer) throws StripeException { + return retrieve(customer, (Map) null, (RequestOptions) null); + } + + /** Retrieves a Customer object. */ + public static Customer retrieve(String customer, RequestOptions options) throws StripeException { + return retrieve(customer, (Map) null, options); + } + + /** Retrieves a Customer object. */ + public static Customer retrieve( + String customer, Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/customers/%s", ApiResource.urlEncodeId(customer))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Customer.class, options); + } + + /** Retrieves a Customer object. */ + public static Customer retrieve( + String customer, CustomerRetrieveParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/customers/%s", ApiResource.urlEncodeId(customer))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Customer.class, options); + } + /** Retrieves a PaymentMethod object for a given Customer. */ public PaymentMethod retrievePaymentMethod( String customer, Map params, RequestOptions options) throws StripeException { @@ -577,142 +583,143 @@ public PaymentMethod retrievePaymentMethod( } /** - * Returns a list of transactions that updated the customer’s balances. + * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public CustomerBalanceTransactionCollection balanceTransactions() throws StripeException { - return balanceTransactions((Map) null, (RequestOptions) null); + public static CustomerSearchResult search(Map params) throws StripeException { + return search(params, (RequestOptions) null); } /** - * Returns a list of transactions that updated the customer’s balances. + * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public CustomerBalanceTransactionCollection balanceTransactions(Map params) + public static CustomerSearchResult search(Map params, RequestOptions options) throws StripeException { - return balanceTransactions(params, (RequestOptions) null); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers/search"); + return ApiResource.requestSearchResult(url, params, CustomerSearchResult.class, options); } /** - * Returns a list of transactions that updated the customer’s balances. + * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public CustomerBalanceTransactionCollection balanceTransactions( - Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/customers/%s/balance_transactions", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.requestCollection( - url, params, CustomerBalanceTransactionCollection.class, options); + public static CustomerSearchResult search(CustomerSearchParams params) throws StripeException { + return search(params, (RequestOptions) null); } /** - * Returns a list of transactions that updated the customer’s balances. + * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public CustomerBalanceTransactionCollection balanceTransactions( - CustomerBalanceTransactionsParams params) throws StripeException { - return balanceTransactions(params, (RequestOptions) null); + public static CustomerSearchResult search(CustomerSearchParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers/search"); + return ApiResource.requestSearchResult(url, params, CustomerSearchResult.class, options); } /** - * Returns a list of transactions that updated the customer’s balances. + * Updates the specified customer by setting the values of the parameters passed. Any parameters + * not provided will be left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges + * in the future. When you update a customer to a new valid card source by passing the + * source parameter: for each of the customer’s current subscriptions, if the + * subscription bills automatically and is in the past_due state, then the latest + * open invoice for the subscription with automatic collection enabled will be retried. This retry + * will not count as an automatic retry, and will not affect the next regularly scheduled payment + * for the invoice. Changing the default_source for a customer will not trigger + * this behavior. + * + *

This request accepts mostly the same arguments as the customer creation call. */ - public CustomerBalanceTransactionCollection balanceTransactions( - CustomerBalanceTransactionsParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/customers/%s/balance_transactions", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.requestCollection( - url, params, CustomerBalanceTransactionCollection.class, options); + @Override + public Customer update(Map params) throws StripeException { + return update(params, (RequestOptions) null); } /** - * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet - * exist for the customer, new funding instructions will be created. If funding instructions have - * already been created for a given customer, the same funding instructions will be retrieved. In - * other words, we will return the same funding instructions each time. + * Updates the specified customer by setting the values of the parameters passed. Any parameters + * not provided will be left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges + * in the future. When you update a customer to a new valid card source by passing the + * source parameter: for each of the customer’s current subscriptions, if the + * subscription bills automatically and is in the past_due state, then the latest + * open invoice for the subscription with automatic collection enabled will be retried. This retry + * will not count as an automatic retry, and will not affect the next regularly scheduled payment + * for the invoice. Changing the default_source for a customer will not trigger + * this behavior. + * + *

This request accepts mostly the same arguments as the customer creation call. */ - public FundingInstructions createFundingInstructions(Map params) + @Override + public Customer update(Map params, RequestOptions options) throws StripeException { - return createFundingInstructions(params, (RequestOptions) null); - } - - /** - * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet - * exist for the customer, new funding instructions will be created. If funding instructions have - * already been created for a given customer, the same funding instructions will be retrieved. In - * other words, we will return the same funding instructions each time. - */ - public FundingInstructions createFundingInstructions( - Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format( - "/v1/customers/%s/funding_instructions", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/customers/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, FundingInstructions.class, options); + ApiResource.RequestMethod.POST, url, params, Customer.class, options); } /** - * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet - * exist for the customer, new funding instructions will be created. If funding instructions have - * already been created for a given customer, the same funding instructions will be retrieved. In - * other words, we will return the same funding instructions each time. + * Updates the specified customer by setting the values of the parameters passed. Any parameters + * not provided will be left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges + * in the future. When you update a customer to a new valid card source by passing the + * source parameter: for each of the customer’s current subscriptions, if the + * subscription bills automatically and is in the past_due state, then the latest + * open invoice for the subscription with automatic collection enabled will be retried. This retry + * will not count as an automatic retry, and will not affect the next regularly scheduled payment + * for the invoice. Changing the default_source for a customer will not trigger + * this behavior. + * + *

This request accepts mostly the same arguments as the customer creation call. */ - public FundingInstructions createFundingInstructions( - CustomerCreateFundingInstructionsParams params) throws StripeException { - return createFundingInstructions(params, (RequestOptions) null); + public Customer update(CustomerUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); } /** - * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet - * exist for the customer, new funding instructions will be created. If funding instructions have - * already been created for a given customer, the same funding instructions will be retrieved. In - * other words, we will return the same funding instructions each time. + * Updates the specified customer by setting the values of the parameters passed. Any parameters + * not provided will be left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges + * in the future. When you update a customer to a new valid card source by passing the + * source parameter: for each of the customer’s current subscriptions, if the + * subscription bills automatically and is in the past_due state, then the latest + * open invoice for the subscription with automatic collection enabled will be retried. This retry + * will not count as an automatic retry, and will not affect the next regularly scheduled payment + * for the invoice. Changing the default_source for a customer will not trigger + * this behavior. + * + *

This request accepts mostly the same arguments as the customer creation call. */ - public FundingInstructions createFundingInstructions( - CustomerCreateFundingInstructionsParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/customers/%s/funding_instructions", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, FundingInstructions.class, options); - } - - /** Removes the currently applied discount on a customer. */ - public Discount deleteDiscount() throws StripeException { - return deleteDiscount((Map) null, (RequestOptions) null); - } - - /** Removes the currently applied discount on a customer. */ - public Discount deleteDiscount(Map params) throws StripeException { - return deleteDiscount(params, (RequestOptions) null); - } - - /** Removes the currently applied discount on a customer. */ - public Discount deleteDiscount(Map params, RequestOptions options) + public Customer update(CustomerUpdateParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/customers/%s/discount", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/customers/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, Discount.class, options); + ApiResource.RequestMethod.POST, url, params, Customer.class, options); } @Getter @@ -817,13 +824,13 @@ private TestHelpers(Customer resource) { } /** Create an incoming testmode bank transfer. */ - public CustomerBalanceTransaction fundCashBalance(Map params) + public CustomerCashBalanceTransaction fundCashBalance(Map params) throws StripeException { return fundCashBalance(params, (RequestOptions) null); } /** Create an incoming testmode bank transfer. */ - public CustomerBalanceTransaction fundCashBalance( + public CustomerCashBalanceTransaction fundCashBalance( Map params, RequestOptions options) throws StripeException { String url = String.format( @@ -833,17 +840,21 @@ public CustomerBalanceTransaction fundCashBalance( "/v1/test_helpers/customers/%s/fund_cash_balance", ApiResource.urlEncodeId(this.resource.getId()))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options); + ApiResource.RequestMethod.POST, + url, + params, + CustomerCashBalanceTransaction.class, + options); } /** Create an incoming testmode bank transfer. */ - public CustomerBalanceTransaction fundCashBalance(CustomerFundCashBalanceParams params) + public CustomerCashBalanceTransaction fundCashBalance(CustomerFundCashBalanceParams params) throws StripeException { return fundCashBalance(params, (RequestOptions) null); } /** Create an incoming testmode bank transfer. */ - public CustomerBalanceTransaction fundCashBalance( + public CustomerCashBalanceTransaction fundCashBalance( CustomerFundCashBalanceParams params, RequestOptions options) throws StripeException { String url = String.format( @@ -853,7 +864,11 @@ public CustomerBalanceTransaction fundCashBalance( "/v1/test_helpers/customers/%s/fund_cash_balance", ApiResource.urlEncodeId(this.resource.getId()))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options); + ApiResource.RequestMethod.POST, + url, + params, + CustomerCashBalanceTransaction.class, + options); } } } diff --git a/src/main/java/com/stripe/model/CustomerBalanceTransaction.java b/src/main/java/com/stripe/model/CustomerBalanceTransaction.java index 62bd7d83bc8..cd08da9a102 100644 --- a/src/main/java/com/stripe/model/CustomerBalanceTransaction.java +++ b/src/main/java/com/stripe/model/CustomerBalanceTransaction.java @@ -12,6 +12,18 @@ import lombok.Getter; import lombok.Setter; +/** + * Each customer has a {@code balance} + * value, which denotes a debit or credit that's automatically applied to their next invoice upon + * finalization. You may modify the value directly by using the update customer API, or by creating a + * Customer Balance Transaction, which increments or decrements the customer's {@code balance} by + * the specified {@code amount}. + * + *

Related guide: Customer Balance + * to learn more. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/CustomerBalanceTransactionCollection.java b/src/main/java/com/stripe/model/CustomerBalanceTransactionCollection.java index e7c6ef53b33..63c3b69b587 100644 --- a/src/main/java/com/stripe/model/CustomerBalanceTransactionCollection.java +++ b/src/main/java/com/stripe/model/CustomerBalanceTransactionCollection.java @@ -13,51 +13,43 @@ public class CustomerBalanceTransactionCollection extends StripeCollection { /** - * Retrieves a specific customer balance transaction that updated the customer’s balances. + * Creates an immutable transaction that updates the customer’s credit balance. */ - public CustomerBalanceTransaction retrieve(String id) throws StripeException { - return retrieve(id, (Map) null, (RequestOptions) null); + public CustomerBalanceTransaction create(Map params) throws StripeException { + return create(params, (RequestOptions) null); } /** - * Retrieves a specific customer balance transaction that updated the customer’s balances. + * Creates an immutable transaction that updates the customer’s credit balance. */ - public CustomerBalanceTransaction retrieve(String id, RequestOptions options) + public CustomerBalanceTransaction create(Map params, RequestOptions options) throws StripeException { - return retrieve(id, (Map) null, options); + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options); } /** - * Retrieves a specific customer balance transaction that updated the customer’s balances. + * Creates an immutable transaction that updates the customer’s credit balance. */ - public CustomerBalanceTransaction retrieve( - String id, Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, CustomerBalanceTransaction.class, options); + public CustomerBalanceTransaction create(CustomerBalanceTransactionCollectionCreateParams params) + throws StripeException { + return create(params, (RequestOptions) null); } /** - * Retrieves a specific customer balance transaction that updated the customer’s balances. + * Creates an immutable transaction that updates the customer’s credit balance. */ - public CustomerBalanceTransaction retrieve( - String id, CustomerBalanceTransactionCollectionRetrieveParams params, RequestOptions options) + public CustomerBalanceTransaction create( + CustomerBalanceTransactionCollectionCreateParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id))); + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, CustomerBalanceTransaction.class, options); + ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options); } /** @@ -102,42 +94,50 @@ public CustomerBalanceTransactionCollection list( } /** - * Creates an immutable transaction that updates the customer’s credit balance. + * Retrieves a specific customer balance transaction that updated the customer’s balances. */ - public CustomerBalanceTransaction create(Map params) throws StripeException { - return create(params, (RequestOptions) null); + public CustomerBalanceTransaction retrieve(String id) throws StripeException { + return retrieve(id, (Map) null, (RequestOptions) null); } /** - * Creates an immutable transaction that updates the customer’s credit balance. + * Retrieves a specific customer balance transaction that updated the customer’s balances. */ - public CustomerBalanceTransaction create(Map params, RequestOptions options) + public CustomerBalanceTransaction retrieve(String id, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options); + return retrieve(id, (Map) null, options); } /** - * Creates an immutable transaction that updates the customer’s credit balance. + * Retrieves a specific customer balance transaction that updated the customer’s balances. */ - public CustomerBalanceTransaction create(CustomerBalanceTransactionCollectionCreateParams params) - throws StripeException { - return create(params, (RequestOptions) null); + public CustomerBalanceTransaction retrieve( + String id, Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, CustomerBalanceTransaction.class, options); } /** - * Creates an immutable transaction that updates the customer’s credit balance. + * Retrieves a specific customer balance transaction that updated the customer’s balances. */ - public CustomerBalanceTransaction create( - CustomerBalanceTransactionCollectionCreateParams params, RequestOptions options) + public CustomerBalanceTransaction retrieve( + String id, CustomerBalanceTransactionCollectionRetrieveParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options); + ApiResource.RequestMethod.GET, url, params, CustomerBalanceTransaction.class, options); } } diff --git a/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java b/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java new file mode 100644 index 00000000000..f435255fb4a --- /dev/null +++ b/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java @@ -0,0 +1,259 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiResource; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * Customers with certain payments enabled have a cash balance, representing funds that were paid by + * the customer to a merchant, but have not yet been allocated to a payment. Cash Balance + * Transactions represent when funds are moved into or out of this balance. This includes funding by + * the customer, allocation to payments, and refunds to the customer. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class CustomerCashBalanceTransaction extends StripeObject implements HasId { + @SerializedName("applied_to_payment") + AppliedToPayment appliedToPayment; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** + * Three-letter ISO currency code, + * in lowercase. Must be a supported currency. + */ + @SerializedName("currency") + String currency; + + /** The customer whose available cash balance changed as a result of this transaction. */ + @SerializedName("customer") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField customer; + + /** + * The total available cash balance for the specified currency after this transaction was applied. + * Represented in the smallest currency + * unit. + */ + @SerializedName("ending_balance") + Long endingBalance; + + @SerializedName("funded") + Funded funded; + + /** Unique identifier for the object. */ + @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 amount by which the cash balance changed, represented in the smallest currency unit. A positive + * value represents funds being added to the cash balance, a negative value represents funds being + * removed from the cash balance. + */ + @SerializedName("net_amount") + Long netAmount; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code customer_cash_balance_transaction}. + */ + @SerializedName("object") + String object; + + @SerializedName("refunded_from_payment") + RefundedFromPayment refundedFromPayment; + + /** + * The type of the cash balance transaction. One of {@code applied_to_payment}, {@code + * unapplied_from_payment}, {@code refunded_from_payment}, {@code funded}, {@code + * return_initiated}, or {@code return_canceled}. New types may be added in future. See Customer Balance to learn + * more about these types. + */ + @SerializedName("type") + String type; + + @SerializedName("unapplied_from_payment") + UnappliedFromPayment unappliedFromPayment; + + /** Get ID of expandable {@code customer} object. */ + public String getCustomer() { + return (this.customer != null) ? this.customer.getId() : null; + } + + public void setCustomer(String id) { + this.customer = ApiResource.setExpandableFieldId(id, this.customer); + } + + /** Get expanded {@code customer}. */ + public Customer getCustomerObject() { + return (this.customer != null) ? this.customer.getExpanded() : null; + } + + public void setCustomerObject(Customer expandableObject) { + this.customer = new ExpandableField(expandableObject.getId(), expandableObject); + } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AppliedToPayment extends StripeObject { + /** + * The Payment Intent that + * funds were applied to. + */ + @SerializedName("payment_intent") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField paymentIntent; + + /** Get ID of expandable {@code paymentIntent} object. */ + public String getPaymentIntent() { + return (this.paymentIntent != null) ? this.paymentIntent.getId() : null; + } + + public void setPaymentIntent(String id) { + this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent); + } + + /** Get expanded {@code paymentIntent}. */ + public PaymentIntent getPaymentIntentObject() { + return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null; + } + + public void setPaymentIntentObject(PaymentIntent expandableObject) { + this.paymentIntent = + new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Funded extends StripeObject { + @SerializedName("bank_transfer") + BankTransfer bankTransfer; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BankTransfer extends StripeObject { + @SerializedName("eu_bank_transfer") + EuBankTransfer euBankTransfer; + + /** The user-supplied reference field on the bank transfer. */ + @SerializedName("reference") + String reference; + + /** + * The funding method type used to fund the customer balance. Permitted values include: {@code + * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, or {@code + * mx_bank_transfer}. + * + *

One of {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, or + * {@code mx_bank_transfer}. + */ + @SerializedName("type") + String type; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EuBankTransfer extends StripeObject { + /** The BIC of the bank of the sender of the funding. */ + @SerializedName("bic") + String bic; + + /** The last 4 digits of the IBAN of the sender of the funding. */ + @SerializedName("iban_last4") + String ibanLast4; + + /** The full name of the sender, as supplied by the sending bank. */ + @SerializedName("sender_name") + String senderName; + } + } + } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RefundedFromPayment extends StripeObject { + /** + * The Refund that moved these funds + * into the customer's cash balance. + */ + @SerializedName("refund") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField refund; + + /** Get ID of expandable {@code refund} object. */ + public String getRefund() { + return (this.refund != null) ? this.refund.getId() : null; + } + + public void setRefund(String id) { + this.refund = ApiResource.setExpandableFieldId(id, this.refund); + } + + /** Get expanded {@code refund}. */ + public Refund getRefundObject() { + return (this.refund != null) ? this.refund.getExpanded() : null; + } + + public void setRefundObject(Refund expandableObject) { + this.refund = new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UnappliedFromPayment extends StripeObject { + /** + * The Payment Intent that + * funds were unapplied from. + */ + @SerializedName("payment_intent") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField paymentIntent; + + /** Get ID of expandable {@code paymentIntent} object. */ + public String getPaymentIntent() { + return (this.paymentIntent != null) ? this.paymentIntent.getId() : null; + } + + public void setPaymentIntent(String id) { + this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent); + } + + /** Get expanded {@code paymentIntent}. */ + public PaymentIntent getPaymentIntentObject() { + return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null; + } + + public void setPaymentIntentObject(PaymentIntent expandableObject) { + this.paymentIntent = + new ExpandableField(expandableObject.getId(), expandableObject); + } + } +} diff --git a/src/main/java/com/stripe/model/CustomerCashBalanceTransactionCollection.java b/src/main/java/com/stripe/model/CustomerCashBalanceTransactionCollection.java new file mode 100644 index 00000000000..e54e03ba8d9 --- /dev/null +++ b/src/main/java/com/stripe/model/CustomerCashBalanceTransactionCollection.java @@ -0,0 +1,104 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +import com.stripe.Stripe; +import com.stripe.exception.StripeException; +import com.stripe.net.ApiResource; +import com.stripe.net.RequestOptions; +import com.stripe.param.CustomerCashBalanceTransactionCollectionListParams; +import com.stripe.param.CustomerCashBalanceTransactionCollectionRetrieveParams; +import java.util.Map; + +public class CustomerCashBalanceTransactionCollection + extends StripeCollection { + /** + * Returns a list of transactions that modified the customer’s cash balance. + */ + public CustomerCashBalanceTransactionCollection list(Map params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of transactions that modified the customer’s cash balance. + */ + public CustomerCashBalanceTransactionCollection list( + Map params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + return ApiResource.requestCollection( + url, params, CustomerCashBalanceTransactionCollection.class, options); + } + + /** + * Returns a list of transactions that modified the customer’s cash balance. + */ + public CustomerCashBalanceTransactionCollection list( + CustomerCashBalanceTransactionCollectionListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of transactions that modified the customer’s cash balance. + */ + public CustomerCashBalanceTransactionCollection list( + CustomerCashBalanceTransactionCollectionListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + return ApiResource.requestCollection( + url, params, CustomerCashBalanceTransactionCollection.class, options); + } + + /** + * Retrieves a specific cash balance transaction, which updated the customer’s cash balance. + */ + public CustomerCashBalanceTransaction retrieve(String id) throws StripeException { + return retrieve(id, (Map) null, (RequestOptions) null); + } + + /** + * Retrieves a specific cash balance transaction, which updated the customer’s cash balance. + */ + public CustomerCashBalanceTransaction retrieve(String id, RequestOptions options) + throws StripeException { + return retrieve(id, (Map) null, options); + } + + /** + * Retrieves a specific cash balance transaction, which updated the customer’s cash balance. + */ + public CustomerCashBalanceTransaction retrieve( + String id, Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, CustomerCashBalanceTransaction.class, options); + } + + /** + * Retrieves a specific cash balance transaction, which updated the customer’s cash balance. + */ + public CustomerCashBalanceTransaction retrieve( + String id, + CustomerCashBalanceTransactionCollectionRetrieveParams params, + RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, CustomerCashBalanceTransaction.class, options); + } +} diff --git a/src/main/java/com/stripe/model/Discount.java b/src/main/java/com/stripe/model/Discount.java index a6284071bbf..4842a8e123f 100644 --- a/src/main/java/com/stripe/model/Discount.java +++ b/src/main/java/com/stripe/model/Discount.java @@ -7,6 +7,15 @@ import lombok.Getter; import lombok.Setter; +/** + * A discount represents the actual application of a coupon or promotion code. It contains information + * about when the discount began, when it will end, and what it is applied to. + * + *

Related guide: Applying + * Discounts to Subscriptions. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Dispute.java b/src/main/java/com/stripe/model/Dispute.java index 1c2f9a6a82c..b61ea7bc863 100644 --- a/src/main/java/com/stripe/model/Dispute.java +++ b/src/main/java/com/stripe/model/Dispute.java @@ -16,6 +16,14 @@ import lombok.Getter; import lombok.Setter; +/** + * A dispute occurs when a customer questions your charge with their card issuer. When this happens, + * you're given the opportunity to respond to the dispute with evidence that shows that the charge + * is legitimate. You can find more information about the dispute process in our Disputes and Fraud documentation. + * + *

Related guide: Disputes and Fraud. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -165,6 +173,82 @@ public void setPaymentIntentObject(PaymentIntent expandableObject) { new ExpandableField(expandableObject.getId(), expandableObject); } + /** + * Closing the dispute for a charge indicates that you do not have any evidence to submit and are + * essentially dismissing the dispute, acknowledging it as lost. + * + *

The status of the dispute will change from needs_response to lost. + * Closing a dispute is irreversible. + */ + public Dispute close() throws StripeException { + return close((Map) null, (RequestOptions) null); + } + + /** + * Closing the dispute for a charge indicates that you do not have any evidence to submit and are + * essentially dismissing the dispute, acknowledging it as lost. + * + *

The status of the dispute will change from needs_response to lost. + * Closing a dispute is irreversible. + */ + public Dispute close(RequestOptions options) throws StripeException { + return close((Map) null, options); + } + + /** + * Closing the dispute for a charge indicates that you do not have any evidence to submit and are + * essentially dismissing the dispute, acknowledging it as lost. + * + *

The status of the dispute will change from needs_response to lost. + * Closing a dispute is irreversible. + */ + public Dispute close(Map params) throws StripeException { + return close(params, (RequestOptions) null); + } + + /** + * Closing the dispute for a charge indicates that you do not have any evidence to submit and are + * essentially dismissing the dispute, acknowledging it as lost. + * + *

The status of the dispute will change from needs_response to lost. + * Closing a dispute is irreversible. + */ + public Dispute close(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/disputes/%s/close", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options); + } + + /** + * Closing the dispute for a charge indicates that you do not have any evidence to submit and are + * essentially dismissing the dispute, acknowledging it as lost. + * + *

The status of the dispute will change from needs_response to lost. + * Closing a dispute is irreversible. + */ + public Dispute close(DisputeCloseParams params) throws StripeException { + return close(params, (RequestOptions) null); + } + + /** + * Closing the dispute for a charge indicates that you do not have any evidence to submit and are + * essentially dismissing the dispute, acknowledging it as lost. + * + *

The status of the dispute will change from needs_response to lost. + * Closing a dispute is irreversible. + */ + public Dispute close(DisputeCloseParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/disputes/%s/close", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options); + } + /** Returns a list of your disputes. */ public static DisputeCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -289,82 +373,6 @@ public Dispute update(DisputeUpdateParams params, RequestOptions options) throws return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options); } - /** - * Closing the dispute for a charge indicates that you do not have any evidence to submit and are - * essentially dismissing the dispute, acknowledging it as lost. - * - *

The status of the dispute will change from needs_response to lost. - * Closing a dispute is irreversible. - */ - public Dispute close() throws StripeException { - return close((Map) null, (RequestOptions) null); - } - - /** - * Closing the dispute for a charge indicates that you do not have any evidence to submit and are - * essentially dismissing the dispute, acknowledging it as lost. - * - *

The status of the dispute will change from needs_response to lost. - * Closing a dispute is irreversible. - */ - public Dispute close(RequestOptions options) throws StripeException { - return close((Map) null, options); - } - - /** - * Closing the dispute for a charge indicates that you do not have any evidence to submit and are - * essentially dismissing the dispute, acknowledging it as lost. - * - *

The status of the dispute will change from needs_response to lost. - * Closing a dispute is irreversible. - */ - public Dispute close(Map params) throws StripeException { - return close(params, (RequestOptions) null); - } - - /** - * Closing the dispute for a charge indicates that you do not have any evidence to submit and are - * essentially dismissing the dispute, acknowledging it as lost. - * - *

The status of the dispute will change from needs_response to lost. - * Closing a dispute is irreversible. - */ - public Dispute close(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/disputes/%s/close", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options); - } - - /** - * Closing the dispute for a charge indicates that you do not have any evidence to submit and are - * essentially dismissing the dispute, acknowledging it as lost. - * - *

The status of the dispute will change from needs_response to lost. - * Closing a dispute is irreversible. - */ - public Dispute close(DisputeCloseParams params) throws StripeException { - return close(params, (RequestOptions) null); - } - - /** - * Closing the dispute for a charge indicates that you do not have any evidence to submit and are - * essentially dismissing the dispute, acknowledging it as lost. - * - *

The status of the dispute will change from needs_response to lost. - * Closing a dispute is irreversible. - */ - public Dispute close(DisputeCloseParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/disputes/%s/close", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Event.java b/src/main/java/com/stripe/model/Event.java index d1c8a4c91ec..9ab4abc77e8 100644 --- a/src/main/java/com/stripe/model/Event.java +++ b/src/main/java/com/stripe/model/Event.java @@ -13,6 +13,34 @@ import lombok.Getter; import lombok.Setter; +/** + * Events are our way of letting you know when something interesting happens in your account. When + * an interesting event occurs, we create a new {@code Event} object. For example, when a charge + * succeeds, we create a {@code charge.succeeded} event; and when an invoice payment attempt fails, + * we create an {@code invoice.payment_failed} event. Note that many API requests may cause multiple + * events to be created. For example, if you create a new subscription for a customer, you will + * receive both a {@code customer.subscription.created} event and a {@code charge.succeeded} event. + * + *

Events occur when the state of another API resource changes. The state of that resource at the + * time of the change is embedded in the event's data field. For example, a {@code charge.succeeded} + * event will contain a charge, and an {@code invoice.payment_failed} event will contain an invoice. + * + *

As with other API resources, you can use endpoints to retrieve an individual event or a list of events from the API. We also have a + * separate webhooks system for sending the + * {@code Event} objects directly to an endpoint on your server. Webhooks are managed in your account settings, and our Using Webhooks guide will help you get set up. + * + *

When using Connect, you can also receive + * notifications of events that occur in connected accounts. For these events, there will be an + * additional {@code account} attribute in the received {@code Event} object. + * + *

NOTE: Right now, access to events through the Retrieve Event API is guaranteed only for + * 30 days. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index 779c21b0dc4..f13a7d8fb91 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -31,6 +31,7 @@ final class EventDataClassLookup { classLookup.put("credit_note_line_item", CreditNoteLineItem.class); classLookup.put("customer", Customer.class); classLookup.put("customer_balance_transaction", CustomerBalanceTransaction.class); + classLookup.put("customer_cash_balance_transaction", CustomerCashBalanceTransaction.class); classLookup.put("discount", Discount.class); classLookup.put("dispute", Dispute.class); classLookup.put("ephemeral_key", EphemeralKey.class); diff --git a/src/main/java/com/stripe/model/ExchangeRate.java b/src/main/java/com/stripe/model/ExchangeRate.java index 6a04d03e1f1..94a78dd2b72 100644 --- a/src/main/java/com/stripe/model/ExchangeRate.java +++ b/src/main/java/com/stripe/model/ExchangeRate.java @@ -14,6 +14,17 @@ import lombok.Getter; import lombok.Setter; +/** + * {@code Exchange Rate} objects allow you to determine the rates that Stripe is currently using to + * convert from one currency to another. Since this number is variable throughout the day, there are + * various reasons why you might want to know the current rate (for example, to dynamically price an + * item for a user with a default payment in a foreign currency). + * + *

If you want a guarantee that the charge is made with a certain exchange rate you expect is + * current, you can pass in {@code exchange_rate} to charges endpoints. If the value is no longer up + * to date, the charge won't go through. Please refer to our Exchange Rates API guide for more details. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/ExternalAccountCollection.java b/src/main/java/com/stripe/model/ExternalAccountCollection.java index c9ccd7a9946..7369625969e 100644 --- a/src/main/java/com/stripe/model/ExternalAccountCollection.java +++ b/src/main/java/com/stripe/model/ExternalAccountCollection.java @@ -11,6 +11,33 @@ import java.util.Map; public class ExternalAccountCollection extends StripeCollection { + /** Create an external account for a given account. */ + public ExternalAccount create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Create an external account for a given account. */ + public ExternalAccount create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, ExternalAccount.class, options); + } + + /** Create an external account for a given account. */ + public ExternalAccount create(ExternalAccountCollectionCreateParams params) + throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Create an external account for a given account. */ + public ExternalAccount create( + ExternalAccountCollectionCreateParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, ExternalAccount.class, options); + } + /** List external accounts for an account. */ public ExternalAccountCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -70,31 +97,4 @@ public ExternalAccount retrieve( return ApiResource.request( ApiResource.RequestMethod.GET, url, params, ExternalAccount.class, options); } - - /** Create an external account for a given account. */ - public ExternalAccount create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Create an external account for a given account. */ - public ExternalAccount create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, ExternalAccount.class, options); - } - - /** Create an external account for a given account. */ - public ExternalAccount create(ExternalAccountCollectionCreateParams params) - throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Create an external account for a given account. */ - public ExternalAccount create( - ExternalAccountCollectionCreateParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, ExternalAccount.class, options); - } } diff --git a/src/main/java/com/stripe/model/FeeRefund.java b/src/main/java/com/stripe/model/FeeRefund.java index cc61c813341..a750ce8c92c 100644 --- a/src/main/java/com/stripe/model/FeeRefund.java +++ b/src/main/java/com/stripe/model/FeeRefund.java @@ -12,6 +12,15 @@ import lombok.Getter; import lombok.Setter; +/** + * {@code Application Fee Refund} objects allow you to refund an application fee that has previously + * been created but not yet refunded. Funds will be refunded to the Stripe account from which the + * fee was originally collected. + * + *

Related guide: Refunding + * Application Fees. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/FileLink.java b/src/main/java/com/stripe/model/FileLink.java index 00f8fb0d41a..249c79803f8 100644 --- a/src/main/java/com/stripe/model/FileLink.java +++ b/src/main/java/com/stripe/model/FileLink.java @@ -15,6 +15,11 @@ import lombok.Getter; import lombok.Setter; +/** + * To share the contents of a {@code File} object with non-Stripe users, you can create a {@code + * FileLink}. {@code FileLink}s contain a URL that can be used to retrieve the contents of the file + * without authentication. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -88,6 +93,56 @@ public void setFileObject(File expandableObject) { this.file = new ExpandableField(expandableObject.getId(), expandableObject); } + /** Creates a new file link object. */ + public static FileLink create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new file link object. */ + public static FileLink create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, FileLink.class, options); + } + + /** Creates a new file link object. */ + public static FileLink create(FileLinkCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new file link object. */ + public static FileLink create(FileLinkCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, FileLink.class, options); + } + + /** Returns a list of file links. */ + public static FileLinkCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of file links. */ + public static FileLinkCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links"); + return ApiResource.requestCollection(url, params, FileLinkCollection.class, options); + } + + /** Returns a list of file links. */ + public static FileLinkCollection list(FileLinkListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of file links. */ + public static FileLinkCollection list(FileLinkListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links"); + return ApiResource.requestCollection(url, params, FileLinkCollection.class, options); + } + /** Retrieves the file link with the given ID. */ public static FileLink retrieve(String link) throws StripeException { return retrieve(link, (Map) null, (RequestOptions) null); @@ -118,32 +173,6 @@ public static FileLink retrieve( return ApiResource.request(ApiResource.RequestMethod.GET, url, params, FileLink.class, options); } - /** Creates a new file link object. */ - public static FileLink create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new file link object. */ - public static FileLink create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, FileLink.class, options); - } - - /** Creates a new file link object. */ - public static FileLink create(FileLinkCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new file link object. */ - public static FileLink create(FileLinkCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, FileLink.class, options); - } - /** Updates an existing file link object. Expired links can no longer be updated. */ @Override public FileLink update(Map params) throws StripeException { @@ -179,28 +208,4 @@ public FileLink update(FileLinkUpdateParams params, RequestOptions options) return ApiResource.request( ApiResource.RequestMethod.POST, url, params, FileLink.class, options); } - - /** Returns a list of file links. */ - public static FileLinkCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of file links. */ - public static FileLinkCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links"); - return ApiResource.requestCollection(url, params, FileLinkCollection.class, options); - } - - /** Returns a list of file links. */ - public static FileLinkCollection list(FileLinkListParams params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of file links. */ - public static FileLinkCollection list(FileLinkListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links"); - return ApiResource.requestCollection(url, params, FileLinkCollection.class, options); - } } diff --git a/src/main/java/com/stripe/model/FundingInstructions.java b/src/main/java/com/stripe/model/FundingInstructions.java index a38c01b0911..80f13b4d412 100644 --- a/src/main/java/com/stripe/model/FundingInstructions.java +++ b/src/main/java/com/stripe/model/FundingInstructions.java @@ -7,6 +7,15 @@ import lombok.Getter; import lombok.Setter; +/** + * Each customer has a {@code balance} + * that is automatically applied to future invoices and payments using the {@code customer_balance} + * payment method. Customers can fund this balance by initiating a bank transfer to any account in + * the {@code financial_addresses} field. Related guide: Customer Balance - + * Funding Instructions to learn more + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -64,6 +73,7 @@ public static class BankTransfer extends StripeObject { @SerializedName("type") String type; + /** FinancialAddresses contain identifying information that resolves to a FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -96,6 +106,7 @@ public static class FinancialAddress extends StripeObject { @SerializedName("zengin") Zengin zengin; + /** Iban Records contain E.U. bank account details per the SEPA format. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -120,6 +131,7 @@ public static class Iban extends StripeObject { String iban; } + /** Sort Code Records contain U.K. bank account details per the sort code format. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -137,6 +149,7 @@ public static class SortCode extends StripeObject { String sortCode; } + /** SPEI Records contain Mexico bank account details per the SPEI format. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -154,6 +167,7 @@ public static class Spei extends StripeObject { String clabe; } + /** Zengin Records contain Japan bank account details per the Zengin format. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index a5f5097b0cc..247b7f769d6 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -25,6 +25,39 @@ import lombok.Getter; import lombok.Setter; +/** + * Invoices are statements of amounts owed by a customer, and are either generated one-off, or + * generated periodically from a subscription. + * + *

They contain invoice items, and + * proration adjustments that may be caused by subscription upgrades/downgrades (if necessary). + * + *

If your invoice is configured to be billed through automatic charges, Stripe automatically + * finalizes your invoice and attempts payment. Note that finalizing the invoice, when automatic, does + * not happen immediately as the invoice is created. Stripe waits until one hour after the last + * webhook was successfully sent (or the last webhook timed out after failing). If you (and the + * platforms you may have connected to) have no webhooks configured, Stripe waits one hour after + * creation to finalize the invoice. + * + *

If your invoice is configured to be billed by sending an email, then based on your email settings, Stripe will + * email the invoice to your customer and await payment. These emails can contain a link to a hosted + * page to pay the invoice. + * + *

Stripe applies any customer credit on the account before determining the amount due for the + * invoice (i.e., the amount that will be actually charged). If the amount due for the invoice is + * less than Stripe's minimum allowed + * charge per currency, the invoice is automatically marked paid, and we add the amount due to + * the customer's credit balance which is applied to the next invoice. + * + *

More details on the customer's credit balance are here. + * + *

Related guide: Send Invoices to + * Customers. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -153,6 +186,10 @@ public class Invoice extends ApiResource implements HasId, MetadataStore customFields; + /** The ID of the customer who will be billed. */ @SerializedName("customer") @Getter(lombok.AccessLevel.NONE) @@ -211,10 +248,6 @@ public class Invoice extends ApiResource implements HasId, MetadataStore customerTaxIds; - /** Custom fields displayed on the invoice. */ - @SerializedName("custom_fields") - List customFields; - /** * ID of the default payment method for the invoice. It must belong to the customer associated * with the invoice. If not set, defaults to the subscription's default payment method, if any, or @@ -789,55 +822,157 @@ public void setDiscountObjects(List objs) { } /** - * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in + * all pending invoice items on that customer, including prorations. The invoice remains a draft + * until you finalize the invoice, + * which allows you to pay or send the invoice to your customers. */ - public static InvoiceSearchResult search(Map params) throws StripeException { - return search(params, (RequestOptions) null); + public static Invoice create(Map params) throws StripeException { + return create(params, (RequestOptions) null); } /** - * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in + * all pending invoice items on that customer, including prorations. The invoice remains a draft + * until you finalize the invoice, + * which allows you to pay or send the invoice to your customers. */ - public static InvoiceSearchResult search(Map params, RequestOptions options) + public static Invoice create(Map params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/search"); - return ApiResource.requestSearchResult(url, params, InvoiceSearchResult.class, options); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); } /** - * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in + * all pending invoice items on that customer, including prorations. The invoice remains a draft + * until you finalize the invoice, + * which allows you to pay or send the invoice to your customers. */ - public static InvoiceSearchResult search(InvoiceSearchParams params) throws StripeException { - return search(params, (RequestOptions) null); + public static Invoice create(InvoiceCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); } /** - * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in + * all pending invoice items on that customer, including prorations. The invoice remains a draft + * until you finalize the invoice, + * which allows you to pay or send the invoice to your customers. */ - public static InvoiceSearchResult search(InvoiceSearchParams params, RequestOptions options) + public static Invoice create(InvoiceCreateParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/search"); - return ApiResource.requestSearchResult(url, params, InvoiceSearchResult.class, options); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); + } + + /** + * 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. + */ + public Invoice delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); + } + + /** + * 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. + */ + public Invoice delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** + * 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. + */ + public Invoice delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** + * 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. + */ + public Invoice delete(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/invoices/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, Invoice.class, options); + } + + /** + * Stripe automatically finalizes drafts before sending and attempting payment on invoices. + * However, if you’d like to finalize a draft invoice manually, you can do so using this method. + */ + public Invoice finalizeInvoice() throws StripeException { + return finalizeInvoice((Map) null, (RequestOptions) null); + } + + /** + * Stripe automatically finalizes drafts before sending and attempting payment on invoices. + * However, if you’d like to finalize a draft invoice manually, you can do so using this method. + */ + public Invoice finalizeInvoice(RequestOptions options) throws StripeException { + return finalizeInvoice((Map) null, options); + } + + /** + * Stripe automatically finalizes drafts before sending and attempting payment on invoices. + * However, if you’d like to finalize a draft invoice manually, you can do so using this method. + */ + public Invoice finalizeInvoice(Map params) throws StripeException { + return finalizeInvoice(params, (RequestOptions) null); + } + + /** + * Stripe automatically finalizes drafts before sending and attempting payment on invoices. + * However, if you’d like to finalize a draft invoice manually, you can do so using this method. + */ + public Invoice finalizeInvoice(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/invoices/%s/finalize", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); + } + + /** + * Stripe automatically finalizes drafts before sending and attempting payment on invoices. + * However, if you’d like to finalize a draft invoice manually, you can do so using this method. + */ + public Invoice finalizeInvoice(InvoiceFinalizeInvoiceParams params) throws StripeException { + return finalizeInvoice(params, (RequestOptions) null); + } + + /** + * Stripe automatically finalizes drafts before sending and attempting payment on invoices. + * However, if you’d like to finalize a draft invoice manually, you can do so using this method. + */ + public Invoice finalizeInvoice(InvoiceFinalizeInvoiceParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/invoices/%s/finalize", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); } /** @@ -877,323 +1012,67 @@ public static InvoiceCollection list(InvoiceListParams params, RequestOptions op } /** - * At any time, you can preview the upcoming invoice for a customer. This will show you all the - * charges that are pending, including subscription renewal charges, invoice item charges, etc. It - * will also show you any discounts that are applicable to the invoice. - * - *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the - * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice - * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the - * amount that your customer will be billed, you can add, remove, or update pending invoice items, - * or update the customer’s discount. - * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass a proration_date parameter when doing - * the actual subscription update. The value passed in should be the same as the - * subscription_proration_date returned on the upcoming invoice resource. The recommended - * way to get only the prorations being previewed is to consider only proration line items where - * period[start] is equal to the subscription_proration_date on the - * upcoming invoice resource. + * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be + * written off for accounting purposes. */ - public static Invoice upcoming() throws StripeException { - return upcoming((Map) null, (RequestOptions) null); + public Invoice markUncollectible() throws StripeException { + return markUncollectible((Map) null, (RequestOptions) null); } /** - * At any time, you can preview the upcoming invoice for a customer. This will show you all the - * charges that are pending, including subscription renewal charges, invoice item charges, etc. It - * will also show you any discounts that are applicable to the invoice. - * - *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the - * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice - * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the - * amount that your customer will be billed, you can add, remove, or update pending invoice items, - * or update the customer’s discount. - * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass a proration_date parameter when doing - * the actual subscription update. The value passed in should be the same as the - * subscription_proration_date returned on the upcoming invoice resource. The recommended - * way to get only the prorations being previewed is to consider only proration line items where - * period[start] is equal to the subscription_proration_date on the - * upcoming invoice resource. + * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be + * written off for accounting purposes. */ - public static Invoice upcoming(Map params) throws StripeException { - return upcoming(params, (RequestOptions) null); + public Invoice markUncollectible(RequestOptions options) throws StripeException { + return markUncollectible((Map) null, options); } /** - * At any time, you can preview the upcoming invoice for a customer. This will show you all the - * charges that are pending, including subscription renewal charges, invoice item charges, etc. It - * will also show you any discounts that are applicable to the invoice. - * - *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the - * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice - * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the - * amount that your customer will be billed, you can add, remove, or update pending invoice items, - * or update the customer’s discount. - * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass a proration_date parameter when doing - * the actual subscription update. The value passed in should be the same as the - * subscription_proration_date returned on the upcoming invoice resource. The recommended - * way to get only the prorations being previewed is to consider only proration line items where - * period[start] is equal to the subscription_proration_date on the - * upcoming invoice resource. + * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be + * written off for accounting purposes. */ - public static Invoice upcoming(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/upcoming"); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options); + public Invoice markUncollectible(Map params) throws StripeException { + return markUncollectible(params, (RequestOptions) null); } /** - * At any time, you can preview the upcoming invoice for a customer. This will show you all the - * charges that are pending, including subscription renewal charges, invoice item charges, etc. It - * will also show you any discounts that are applicable to the invoice. - * - *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the - * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice - * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the - * amount that your customer will be billed, you can add, remove, or update pending invoice items, - * or update the customer’s discount. - * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass a proration_date parameter when doing - * the actual subscription update. The value passed in should be the same as the - * subscription_proration_date returned on the upcoming invoice resource. The recommended - * way to get only the prorations being previewed is to consider only proration line items where - * period[start] is equal to the subscription_proration_date on the - * upcoming invoice resource. - */ - public static Invoice upcoming(InvoiceUpcomingParams params) throws StripeException { - return upcoming(params, (RequestOptions) null); - } - - /** - * At any time, you can preview the upcoming invoice for a customer. This will show you all the - * charges that are pending, including subscription renewal charges, invoice item charges, etc. It - * will also show you any discounts that are applicable to the invoice. - * - *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the - * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice - * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the - * amount that your customer will be billed, you can add, remove, or update pending invoice items, - * or update the customer’s discount. - * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass a proration_date parameter when doing - * the actual subscription update. The value passed in should be the same as the - * subscription_proration_date returned on the upcoming invoice resource. The recommended - * way to get only the prorations being previewed is to consider only proration line items where - * period[start] is equal to the subscription_proration_date on the - * upcoming invoice resource. - */ - public static Invoice upcoming(InvoiceUpcomingParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/upcoming"); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options); - } - - /** - * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in - * all pending invoice items on that customer, including prorations. The invoice remains a draft - * until you finalize the invoice, - * which allows you to pay or send the invoice to your customers. - */ - public static Invoice create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in - * all pending invoice items on that customer, including prorations. The invoice remains a draft - * until you finalize the invoice, - * which allows you to pay or send the invoice to your customers. - */ - public static Invoice create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); - } - - /** - * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in - * all pending invoice items on that customer, including prorations. The invoice remains a draft - * until you finalize the invoice, - * which allows you to pay or send the invoice to your customers. - */ - public static Invoice create(InvoiceCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in - * all pending invoice items on that customer, including prorations. The invoice remains a draft - * until you finalize the invoice, - * which allows you to pay or send the invoice to your customers. + * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be + * written off for accounting purposes. */ - public static Invoice create(InvoiceCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); - } - - /** Retrieves the invoice with the given ID. */ - public static Invoice retrieve(String invoice) throws StripeException { - return retrieve(invoice, (Map) null, (RequestOptions) null); - } - - /** Retrieves the invoice with the given ID. */ - public static Invoice retrieve(String invoice, RequestOptions options) throws StripeException { - return retrieve(invoice, (Map) null, options); - } - - /** Retrieves the invoice with the given ID. */ - public static Invoice retrieve(String invoice, Map params, RequestOptions options) + public Invoice markUncollectible(Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/invoices/%s", ApiResource.urlEncodeId(invoice))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options); - } - - /** Retrieves the invoice with the given ID. */ - public static Invoice retrieve( - String invoice, InvoiceRetrieveParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/invoices/%s", ApiResource.urlEncodeId(invoice))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options); - } - - /** - * Draft invoices are fully editable. Once an invoice is finalized, monetary - * values, as well as collection_method, become uneditable. - * - *

If you would like to stop the Stripe Billing engine from automatically finalizing, - * reattempting payments on, sending reminders for, or automatically reconciling - * invoices, pass auto_advance=false. - */ - @Override - public Invoice update(Map params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** - * Draft invoices are fully editable. Once an invoice is finalized, monetary - * values, as well as collection_method, become uneditable. - * - *

If you would like to stop the Stripe Billing engine from automatically finalizing, - * reattempting payments on, sending reminders for, or automatically reconciling - * invoices, pass auto_advance=false. - */ - @Override - public Invoice update(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/invoices/%s", ApiResource.urlEncodeId(this.getId()))); + String.format( + "/v1/invoices/%s/mark_uncollectible", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); } /** - * Draft invoices are fully editable. Once an invoice is finalized, monetary - * values, as well as collection_method, become uneditable. - * - *

If you would like to stop the Stripe Billing engine from automatically finalizing, - * reattempting payments on, sending reminders for, or automatically reconciling - * invoices, pass auto_advance=false. + * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be + * written off for accounting purposes. */ - public Invoice update(InvoiceUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + public Invoice markUncollectible(InvoiceMarkUncollectibleParams params) throws StripeException { + return markUncollectible(params, (RequestOptions) null); } /** - * Draft invoices are fully editable. Once an invoice is finalized, monetary - * values, as well as collection_method, become uneditable. - * - *

If you would like to stop the Stripe Billing engine from automatically finalizing, - * reattempting payments on, sending reminders for, or automatically reconciling - * invoices, pass auto_advance=false. + * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be + * written off for accounting purposes. */ - public Invoice update(InvoiceUpdateParams params, RequestOptions options) throws StripeException { + public Invoice markUncollectible(InvoiceMarkUncollectibleParams params, RequestOptions options) + throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/invoices/%s", ApiResource.urlEncodeId(this.getId()))); + String.format( + "/v1/invoices/%s/mark_uncollectible", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); } - /** - * 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. - */ - public Invoice delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** - * 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. - */ - public Invoice delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** - * 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. - */ - public Invoice delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** - * 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. - */ - public Invoice delete(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/invoices/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, Invoice.class, options); - } - /** * Stripe automatically creates and then attempts to collect payment on invoices for customers on * subscriptions according to your ) null, (RequestOptions) null); + /** Retrieves the invoice with the given ID. */ + public static Invoice retrieve(String invoice) throws StripeException { + return retrieve(invoice, (Map) null, (RequestOptions) null); } - /** - * Stripe automatically finalizes drafts before sending and attempting payment on invoices. - * However, if you’d like to finalize a draft invoice manually, you can do so using this method. - */ - public Invoice finalizeInvoice(RequestOptions options) throws StripeException { - return finalizeInvoice((Map) null, options); + /** Retrieves the invoice with the given ID. */ + public static Invoice retrieve(String invoice, RequestOptions options) throws StripeException { + return retrieve(invoice, (Map) null, options); + } + + /** Retrieves the invoice with the given ID. */ + public static Invoice retrieve(String invoice, Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/invoices/%s", ApiResource.urlEncodeId(invoice))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options); + } + + /** Retrieves the invoice with the given ID. */ + public static Invoice retrieve( + String invoice, InvoiceRetrieveParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/invoices/%s", ApiResource.urlEncodeId(invoice))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options); } /** - * Stripe automatically finalizes drafts before sending and attempting payment on invoices. - * However, if you’d like to finalize a draft invoice manually, you can do so using this method. + * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public Invoice finalizeInvoice(Map params) throws StripeException { - return finalizeInvoice(params, (RequestOptions) null); + public static InvoiceSearchResult search(Map params) throws StripeException { + return search(params, (RequestOptions) null); } /** - * Stripe automatically finalizes drafts before sending and attempting payment on invoices. - * However, if you’d like to finalize a draft invoice manually, you can do so using this method. + * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public Invoice finalizeInvoice(Map params, RequestOptions options) + public static InvoiceSearchResult search(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/invoices/%s/finalize", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/search"); + return ApiResource.requestSearchResult(url, params, InvoiceSearchResult.class, options); } /** - * Stripe automatically finalizes drafts before sending and attempting payment on invoices. - * However, if you’d like to finalize a draft invoice manually, you can do so using this method. + * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public Invoice finalizeInvoice(InvoiceFinalizeInvoiceParams params) throws StripeException { - return finalizeInvoice(params, (RequestOptions) null); + public static InvoiceSearchResult search(InvoiceSearchParams params) throws StripeException { + return search(params, (RequestOptions) null); } /** - * Stripe automatically finalizes drafts before sending and attempting payment on invoices. - * However, if you’d like to finalize a draft invoice manually, you can do so using this method. + * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public Invoice finalizeInvoice(InvoiceFinalizeInvoiceParams params, RequestOptions options) + public static InvoiceSearchResult search(InvoiceSearchParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/invoices/%s/finalize", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/search"); + return ApiResource.requestSearchResult(url, params, InvoiceSearchResult.class, options); } /** @@ -1427,64 +1330,194 @@ public Invoice sendInvoice(InvoiceSendInvoiceParams params, RequestOptions optio } /** - * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be - * written off for accounting purposes. + * At any time, you can preview the upcoming invoice for a customer. This will show you all the + * charges that are pending, including subscription renewal charges, invoice item charges, etc. It + * will also show you any discounts that are applicable to the invoice. + * + *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the + * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice + * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the + * amount that your customer will be billed, you can add, remove, or update pending invoice items, + * or update the customer’s discount. + * + *

You can preview the effects of updating a subscription, including a preview of what + * proration will take place. To ensure that the actual proration is calculated exactly the same + * as the previewed proration, you should pass a proration_date parameter when doing + * the actual subscription update. The value passed in should be the same as the + * subscription_proration_date returned on the upcoming invoice resource. The recommended + * way to get only the prorations being previewed is to consider only proration line items where + * period[start] is equal to the subscription_proration_date on the + * upcoming invoice resource. */ - public Invoice markUncollectible() throws StripeException { - return markUncollectible((Map) null, (RequestOptions) null); + public static Invoice upcoming() throws StripeException { + return upcoming((Map) null, (RequestOptions) null); } /** - * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be - * written off for accounting purposes. + * At any time, you can preview the upcoming invoice for a customer. This will show you all the + * charges that are pending, including subscription renewal charges, invoice item charges, etc. It + * will also show you any discounts that are applicable to the invoice. + * + *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the + * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice + * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the + * amount that your customer will be billed, you can add, remove, or update pending invoice items, + * or update the customer’s discount. + * + *

You can preview the effects of updating a subscription, including a preview of what + * proration will take place. To ensure that the actual proration is calculated exactly the same + * as the previewed proration, you should pass a proration_date parameter when doing + * the actual subscription update. The value passed in should be the same as the + * subscription_proration_date returned on the upcoming invoice resource. The recommended + * way to get only the prorations being previewed is to consider only proration line items where + * period[start] is equal to the subscription_proration_date on the + * upcoming invoice resource. */ - public Invoice markUncollectible(RequestOptions options) throws StripeException { - return markUncollectible((Map) null, options); + public static Invoice upcoming(Map params) throws StripeException { + return upcoming(params, (RequestOptions) null); } /** - * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be - * written off for accounting purposes. + * At any time, you can preview the upcoming invoice for a customer. This will show you all the + * charges that are pending, including subscription renewal charges, invoice item charges, etc. It + * will also show you any discounts that are applicable to the invoice. + * + *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the + * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice + * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the + * amount that your customer will be billed, you can add, remove, or update pending invoice items, + * or update the customer’s discount. + * + *

You can preview the effects of updating a subscription, including a preview of what + * proration will take place. To ensure that the actual proration is calculated exactly the same + * as the previewed proration, you should pass a proration_date parameter when doing + * the actual subscription update. The value passed in should be the same as the + * subscription_proration_date returned on the upcoming invoice resource. The recommended + * way to get only the prorations being previewed is to consider only proration line items where + * period[start] is equal to the subscription_proration_date on the + * upcoming invoice resource. */ - public Invoice markUncollectible(Map params) throws StripeException { - return markUncollectible(params, (RequestOptions) null); + public static Invoice upcoming(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/upcoming"); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options); } /** - * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be - * written off for accounting purposes. + * At any time, you can preview the upcoming invoice for a customer. This will show you all the + * charges that are pending, including subscription renewal charges, invoice item charges, etc. It + * will also show you any discounts that are applicable to the invoice. + * + *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the + * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice + * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the + * amount that your customer will be billed, you can add, remove, or update pending invoice items, + * or update the customer’s discount. + * + *

You can preview the effects of updating a subscription, including a preview of what + * proration will take place. To ensure that the actual proration is calculated exactly the same + * as the previewed proration, you should pass a proration_date parameter when doing + * the actual subscription update. The value passed in should be the same as the + * subscription_proration_date returned on the upcoming invoice resource. The recommended + * way to get only the prorations being previewed is to consider only proration line items where + * period[start] is equal to the subscription_proration_date on the + * upcoming invoice resource. */ - public Invoice markUncollectible(Map params, RequestOptions options) + public static Invoice upcoming(InvoiceUpcomingParams params) throws StripeException { + return upcoming(params, (RequestOptions) null); + } + + /** + * At any time, you can preview the upcoming invoice for a customer. This will show you all the + * charges that are pending, including subscription renewal charges, invoice item charges, etc. It + * will also show you any discounts that are applicable to the invoice. + * + *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the + * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice + * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the + * amount that your customer will be billed, you can add, remove, or update pending invoice items, + * or update the customer’s discount. + * + *

You can preview the effects of updating a subscription, including a preview of what + * proration will take place. To ensure that the actual proration is calculated exactly the same + * as the previewed proration, you should pass a proration_date parameter when doing + * the actual subscription update. The value passed in should be the same as the + * subscription_proration_date returned on the upcoming invoice resource. The recommended + * way to get only the prorations being previewed is to consider only proration line items where + * period[start] is equal to the subscription_proration_date on the + * upcoming invoice resource. + */ + public static Invoice upcoming(InvoiceUpcomingParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/upcoming"); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options); + } + + /** + * Draft invoices are fully editable. Once an invoice is finalized, monetary + * values, as well as collection_method, become uneditable. + * + *

If you would like to stop the Stripe Billing engine from automatically finalizing, + * reattempting payments on, sending reminders for, or automatically reconciling + * invoices, pass auto_advance=false. + */ + @Override + public Invoice update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Draft invoices are fully editable. Once an invoice is finalized, monetary + * values, as well as collection_method, become uneditable. + * + *

If you would like to stop the Stripe Billing engine from automatically finalizing, + * reattempting payments on, sending reminders for, or automatically reconciling + * invoices, pass auto_advance=false. + */ + @Override + public Invoice update(Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format( - "/v1/invoices/%s/mark_uncollectible", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/invoices/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); } /** - * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be - * written off for accounting purposes. + * Draft invoices are fully editable. Once an invoice is finalized, monetary + * values, as well as collection_method, become uneditable. + * + *

If you would like to stop the Stripe Billing engine from automatically finalizing, + * reattempting payments on, sending reminders for, or automatically reconciling + * invoices, pass auto_advance=false. */ - public Invoice markUncollectible(InvoiceMarkUncollectibleParams params) throws StripeException { - return markUncollectible(params, (RequestOptions) null); + public Invoice update(InvoiceUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); } /** - * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be - * written off for accounting purposes. + * Draft invoices are fully editable. Once an invoice is finalized, monetary + * values, as well as collection_method, become uneditable. + * + *

If you would like to stop the Stripe Billing engine from automatically finalizing, + * reattempting payments on, sending reminders for, or automatically reconciling + * invoices, pass auto_advance=false. */ - public Invoice markUncollectible(InvoiceMarkUncollectibleParams params, RequestOptions options) - throws StripeException { + public Invoice update(InvoiceUpdateParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format( - "/v1/invoices/%s/mark_uncollectible", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/invoices/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options); } diff --git a/src/main/java/com/stripe/model/InvoiceItem.java b/src/main/java/com/stripe/model/InvoiceItem.java index c258f82c247..6188b1714ca 100644 --- a/src/main/java/com/stripe/model/InvoiceItem.java +++ b/src/main/java/com/stripe/model/InvoiceItem.java @@ -19,6 +19,16 @@ import lombok.Getter; import lombok.Setter; +/** + * Sometimes you want to add a charge or credit to a customer, but actually charge or credit the + * customer's card only at the end of a regular billing cycle. This is useful for combining several + * charges (to minimize per-transaction fees), or for having Stripe tabulate your usage-based + * billing totals. + * + *

Related guide: Subscription + * Invoices. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -275,77 +285,116 @@ public void setDiscountObjects(List objs) { } /** - * Returns a list of your invoice items. Invoice items are returned sorted by creation date, with - * the most recently created invoice items appearing first. + * Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is + * specified, the item will be on the next invoice created for the customer specified. */ - public static InvoiceItemCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); + public static InvoiceItem create(Map params) throws StripeException { + return create(params, (RequestOptions) null); } /** - * Returns a list of your invoice items. Invoice items are returned sorted by creation date, with - * the most recently created invoice items appearing first. + * Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is + * specified, the item will be on the next invoice created for the customer specified. */ - public static InvoiceItemCollection list(Map params, RequestOptions options) + public static InvoiceItem create(Map params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoiceitems"); - return ApiResource.requestCollection(url, params, InvoiceItemCollection.class, options); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, InvoiceItem.class, options); } /** - * Returns a list of your invoice items. Invoice items are returned sorted by creation date, with - * the most recently created invoice items appearing first. + * Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is + * specified, the item will be on the next invoice created for the customer specified. */ - public static InvoiceItemCollection list(InvoiceItemListParams params) throws StripeException { - return list(params, (RequestOptions) null); + public static InvoiceItem create(InvoiceItemCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); } /** - * Returns a list of your invoice items. Invoice items are returned sorted by creation date, with - * the most recently created invoice items appearing first. + * Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is + * specified, the item will be on the next invoice created for the customer specified. */ - public static InvoiceItemCollection list(InvoiceItemListParams params, RequestOptions options) + public static InvoiceItem create(InvoiceItemCreateParams params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoiceitems"); - return ApiResource.requestCollection(url, params, InvoiceItemCollection.class, options); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, InvoiceItem.class, options); } /** - * Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is - * specified, the item will be on the next invoice created for the customer specified. + * Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible + * when they’re not attached to invoices, or if it’s attached to a draft invoice. */ - public static InvoiceItem create(Map params) throws StripeException { - return create(params, (RequestOptions) null); + public InvoiceItem delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); } /** - * Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is - * specified, the item will be on the next invoice created for the customer specified. + * Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible + * when they’re not attached to invoices, or if it’s attached to a draft invoice. */ - public static InvoiceItem create(Map params, RequestOptions options) + public InvoiceItem delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** + * Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible + * when they’re not attached to invoices, or if it’s attached to a draft invoice. + */ + public InvoiceItem delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** + * Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible + * when they’re not attached to invoices, or if it’s attached to a draft invoice. + */ + public InvoiceItem delete(Map params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoiceitems"); + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/invoiceitems/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, InvoiceItem.class, options); + ApiResource.RequestMethod.DELETE, url, params, InvoiceItem.class, options); } /** - * Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is - * specified, the item will be on the next invoice created for the customer specified. + * Returns a list of your invoice items. Invoice items are returned sorted by creation date, with + * the most recently created invoice items appearing first. */ - public static InvoiceItem create(InvoiceItemCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); + public static InvoiceItemCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); } /** - * Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is - * specified, the item will be on the next invoice created for the customer specified. + * Returns a list of your invoice items. Invoice items are returned sorted by creation date, with + * the most recently created invoice items appearing first. */ - public static InvoiceItem create(InvoiceItemCreateParams params, RequestOptions options) + public static InvoiceItemCollection list(Map params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoiceitems"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, InvoiceItem.class, options); + return ApiResource.requestCollection(url, params, InvoiceItemCollection.class, options); + } + + /** + * Returns a list of your invoice items. Invoice items are returned sorted by creation date, with + * the most recently created invoice items appearing first. + */ + public static InvoiceItemCollection list(InvoiceItemListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of your invoice items. Invoice items are returned sorted by creation date, with + * the most recently created invoice items appearing first. + */ + public static InvoiceItemCollection list(InvoiceItemListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoiceitems"); + return ApiResource.requestCollection(url, params, InvoiceItemCollection.class, options); } /** Retrieves the invoice item with the given ID. */ @@ -432,43 +481,4 @@ public InvoiceItem update(InvoiceItemUpdateParams params, RequestOptions options return ApiResource.request( ApiResource.RequestMethod.POST, url, params, InvoiceItem.class, options); } - - /** - * Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible - * when they’re not attached to invoices, or if it’s attached to a draft invoice. - */ - public InvoiceItem delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** - * Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible - * when they’re not attached to invoices, or if it’s attached to a draft invoice. - */ - public InvoiceItem delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** - * Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible - * when they’re not attached to invoices, or if it’s attached to a draft invoice. - */ - public InvoiceItem delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** - * Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible - * when they’re not attached to invoices, or if it’s attached to a draft invoice. - */ - public InvoiceItem delete(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/invoiceitems/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, InvoiceItem.class, options); - } } diff --git a/src/main/java/com/stripe/model/InvoiceLineItem.java b/src/main/java/com/stripe/model/InvoiceLineItem.java index f61b46a02d3..93910ca6d3e 100644 --- a/src/main/java/com/stripe/model/InvoiceLineItem.java +++ b/src/main/java/com/stripe/model/InvoiceLineItem.java @@ -37,14 +37,14 @@ public class InvoiceLineItem extends StripeObject implements HasId { @SerializedName("description") String description; - /** If true, discounts will apply to this line item. Always false for prorations. */ - @SerializedName("discountable") - Boolean discountable; - /** The amount of discount calculated per discount for this line item. */ @SerializedName("discount_amounts") List discountAmounts; + /** If true, discounts will apply to this line item. Always false for prorations. */ + @SerializedName("discountable") + Boolean discountable; + /** * The discounts applied to the invoice line item. Line item discounts are applied before invoice * discounts. Use {@code expand[]=discounts} to expand each discount. diff --git a/src/main/java/com/stripe/model/LineItem.java b/src/main/java/com/stripe/model/LineItem.java index 4c1370f76de..a184ef57847 100644 --- a/src/main/java/com/stripe/model/LineItem.java +++ b/src/main/java/com/stripe/model/LineItem.java @@ -8,6 +8,7 @@ import lombok.Getter; import lombok.Setter; +/** A line item. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Mandate.java b/src/main/java/com/stripe/model/Mandate.java index 80387a89b99..c2aa006c55b 100644 --- a/src/main/java/com/stripe/model/Mandate.java +++ b/src/main/java/com/stripe/model/Mandate.java @@ -13,6 +13,9 @@ import lombok.Getter; import lombok.Setter; +/** + * A Mandate is a record of the permission a customer has given you to debit their payment method. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 21a1da37278..493694520c3 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -23,6 +23,20 @@ import lombok.Getter; import lombok.Setter; +/** + * A PaymentIntent guides you through the process of collecting a payment from your customer. We + * recommend that you create exactly one PaymentIntent for each order or customer session in your + * system. You can reference the PaymentIntent later to see the history of payment attempts for a + * particular session. + * + *

A PaymentIntent transitions through multiple statuses throughout + * its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately + * creates at most one successful charge. + * + *

Related guide: Payment Intents + * API. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -442,295 +456,272 @@ public void setSourceObject(PaymentSource expandableObject) { this.source = new ExpandableField(expandableObject.getId(), expandableObject); } - /** - * Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static PaymentIntentSearchResult search(Map params) - throws StripeException { - return search(params, (RequestOptions) null); + /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ + public PaymentIntent applyCustomerBalance() throws StripeException { + return applyCustomerBalance((Map) null, (RequestOptions) null); } - /** - * Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static PaymentIntentSearchResult search(Map params, RequestOptions options) + /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ + public PaymentIntent applyCustomerBalance(RequestOptions options) throws StripeException { + return applyCustomerBalance((Map) null, options); + } + + /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ + public PaymentIntent applyCustomerBalance(Map params) throws StripeException { + return applyCustomerBalance(params, (RequestOptions) null); + } + + /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ + public PaymentIntent applyCustomerBalance(Map params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents/search"); - return ApiResource.requestSearchResult(url, params, PaymentIntentSearchResult.class, options); + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/payment_intents/%s/apply_customer_balance", + ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); } - /** - * Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static PaymentIntentSearchResult search(PaymentIntentSearchParams params) + /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ + public PaymentIntent applyCustomerBalance(PaymentIntentApplyCustomerBalanceParams params) throws StripeException { - return search(params, (RequestOptions) null); + return applyCustomerBalance(params, (RequestOptions) null); } - /** - * Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static PaymentIntentSearchResult search( - PaymentIntentSearchParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents/search"); - return ApiResource.requestSearchResult(url, params, PaymentIntentSearchResult.class, options); + /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ + public PaymentIntent applyCustomerBalance( + PaymentIntentApplyCustomerBalanceParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/payment_intents/%s/apply_customer_balance", + ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); } /** - * Creates a PaymentIntent object. + * A PaymentIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_capture, requires_confirmation + * , requires_action, or processing. * - *

After the PaymentIntent is created, attach a payment method and confirm to continue the payment. - * You can read more about the different payment flows available via the Payment Intents API here. + *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on + * the PaymentIntent will fail with an error. For PaymentIntents with + * status=’requires_capture’, the remaining amount_capturable will + * automatically be refunded. * - *

When confirm=true is used during creation, it is equivalent to creating and - * confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when - * confirm=true is supplied. + *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session + * instead */ - public static PaymentIntent create(Map params) throws StripeException { - return create(params, (RequestOptions) null); + public PaymentIntent cancel() throws StripeException { + return cancel((Map) null, (RequestOptions) null); } /** - * Creates a PaymentIntent object. + * A PaymentIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_capture, requires_confirmation + * , requires_action, or processing. * - *

After the PaymentIntent is created, attach a payment method and confirm to continue the payment. - * You can read more about the different payment flows available via the Payment Intents API here. + *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on + * the PaymentIntent will fail with an error. For PaymentIntents with + * status=’requires_capture’, the remaining amount_capturable will + * automatically be refunded. * - *

When confirm=true is used during creation, it is equivalent to creating and - * confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when - * confirm=true is supplied. + *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session + * instead */ - public static PaymentIntent create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); + public PaymentIntent cancel(RequestOptions options) throws StripeException { + return cancel((Map) null, options); } /** - * Creates a PaymentIntent object. + * A PaymentIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_capture, requires_confirmation + * , requires_action, or processing. * - *

After the PaymentIntent is created, attach a payment method and confirm to continue the payment. - * You can read more about the different payment flows available via the Payment Intents API here. + *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on + * the PaymentIntent will fail with an error. For PaymentIntents with + * status=’requires_capture’, the remaining amount_capturable will + * automatically be refunded. * - *

When confirm=true is used during creation, it is equivalent to creating and - * confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when - * confirm=true is supplied. + *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session + * instead */ - public static PaymentIntent create(PaymentIntentCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); + public PaymentIntent cancel(Map params) throws StripeException { + return cancel(params, (RequestOptions) null); } /** - * Creates a PaymentIntent object. + * A PaymentIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_capture, requires_confirmation + * , requires_action, or processing. * - *

After the PaymentIntent is created, attach a payment method and confirm to continue the payment. - * You can read more about the different payment flows available via the Payment Intents API here. + *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on + * the PaymentIntent will fail with an error. For PaymentIntents with + * status=’requires_capture’, the remaining amount_capturable will + * automatically be refunded. * - *

When confirm=true is used during creation, it is equivalent to creating and - * confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when - * confirm=true is supplied. + *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session + * instead */ - public static PaymentIntent create(PaymentIntentCreateParams params, RequestOptions options) + public PaymentIntent cancel(Map params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents"); + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/payment_intents/%s/cancel", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); } - /** Returns a list of PaymentIntents. */ - public static PaymentIntentCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of PaymentIntents. */ - public static PaymentIntentCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents"); - return ApiResource.requestCollection(url, params, PaymentIntentCollection.class, options); - } - - /** Returns a list of PaymentIntents. */ - public static PaymentIntentCollection list(PaymentIntentListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of PaymentIntents. */ - public static PaymentIntentCollection list(PaymentIntentListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents"); - return ApiResource.requestCollection(url, params, PaymentIntentCollection.class, options); - } - /** - * Retrieves the details of a PaymentIntent that has previously been created. + * A PaymentIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_capture, requires_confirmation + * , requires_action, or processing. * - *

Client-side retrieval using a publishable key is allowed when the client_secret - * is provided in the query string. + *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on + * the PaymentIntent will fail with an error. For PaymentIntents with + * status=’requires_capture’, the remaining amount_capturable will + * automatically be refunded. * - *

When retrieved with a publishable key, only a subset of properties will be returned. Please - * refer to the payment intent - * object reference for more details. + *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session + * instead */ - public static PaymentIntent retrieve(String intent) throws StripeException { - return retrieve(intent, (Map) null, (RequestOptions) null); + public PaymentIntent cancel(PaymentIntentCancelParams params) throws StripeException { + return cancel(params, (RequestOptions) null); } /** - * Retrieves the details of a PaymentIntent that has previously been created. + * A PaymentIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_capture, requires_confirmation + * , requires_action, or processing. * - *

Client-side retrieval using a publishable key is allowed when the client_secret - * is provided in the query string. + *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on + * the PaymentIntent will fail with an error. For PaymentIntents with + * status=’requires_capture’, the remaining amount_capturable will + * automatically be refunded. * - *

When retrieved with a publishable key, only a subset of properties will be returned. Please - * refer to the payment intent - * object reference for more details. + *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session + * instead */ - public static PaymentIntent retrieve(String intent, RequestOptions options) + public PaymentIntent cancel(PaymentIntentCancelParams params, RequestOptions options) throws StripeException { - return retrieve(intent, (Map) null, options); + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/payment_intents/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); } /** - * Retrieves the details of a PaymentIntent that has previously been created. + * Capture the funds of an existing uncaptured PaymentIntent when its status is + * requires_capture. * - *

Client-side retrieval using a publishable key is allowed when the client_secret - * is provided in the query string. + *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by + * default). * - *

When retrieved with a publishable key, only a subset of properties will be returned. Please - * refer to the payment intent - * object reference for more details. + *

Learn more about separate + * authorization and capture. */ - public static PaymentIntent retrieve( - String intent, Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/payment_intents/%s", ApiResource.urlEncodeId(intent))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, PaymentIntent.class, options); + public PaymentIntent capture() throws StripeException { + return capture((Map) null, (RequestOptions) null); } /** - * Retrieves the details of a PaymentIntent that has previously been created. + * Capture the funds of an existing uncaptured PaymentIntent when its status is + * requires_capture. * - *

Client-side retrieval using a publishable key is allowed when the client_secret - * is provided in the query string. + *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by + * default). * - *

When retrieved with a publishable key, only a subset of properties will be returned. Please - * refer to the payment intent - * object reference for more details. + *

Learn more about separate + * authorization and capture. */ - public static PaymentIntent retrieve( - String intent, PaymentIntentRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/payment_intents/%s", ApiResource.urlEncodeId(intent))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, PaymentIntent.class, options); + public PaymentIntent capture(RequestOptions options) throws StripeException { + return capture((Map) null, options); } /** - * Updates properties on a PaymentIntent object without confirming. + * Capture the funds of an existing uncaptured PaymentIntent when its status is + * requires_capture. * - *

Depending on which properties you update, you may need to confirm the PaymentIntent again. - * For example, updating the payment_method will always require you to confirm the - * PaymentIntent again. If you prefer to update and confirm at the same time, we recommend - * updating properties via the confirm API instead. + *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by + * default). + * + *

Learn more about separate + * authorization and capture. */ - @Override - public PaymentIntent update(Map params) throws StripeException { - return update(params, (RequestOptions) null); + public PaymentIntent capture(Map params) throws StripeException { + return capture(params, (RequestOptions) null); } /** - * Updates properties on a PaymentIntent object without confirming. + * Capture the funds of an existing uncaptured PaymentIntent when its status is + * requires_capture. * - *

Depending on which properties you update, you may need to confirm the PaymentIntent again. - * For example, updating the payment_method will always require you to confirm the - * PaymentIntent again. If you prefer to update and confirm at the same time, we recommend - * updating properties via the confirm API instead. + *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by + * default). + * + *

Learn more about separate + * authorization and capture. */ - @Override - public PaymentIntent update(Map params, RequestOptions options) + public PaymentIntent capture(Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/payment_intents/%s", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_intents/%s/capture", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); } /** - * Updates properties on a PaymentIntent object without confirming. + * Capture the funds of an existing uncaptured PaymentIntent when its status is + * requires_capture. * - *

Depending on which properties you update, you may need to confirm the PaymentIntent again. - * For example, updating the payment_method will always require you to confirm the - * PaymentIntent again. If you prefer to update and confirm at the same time, we recommend - * updating properties via the confirm API instead. + *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by + * default). + * + *

Learn more about separate + * authorization and capture. */ - public PaymentIntent update(PaymentIntentUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + public PaymentIntent capture(PaymentIntentCaptureParams params) throws StripeException { + return capture(params, (RequestOptions) null); } /** - * Updates properties on a PaymentIntent object without confirming. + * Capture the funds of an existing uncaptured PaymentIntent when its status is + * requires_capture. * - *

Depending on which properties you update, you may need to confirm the PaymentIntent again. - * For example, updating the payment_method will always require you to confirm the - * PaymentIntent again. If you prefer to update and confirm at the same time, we recommend - * updating properties via the confirm API instead. + *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by + * default). + * + *

Learn more about separate + * authorization and capture. */ - public PaymentIntent update(PaymentIntentUpdateParams params, RequestOptions options) + public PaymentIntent capture(PaymentIntentCaptureParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/payment_intents/%s", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_intents/%s/capture", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); } @@ -898,403 +889,476 @@ public PaymentIntent confirm(PaymentIntentConfirmParams params) throws StripeExc } /** - * Confirm that your customer intends to pay with current or provided payment method. Upon - * confirmation, the PaymentIntent will attempt to initiate a payment. + * Confirm that your customer intends to pay with current or provided payment method. Upon + * confirmation, the PaymentIntent will attempt to initiate a payment. + * + *

If the selected payment method requires additional authentication steps, the PaymentIntent + * will transition to the requires_action status and suggest additional actions via + * next_action. If payment fails, the PaymentIntent will transition to the + * requires_payment_method status. If payment succeeds, the PaymentIntent will transition + * to the succeeded status (or requires_capture, if capture_method + * is set to manual). + * + *

If the confirmation_method is automatic, payment may be attempted + * using our client SDKs + * and the PaymentIntent’s client_secret. After + * next_actions are handled by the client, no additional confirmation is required to + * complete the payment. + * + *

If the confirmation_method is manual, all payment attempts must be + * initiated using a secret key. If any actions are required for the payment, the PaymentIntent + * will return to the requires_confirmation state after those actions are completed. + * Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment + * attempt. Read the expanded documentation + * to learn more about manual confirmation. + */ + public PaymentIntent confirm(PaymentIntentConfirmParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/payment_intents/%s/confirm", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); + } + + /** + * Creates a PaymentIntent object. + * + *

After the PaymentIntent is created, attach a payment method and confirm to continue the payment. + * You can read more about the different payment flows available via the Payment Intents API here. + * + *

When confirm=true is used during creation, it is equivalent to creating and + * confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when + * confirm=true is supplied. + */ + public static PaymentIntent create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Creates a PaymentIntent object. + * + *

After the PaymentIntent is created, attach a payment method and confirm to continue the payment. + * You can read more about the different payment flows available via the Payment Intents API here. + * + *

When confirm=true is used during creation, it is equivalent to creating and + * confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when + * confirm=true is supplied. + */ + public static PaymentIntent create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); + } + + /** + * Creates a PaymentIntent object. + * + *

After the PaymentIntent is created, attach a payment method and confirm to continue the payment. + * You can read more about the different payment flows available via the Payment Intents API here. + * + *

When confirm=true is used during creation, it is equivalent to creating and + * confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when + * confirm=true is supplied. + */ + public static PaymentIntent create(PaymentIntentCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Creates a PaymentIntent object. + * + *

After the PaymentIntent is created, attach a payment method and confirm to continue the payment. + * You can read more about the different payment flows available via the Payment Intents API here. + * + *

When confirm=true is used during creation, it is equivalent to creating and + * confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when + * confirm=true is supplied. + */ + public static PaymentIntent create(PaymentIntentCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); + } + + /** + * Perform an incremental authorization on an eligible PaymentIntent. To be eligible, + * the PaymentIntent’s status must be requires_capture and incremental_authorization_supported + * must be true. + * + *

Incremental authorizations attempt to increase the authorized amount on your customer’s card + * to the new, higher amount provided. As with the initial authorization, incremental + * authorizations may be declined. A single PaymentIntent can call this endpoint multiple times to + * further increase the authorized amount. + * + *

If the incremental authorization succeeds, the PaymentIntent object is returned with the + * updated amount. + * If the incremental authorization fails, a card_declined error is returned, + * and no fields on the PaymentIntent or Charge are updated. The PaymentIntent object remains + * capturable for the previously authorized amount. + * + *

Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including + * declines. Once captured, a PaymentIntent can no longer be incremented. + * + *

Learn more about incremental + * authorizations. + */ + public PaymentIntent incrementAuthorization(Map params) throws StripeException { + return incrementAuthorization(params, (RequestOptions) null); + } + + /** + * Perform an incremental authorization on an eligible PaymentIntent. To be eligible, + * the PaymentIntent’s status must be requires_capture and incremental_authorization_supported + * must be true. + * + *

Incremental authorizations attempt to increase the authorized amount on your customer’s card + * to the new, higher amount provided. As with the initial authorization, incremental + * authorizations may be declined. A single PaymentIntent can call this endpoint multiple times to + * further increase the authorized amount. + * + *

If the incremental authorization succeeds, the PaymentIntent object is returned with the + * updated amount. + * If the incremental authorization fails, a card_declined error is returned, + * and no fields on the PaymentIntent or Charge are updated. The PaymentIntent object remains + * capturable for the previously authorized amount. + * + *

Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including + * declines. Once captured, a PaymentIntent can no longer be incremented. + * + *

Learn more about incremental + * authorizations. + */ + public PaymentIntent incrementAuthorization(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/payment_intents/%s/increment_authorization", + ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); + } + + /** + * Perform an incremental authorization on an eligible PaymentIntent. To be eligible, + * the PaymentIntent’s status must be requires_capture and incremental_authorization_supported + * must be true. + * + *

Incremental authorizations attempt to increase the authorized amount on your customer’s card + * to the new, higher amount provided. As with the initial authorization, incremental + * authorizations may be declined. A single PaymentIntent can call this endpoint multiple times to + * further increase the authorized amount. + * + *

If the incremental authorization succeeds, the PaymentIntent object is returned with the + * updated amount. + * If the incremental authorization fails, a card_declined error is returned, + * and no fields on the PaymentIntent or Charge are updated. The PaymentIntent object remains + * capturable for the previously authorized amount. + * + *

Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including + * declines. Once captured, a PaymentIntent can no longer be incremented. + * + *

Learn more about incremental + * authorizations. + */ + public PaymentIntent incrementAuthorization(PaymentIntentIncrementAuthorizationParams params) + throws StripeException { + return incrementAuthorization(params, (RequestOptions) null); + } + + /** + * Perform an incremental authorization on an eligible PaymentIntent. To be eligible, + * the PaymentIntent’s status must be requires_capture and incremental_authorization_supported + * must be true. * - *

If the selected payment method requires additional authentication steps, the PaymentIntent - * will transition to the requires_action status and suggest additional actions via - * next_action. If payment fails, the PaymentIntent will transition to the - * requires_payment_method status. If payment succeeds, the PaymentIntent will transition - * to the succeeded status (or requires_capture, if capture_method - * is set to manual). + *

Incremental authorizations attempt to increase the authorized amount on your customer’s card + * to the new, higher amount provided. As with the initial authorization, incremental + * authorizations may be declined. A single PaymentIntent can call this endpoint multiple times to + * further increase the authorized amount. * - *

If the confirmation_method is automatic, payment may be attempted - * using our client SDKs - * and the PaymentIntent’s client_secret. After - * next_actions are handled by the client, no additional confirmation is required to - * complete the payment. + *

If the incremental authorization succeeds, the PaymentIntent object is returned with the + * updated amount. + * If the incremental authorization fails, a card_declined error is returned, + * and no fields on the PaymentIntent or Charge are updated. The PaymentIntent object remains + * capturable for the previously authorized amount. * - *

If the confirmation_method is manual, all payment attempts must be - * initiated using a secret key. If any actions are required for the payment, the PaymentIntent - * will return to the requires_confirmation state after those actions are completed. - * Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment - * attempt. Read the expanded documentation - * to learn more about manual confirmation. + *

Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including + * declines. Once captured, a PaymentIntent can no longer be incremented. + * + *

Learn more about incremental + * authorizations. */ - public PaymentIntent confirm(PaymentIntentConfirmParams params, RequestOptions options) + public PaymentIntent incrementAuthorization( + PaymentIntentIncrementAuthorizationParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/payment_intents/%s/confirm", ApiResource.urlEncodeId(this.getId()))); + String.format( + "/v1/payment_intents/%s/increment_authorization", + ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); } - /** - * A PaymentIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_capture, requires_confirmation - * , requires_action, or processing. - * - *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on - * the PaymentIntent will fail with an error. For PaymentIntents with - * status=’requires_capture’, the remaining amount_capturable will - * automatically be refunded. - * - *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead - */ - public PaymentIntent cancel() throws StripeException { - return cancel((Map) null, (RequestOptions) null); + /** Returns a list of PaymentIntents. */ + public static PaymentIntentCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of PaymentIntents. */ + public static PaymentIntentCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents"); + return ApiResource.requestCollection(url, params, PaymentIntentCollection.class, options); + } + + /** Returns a list of PaymentIntents. */ + public static PaymentIntentCollection list(PaymentIntentListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of PaymentIntents. */ + public static PaymentIntentCollection list(PaymentIntentListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents"); + return ApiResource.requestCollection(url, params, PaymentIntentCollection.class, options); } /** - * A PaymentIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_capture, requires_confirmation - * , requires_action, or processing. + * Retrieves the details of a PaymentIntent that has previously been created. * - *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on - * the PaymentIntent will fail with an error. For PaymentIntents with - * status=’requires_capture’, the remaining amount_capturable will - * automatically be refunded. + *

Client-side retrieval using a publishable key is allowed when the client_secret + * is provided in the query string. * - *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead + *

When retrieved with a publishable key, only a subset of properties will be returned. Please + * refer to the payment intent + * object reference for more details. */ - public PaymentIntent cancel(RequestOptions options) throws StripeException { - return cancel((Map) null, options); + public static PaymentIntent retrieve(String intent) throws StripeException { + return retrieve(intent, (Map) null, (RequestOptions) null); } /** - * A PaymentIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_capture, requires_confirmation - * , requires_action, or processing. + * Retrieves the details of a PaymentIntent that has previously been created. * - *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on - * the PaymentIntent will fail with an error. For PaymentIntents with - * status=’requires_capture’, the remaining amount_capturable will - * automatically be refunded. + *

Client-side retrieval using a publishable key is allowed when the client_secret + * is provided in the query string. * - *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead + *

When retrieved with a publishable key, only a subset of properties will be returned. Please + * refer to the payment intent + * object reference for more details. */ - public PaymentIntent cancel(Map params) throws StripeException { - return cancel(params, (RequestOptions) null); + public static PaymentIntent retrieve(String intent, RequestOptions options) + throws StripeException { + return retrieve(intent, (Map) null, options); } /** - * A PaymentIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_capture, requires_confirmation - * , requires_action, or processing. + * Retrieves the details of a PaymentIntent that has previously been created. * - *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on - * the PaymentIntent will fail with an error. For PaymentIntents with - * status=’requires_capture’, the remaining amount_capturable will - * automatically be refunded. + *

Client-side retrieval using a publishable key is allowed when the client_secret + * is provided in the query string. * - *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead + *

When retrieved with a publishable key, only a subset of properties will be returned. Please + * refer to the payment intent + * object reference for more details. */ - public PaymentIntent cancel(Map params, RequestOptions options) - throws StripeException { + public static PaymentIntent retrieve( + String intent, Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/payment_intents/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_intents/%s", ApiResource.urlEncodeId(intent))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); - } - - /** - * A PaymentIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_capture, requires_confirmation - * , requires_action, or processing. - * - *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on - * the PaymentIntent will fail with an error. For PaymentIntents with - * status=’requires_capture’, the remaining amount_capturable will - * automatically be refunded. - * - *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead - */ - public PaymentIntent cancel(PaymentIntentCancelParams params) throws StripeException { - return cancel(params, (RequestOptions) null); + ApiResource.RequestMethod.GET, url, params, PaymentIntent.class, options); } /** - * A PaymentIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_capture, requires_confirmation - * , requires_action, or processing. + * Retrieves the details of a PaymentIntent that has previously been created. * - *

Once canceled, no additional charges will be made by the PaymentIntent and any operations on - * the PaymentIntent will fail with an error. For PaymentIntents with - * status=’requires_capture’, the remaining amount_capturable will - * automatically be refunded. + *

Client-side retrieval using a publishable key is allowed when the client_secret + * is provided in the query string. * - *

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead + *

When retrieved with a publishable key, only a subset of properties will be returned. Please + * refer to the payment intent + * object reference for more details. */ - public PaymentIntent cancel(PaymentIntentCancelParams params, RequestOptions options) + public static PaymentIntent retrieve( + String intent, PaymentIntentRetrieveParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/payment_intents/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_intents/%s", ApiResource.urlEncodeId(intent))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); - } - - /** - * Capture the funds of an existing uncaptured PaymentIntent when its status is - * requires_capture. - * - *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by - * default). - * - *

Learn more about separate - * authorization and capture. - */ - public PaymentIntent capture() throws StripeException { - return capture((Map) null, (RequestOptions) null); - } - - /** - * Capture the funds of an existing uncaptured PaymentIntent when its status is - * requires_capture. - * - *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by - * default). - * - *

Learn more about separate - * authorization and capture. - */ - public PaymentIntent capture(RequestOptions options) throws StripeException { - return capture((Map) null, options); + ApiResource.RequestMethod.GET, url, params, PaymentIntent.class, options); } /** - * Capture the funds of an existing uncaptured PaymentIntent when its status is - * requires_capture. - * - *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by - * default). - * - *

Learn more about separate - * authorization and capture. + * Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public PaymentIntent capture(Map params) throws StripeException { - return capture(params, (RequestOptions) null); + public static PaymentIntentSearchResult search(Map params) + throws StripeException { + return search(params, (RequestOptions) null); } /** - * Capture the funds of an existing uncaptured PaymentIntent when its status is - * requires_capture. - * - *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by - * default). - * - *

Learn more about separate - * authorization and capture. + * Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public PaymentIntent capture(Map params, RequestOptions options) + public static PaymentIntentSearchResult search(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/payment_intents/%s/capture", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents/search"); + return ApiResource.requestSearchResult(url, params, PaymentIntentSearchResult.class, options); } /** - * Capture the funds of an existing uncaptured PaymentIntent when its status is - * requires_capture. - * - *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by - * default). - * - *

Learn more about separate - * authorization and capture. + * Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public PaymentIntent capture(PaymentIntentCaptureParams params) throws StripeException { - return capture(params, (RequestOptions) null); + public static PaymentIntentSearchResult search(PaymentIntentSearchParams params) + throws StripeException { + return search(params, (RequestOptions) null); } /** - * Capture the funds of an existing uncaptured PaymentIntent when its status is - * requires_capture. - * - *

Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by - * default). - * - *

Learn more about separate - * authorization and capture. + * Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public PaymentIntent capture(PaymentIntentCaptureParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/payment_intents/%s/capture", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); + public static PaymentIntentSearchResult search( + PaymentIntentSearchParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_intents/search"); + return ApiResource.requestSearchResult(url, params, PaymentIntentSearchResult.class, options); } /** - * Perform an incremental authorization on an eligible PaymentIntent. To be eligible, - * the PaymentIntent’s status must be requires_capture and incremental_authorization_supported - * must be true. - * - *

Incremental authorizations attempt to increase the authorized amount on your customer’s card - * to the new, higher amount provided. As with the initial authorization, incremental - * authorizations may be declined. A single PaymentIntent can call this endpoint multiple times to - * further increase the authorized amount. - * - *

If the incremental authorization succeeds, the PaymentIntent object is returned with the - * updated amount. - * If the incremental authorization fails, a card_declined error is returned, - * and no fields on the PaymentIntent or Charge are updated. The PaymentIntent object remains - * capturable for the previously authorized amount. - * - *

Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including - * declines. Once captured, a PaymentIntent can no longer be incremented. + * Updates properties on a PaymentIntent object without confirming. * - *

Learn more about incremental - * authorizations. + *

Depending on which properties you update, you may need to confirm the PaymentIntent again. + * For example, updating the payment_method will always require you to confirm the + * PaymentIntent again. If you prefer to update and confirm at the same time, we recommend + * updating properties via the confirm API instead. */ - public PaymentIntent incrementAuthorization(Map params) throws StripeException { - return incrementAuthorization(params, (RequestOptions) null); + @Override + public PaymentIntent update(Map params) throws StripeException { + return update(params, (RequestOptions) null); } /** - * Perform an incremental authorization on an eligible PaymentIntent. To be eligible, - * the PaymentIntent’s status must be requires_capture and incremental_authorization_supported - * must be true. - * - *

Incremental authorizations attempt to increase the authorized amount on your customer’s card - * to the new, higher amount provided. As with the initial authorization, incremental - * authorizations may be declined. A single PaymentIntent can call this endpoint multiple times to - * further increase the authorized amount. - * - *

If the incremental authorization succeeds, the PaymentIntent object is returned with the - * updated amount. - * If the incremental authorization fails, a card_declined error is returned, - * and no fields on the PaymentIntent or Charge are updated. The PaymentIntent object remains - * capturable for the previously authorized amount. - * - *

Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including - * declines. Once captured, a PaymentIntent can no longer be incremented. + * Updates properties on a PaymentIntent object without confirming. * - *

Learn more about incremental - * authorizations. + *

Depending on which properties you update, you may need to confirm the PaymentIntent again. + * For example, updating the payment_method will always require you to confirm the + * PaymentIntent again. If you prefer to update and confirm at the same time, we recommend + * updating properties via the confirm API instead. */ - public PaymentIntent incrementAuthorization(Map params, RequestOptions options) + @Override + public PaymentIntent update(Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format( - "/v1/payment_intents/%s/increment_authorization", - ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_intents/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); } /** - * Perform an incremental authorization on an eligible PaymentIntent. To be eligible, - * the PaymentIntent’s status must be requires_capture and incremental_authorization_supported - * must be true. - * - *

Incremental authorizations attempt to increase the authorized amount on your customer’s card - * to the new, higher amount provided. As with the initial authorization, incremental - * authorizations may be declined. A single PaymentIntent can call this endpoint multiple times to - * further increase the authorized amount. - * - *

If the incremental authorization succeeds, the PaymentIntent object is returned with the - * updated amount. - * If the incremental authorization fails, a card_declined error is returned, - * and no fields on the PaymentIntent or Charge are updated. The PaymentIntent object remains - * capturable for the previously authorized amount. - * - *

Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including - * declines. Once captured, a PaymentIntent can no longer be incremented. + * Updates properties on a PaymentIntent object without confirming. * - *

Learn more about incremental - * authorizations. + *

Depending on which properties you update, you may need to confirm the PaymentIntent again. + * For example, updating the payment_method will always require you to confirm the + * PaymentIntent again. If you prefer to update and confirm at the same time, we recommend + * updating properties via the confirm API instead. */ - public PaymentIntent incrementAuthorization(PaymentIntentIncrementAuthorizationParams params) - throws StripeException { - return incrementAuthorization(params, (RequestOptions) null); + public PaymentIntent update(PaymentIntentUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); } /** - * Perform an incremental authorization on an eligible PaymentIntent. To be eligible, - * the PaymentIntent’s status must be requires_capture and incremental_authorization_supported - * must be true. - * - *

Incremental authorizations attempt to increase the authorized amount on your customer’s card - * to the new, higher amount provided. As with the initial authorization, incremental - * authorizations may be declined. A single PaymentIntent can call this endpoint multiple times to - * further increase the authorized amount. - * - *

If the incremental authorization succeeds, the PaymentIntent object is returned with the - * updated amount. - * If the incremental authorization fails, a card_declined error is returned, - * and no fields on the PaymentIntent or Charge are updated. The PaymentIntent object remains - * capturable for the previously authorized amount. - * - *

Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including - * declines. Once captured, a PaymentIntent can no longer be incremented. + * Updates properties on a PaymentIntent object without confirming. * - *

Learn more about incremental - * authorizations. + *

Depending on which properties you update, you may need to confirm the PaymentIntent again. + * For example, updating the payment_method will always require you to confirm the + * PaymentIntent again. If you prefer to update and confirm at the same time, we recommend + * updating properties via the confirm API instead. */ - public PaymentIntent incrementAuthorization( - PaymentIntentIncrementAuthorizationParams params, RequestOptions options) + public PaymentIntent update(PaymentIntentUpdateParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format( - "/v1/payment_intents/%s/increment_authorization", - ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_intents/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); } @@ -1349,56 +1413,6 @@ public PaymentIntent verifyMicrodeposits( ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); } - /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ - public PaymentIntent applyCustomerBalance() throws StripeException { - return applyCustomerBalance((Map) null, (RequestOptions) null); - } - - /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ - public PaymentIntent applyCustomerBalance(RequestOptions options) throws StripeException { - return applyCustomerBalance((Map) null, options); - } - - /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ - public PaymentIntent applyCustomerBalance(Map params) throws StripeException { - return applyCustomerBalance(params, (RequestOptions) null); - } - - /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ - public PaymentIntent applyCustomerBalance(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/payment_intents/%s/apply_customer_balance", - ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); - } - - /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ - public PaymentIntent applyCustomerBalance(PaymentIntentApplyCustomerBalanceParams params) - throws StripeException { - return applyCustomerBalance(params, (RequestOptions) null); - } - - /** Manually reconcile the remaining amount for a customer_balance PaymentIntent. */ - public PaymentIntent applyCustomerBalance( - PaymentIntentApplyCustomerBalanceParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/payment_intents/%s/apply_customer_balance", - ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentIntent.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -1717,6 +1731,7 @@ public static class NextActionDisplayBankTransferInstructions extends StripeObje @SerializedName("type") String type; + /** FinancialAddresses contain identifying information that resolves to a FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -1749,6 +1764,7 @@ public static class FinancialAddress extends StripeObject { @SerializedName("zengin") Zengin zengin; + /** Iban Records contain E.U. bank account details per the SEPA format. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -1773,6 +1789,7 @@ public static class Iban extends StripeObject { String iban; } + /** Sort Code Records contain U.K. bank account details per the sort code format. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -1790,6 +1807,7 @@ public static class SortCode extends StripeObject { String sortCode; } + /** SPEI Records contain Mexico bank account details per the SPEI format. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -1807,6 +1825,7 @@ public static class Spei extends StripeObject { String clabe; } + /** Zengin Records contain Japan bank account details per the Zengin format. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/PaymentLink.java b/src/main/java/com/stripe/model/PaymentLink.java index ffe6434f026..50d86c74f38 100644 --- a/src/main/java/com/stripe/model/PaymentLink.java +++ b/src/main/java/com/stripe/model/PaymentLink.java @@ -18,6 +18,19 @@ import lombok.Getter; import lombok.Setter; +/** + * A payment link is a shareable URL that will take your customers to a hosted payment page. A + * payment link can be shared and used multiple times. + * + *

When a customer opens a payment link it will open a new checkout session to render the payment + * page. You can use checkout + * session events to track payments through payment links. + * + *

Related guide: Payment Links + * API + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -65,6 +78,13 @@ public class PaymentLink extends ApiResource implements HasId, MetadataStoreISO currency code, + * in lowercase. Must be a supported currency. + */ + @SerializedName("currency") + String currency; + /** * Configuration for Customer creation during checkout. * @@ -195,6 +215,32 @@ public void setOnBehalfOfObject(Account expandableObject) { this.onBehalfOf = new ExpandableField(expandableObject.getId(), expandableObject); } + /** Creates a payment link. */ + public static PaymentLink create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a payment link. */ + public static PaymentLink create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_links"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentLink.class, options); + } + + /** Creates a payment link. */ + public static PaymentLink create(PaymentLinkCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a payment link. */ + public static PaymentLink create(PaymentLinkCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_links"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentLink.class, options); + } + /** Returns a list of your payment links. */ public static PaymentLinkCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -219,43 +265,6 @@ public static PaymentLinkCollection list(PaymentLinkListParams params, RequestOp return ApiResource.requestCollection(url, params, PaymentLinkCollection.class, options); } - /** Retrieve a payment link. */ - public static PaymentLink retrieve(String paymentLink) throws StripeException { - return retrieve(paymentLink, (Map) null, (RequestOptions) null); - } - - /** Retrieve a payment link. */ - public static PaymentLink retrieve(String paymentLink, RequestOptions options) - throws StripeException { - return retrieve(paymentLink, (Map) null, options); - } - - /** Retrieve a payment link. */ - public static PaymentLink retrieve( - String paymentLink, Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/payment_links/%s", ApiResource.urlEncodeId(paymentLink))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, PaymentLink.class, options); - } - - /** Retrieve a payment link. */ - public static PaymentLink retrieve( - String paymentLink, PaymentLinkRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/payment_links/%s", ApiResource.urlEncodeId(paymentLink))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, PaymentLink.class, options); - } - /** * When retrieving a payment link, there is an includable line_items property * containing the first handful of those items. There is also a URL where you can retrieve the @@ -316,30 +325,41 @@ public LineItemCollection listLineItems( return ApiResource.requestCollection(url, params, LineItemCollection.class, options); } - /** Creates a payment link. */ - public static PaymentLink create(Map params) throws StripeException { - return create(params, (RequestOptions) null); + /** Retrieve a payment link. */ + public static PaymentLink retrieve(String paymentLink) throws StripeException { + return retrieve(paymentLink, (Map) null, (RequestOptions) null); } - /** Creates a payment link. */ - public static PaymentLink create(Map params, RequestOptions options) + /** Retrieve a payment link. */ + public static PaymentLink retrieve(String paymentLink, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_links"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentLink.class, options); + return retrieve(paymentLink, (Map) null, options); } - /** Creates a payment link. */ - public static PaymentLink create(PaymentLinkCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); + /** Retrieve a payment link. */ + public static PaymentLink retrieve( + String paymentLink, Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/payment_links/%s", ApiResource.urlEncodeId(paymentLink))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, PaymentLink.class, options); } - /** Creates a payment link. */ - public static PaymentLink create(PaymentLinkCreateParams params, RequestOptions options) + /** Retrieve a payment link. */ + public static PaymentLink retrieve( + String paymentLink, PaymentLinkRetrieveParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payment_links"); + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/payment_links/%s", ApiResource.urlEncodeId(paymentLink))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentLink.class, options); + ApiResource.RequestMethod.GET, url, params, PaymentLink.class, options); } /** Updates a payment link. */ diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index ea7dd6699b9..9d9b727a7bb 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -18,6 +18,14 @@ import lombok.Getter; import lombok.Setter; +/** + * PaymentMethod objects represent your customer's payment instruments. You can use them with PaymentIntents to collect payments or + * save them to Customer objects to store instrument details for future payments. + * + *

Related guides: Payment Methods + * and More Payment Scenarios. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -193,6 +201,108 @@ public void setCustomerObject(Customer expandableObject) { this.customer = new ExpandableField(expandableObject.getId(), expandableObject); } + /** + * Attaches a PaymentMethod object to a Customer. + * + *

To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. + * These approaches will perform any necessary steps to set up the PaymentMethod for future + * payments. Using the /v1/payment_methods/:id/attach endpoint without first using a + * SetupIntent or PaymentIntent with setup_future_usage does not optimize the + * PaymentMethod for future use, which makes later declines and payment friction more likely. See + * Optimizing cards for + * future payments for more information about setting up future payments. + * + *

To use this PaymentMethod as the default for invoice or subscription payments, set + * invoice_settings.default_payment_method, on the Customer to the + * PaymentMethod’s ID. + */ + public PaymentMethod attach(Map params) throws StripeException { + return attach(params, (RequestOptions) null); + } + + /** + * Attaches a PaymentMethod object to a Customer. + * + *

To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. + * These approaches will perform any necessary steps to set up the PaymentMethod for future + * payments. Using the /v1/payment_methods/:id/attach endpoint without first using a + * SetupIntent or PaymentIntent with setup_future_usage does not optimize the + * PaymentMethod for future use, which makes later declines and payment friction more likely. See + * Optimizing cards for + * future payments for more information about setting up future payments. + * + *

To use this PaymentMethod as the default for invoice or subscription payments, set + * invoice_settings.default_payment_method, on the Customer to the + * PaymentMethod’s ID. + */ + public PaymentMethod attach(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/payment_methods/%s/attach", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentMethod.class, options); + } + + /** + * Attaches a PaymentMethod object to a Customer. + * + *

To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. + * These approaches will perform any necessary steps to set up the PaymentMethod for future + * payments. Using the /v1/payment_methods/:id/attach endpoint without first using a + * SetupIntent or PaymentIntent with setup_future_usage does not optimize the + * PaymentMethod for future use, which makes later declines and payment friction more likely. See + * Optimizing cards for + * future payments for more information about setting up future payments. + * + *

To use this PaymentMethod as the default for invoice or subscription payments, set + * invoice_settings.default_payment_method, on the Customer to the + * PaymentMethod’s ID. + */ + public PaymentMethod attach(PaymentMethodAttachParams params) throws StripeException { + return attach(params, (RequestOptions) null); + } + + /** + * Attaches a PaymentMethod object to a Customer. + * + *

To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. + * These approaches will perform any necessary steps to set up the PaymentMethod for future + * payments. Using the /v1/payment_methods/:id/attach endpoint without first using a + * SetupIntent or PaymentIntent with setup_future_usage does not optimize the + * PaymentMethod for future use, which makes later declines and payment friction more likely. See + * Optimizing cards for + * future payments for more information about setting up future payments. + * + *

To use this PaymentMethod as the default for invoice or subscription payments, set + * invoice_settings.default_payment_method, on the Customer to the + * PaymentMethod’s ID. + */ + public PaymentMethod attach(PaymentMethodAttachParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/payment_methods/%s/attach", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentMethod.class, options); + } + /** * Creates a PaymentMethod object. Read the Stripe.js @@ -260,94 +370,63 @@ public static PaymentMethod create(PaymentMethodCreateParams params, RequestOpti } /** - * Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method - * attached to a Customer, you should use Retrieve a Customer’s - * PaymentMethods + * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no + * longer be used for a payment or re-attached to a Customer. */ - public static PaymentMethod retrieve(String paymentMethod) throws StripeException { - return retrieve(paymentMethod, (Map) null, (RequestOptions) null); + public PaymentMethod detach() throws StripeException { + return detach((Map) null, (RequestOptions) null); } /** - * Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method - * attached to a Customer, you should use Retrieve a Customer’s - * PaymentMethods + * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no + * longer be used for a payment or re-attached to a Customer. */ - public static PaymentMethod retrieve(String paymentMethod, RequestOptions options) - throws StripeException { - return retrieve(paymentMethod, (Map) null, options); + public PaymentMethod detach(RequestOptions options) throws StripeException { + return detach((Map) null, options); } /** - * Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method - * attached to a Customer, you should use Retrieve a Customer’s - * PaymentMethods + * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no + * longer be used for a payment or re-attached to a Customer. */ - public static PaymentMethod retrieve( - String paymentMethod, Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/payment_methods/%s", ApiResource.urlEncodeId(paymentMethod))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, PaymentMethod.class, options); + public PaymentMethod detach(Map params) throws StripeException { + return detach(params, (RequestOptions) null); } /** - * Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method - * attached to a Customer, you should use Retrieve a Customer’s - * PaymentMethods + * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no + * longer be used for a payment or re-attached to a Customer. */ - public static PaymentMethod retrieve( - String paymentMethod, PaymentMethodRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/payment_methods/%s", ApiResource.urlEncodeId(paymentMethod))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, PaymentMethod.class, options); - } - - /** Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. */ - @Override - public PaymentMethod update(Map params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. */ - @Override - public PaymentMethod update(Map params, RequestOptions options) + public PaymentMethod detach(Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/payment_methods/%s", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_methods/%s/detach", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, PaymentMethod.class, options); } - /** Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. */ - public PaymentMethod update(PaymentMethodUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + /** + * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no + * longer be used for a payment or re-attached to a Customer. + */ + public PaymentMethod detach(PaymentMethodDetachParams params) throws StripeException { + return detach(params, (RequestOptions) null); } - /** Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. */ - public PaymentMethod update(PaymentMethodUpdateParams params, RequestOptions options) + /** + * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no + * longer be used for a payment or re-attached to a Customer. + */ + public PaymentMethod detach(PaymentMethodDetachParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/payment_methods/%s", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_methods/%s/detach", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, PaymentMethod.class, options); } @@ -398,165 +477,94 @@ public static PaymentMethodCollection list(PaymentMethodListParams params, Reque } /** - * Attaches a PaymentMethod object to a Customer. - * - *

To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. - * These approaches will perform any necessary steps to set up the PaymentMethod for future - * payments. Using the /v1/payment_methods/:id/attach endpoint without first using a - * SetupIntent or PaymentIntent with setup_future_usage does not optimize the - * PaymentMethod for future use, which makes later declines and payment friction more likely. See - * Optimizing cards for - * future payments for more information about setting up future payments. - * - *

To use this PaymentMethod as the default for invoice or subscription payments, set - * invoice_settings.default_payment_method, on the Customer to the - * PaymentMethod’s ID. + * Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method + * attached to a Customer, you should use Retrieve a Customer’s + * PaymentMethods */ - public PaymentMethod attach(Map params) throws StripeException { - return attach(params, (RequestOptions) null); + public static PaymentMethod retrieve(String paymentMethod) throws StripeException { + return retrieve(paymentMethod, (Map) null, (RequestOptions) null); } /** - * Attaches a PaymentMethod object to a Customer. - * - *

To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. - * These approaches will perform any necessary steps to set up the PaymentMethod for future - * payments. Using the /v1/payment_methods/:id/attach endpoint without first using a - * SetupIntent or PaymentIntent with setup_future_usage does not optimize the - * PaymentMethod for future use, which makes later declines and payment friction more likely. See - * Optimizing cards for - * future payments for more information about setting up future payments. - * - *

To use this PaymentMethod as the default for invoice or subscription payments, set - * invoice_settings.default_payment_method, on the Customer to the - * PaymentMethod’s ID. + * Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method + * attached to a Customer, you should use Retrieve a Customer’s + * PaymentMethods */ - public PaymentMethod attach(Map params, RequestOptions options) + public static PaymentMethod retrieve(String paymentMethod, RequestOptions options) + throws StripeException { + return retrieve(paymentMethod, (Map) null, options); + } + + /** + * Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method + * attached to a Customer, you should use Retrieve a Customer’s + * PaymentMethods + */ + public static PaymentMethod retrieve( + String paymentMethod, Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/payment_methods/%s/attach", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_methods/%s", ApiResource.urlEncodeId(paymentMethod))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentMethod.class, options); - } - - /** - * Attaches a PaymentMethod object to a Customer. - * - *

To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. - * These approaches will perform any necessary steps to set up the PaymentMethod for future - * payments. Using the /v1/payment_methods/:id/attach endpoint without first using a - * SetupIntent or PaymentIntent with setup_future_usage does not optimize the - * PaymentMethod for future use, which makes later declines and payment friction more likely. See - * Optimizing cards for - * future payments for more information about setting up future payments. - * - *

To use this PaymentMethod as the default for invoice or subscription payments, set - * invoice_settings.default_payment_method, on the Customer to the - * PaymentMethod’s ID. - */ - public PaymentMethod attach(PaymentMethodAttachParams params) throws StripeException { - return attach(params, (RequestOptions) null); + ApiResource.RequestMethod.GET, url, params, PaymentMethod.class, options); } /** - * Attaches a PaymentMethod object to a Customer. - * - *

To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. - * These approaches will perform any necessary steps to set up the PaymentMethod for future - * payments. Using the /v1/payment_methods/:id/attach endpoint without first using a - * SetupIntent or PaymentIntent with setup_future_usage does not optimize the - * PaymentMethod for future use, which makes later declines and payment friction more likely. See - * Optimizing cards for - * future payments for more information about setting up future payments. - * - *

To use this PaymentMethod as the default for invoice or subscription payments, set - * invoice_settings.default_payment_method, on the Customer to the - * PaymentMethod’s ID. + * Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method + * attached to a Customer, you should use Retrieve a Customer’s + * PaymentMethods */ - public PaymentMethod attach(PaymentMethodAttachParams params, RequestOptions options) + public static PaymentMethod retrieve( + String paymentMethod, PaymentMethodRetrieveParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/payment_methods/%s/attach", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_methods/%s", ApiResource.urlEncodeId(paymentMethod))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentMethod.class, options); - } - - /** - * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no - * longer be used for a payment or re-attached to a Customer. - */ - public PaymentMethod detach() throws StripeException { - return detach((Map) null, (RequestOptions) null); - } - - /** - * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no - * longer be used for a payment or re-attached to a Customer. - */ - public PaymentMethod detach(RequestOptions options) throws StripeException { - return detach((Map) null, options); + ApiResource.RequestMethod.GET, url, params, PaymentMethod.class, options); } - /** - * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no - * longer be used for a payment or re-attached to a Customer. - */ - public PaymentMethod detach(Map params) throws StripeException { - return detach(params, (RequestOptions) null); + /** Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. */ + @Override + public PaymentMethod update(Map params) throws StripeException { + return update(params, (RequestOptions) null); } - /** - * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no - * longer be used for a payment or re-attached to a Customer. - */ - public PaymentMethod detach(Map params, RequestOptions options) + /** Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. */ + @Override + public PaymentMethod update(Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/payment_methods/%s/detach", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_methods/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, PaymentMethod.class, options); } - /** - * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no - * longer be used for a payment or re-attached to a Customer. - */ - public PaymentMethod detach(PaymentMethodDetachParams params) throws StripeException { - return detach(params, (RequestOptions) null); + /** Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. */ + public PaymentMethod update(PaymentMethodUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); } - /** - * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no - * longer be used for a payment or re-attached to a Customer. - */ - public PaymentMethod detach(PaymentMethodDetachParams params, RequestOptions options) + /** Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. */ + public PaymentMethod update(PaymentMethodUpdateParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/payment_methods/%s/detach", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/payment_methods/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, PaymentMethod.class, options); } @@ -1108,6 +1116,10 @@ public static class Paynow extends StripeObject {} @EqualsAndHashCode(callSuper = false) public static class Promptpay extends StripeObject {} + /** + * Options to configure Radar. See Radar + * Session for more information. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/PaymentSourceCollection.java b/src/main/java/com/stripe/model/PaymentSourceCollection.java index e65bd47e050..1a1d31d0e7d 100644 --- a/src/main/java/com/stripe/model/PaymentSourceCollection.java +++ b/src/main/java/com/stripe/model/PaymentSourceCollection.java @@ -11,6 +11,64 @@ import java.util.Map; public class PaymentSourceCollection extends StripeCollection { + /** + * When you create a new credit card, you must specify a customer or recipient on which to create + * it. + * + *

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 + * default_source. + */ + public PaymentSource create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * When you create a new credit card, you must specify a customer or recipient on which to create + * it. + * + *

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 + * default_source. + */ + public PaymentSource create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentSource.class, options); + } + + /** + * When you create a new credit card, you must specify a customer or recipient on which to create + * it. + * + *

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 + * default_source. + */ + public PaymentSource create(PaymentSourceCollectionCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * When you create a new credit card, you must specify a customer or recipient on which to create + * it. + * + *

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 + * default_source. + */ + public PaymentSource create(PaymentSourceCollectionCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PaymentSource.class, options); + } + /** List sources for a specified customer. */ public PaymentSourceCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -70,62 +128,4 @@ public PaymentSource retrieve( return ApiResource.request( ApiResource.RequestMethod.GET, url, params, PaymentSource.class, options); } - - /** - * When you create a new credit card, you must specify a customer or recipient on which to create - * it. - * - *

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 - * default_source. - */ - public PaymentSource create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * When you create a new credit card, you must specify a customer or recipient on which to create - * it. - * - *

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 - * default_source. - */ - public PaymentSource create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentSource.class, options); - } - - /** - * When you create a new credit card, you must specify a customer or recipient on which to create - * it. - * - *

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 - * default_source. - */ - public PaymentSource create(PaymentSourceCollectionCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * When you create a new credit card, you must specify a customer or recipient on which to create - * it. - * - *

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 - * default_source. - */ - public PaymentSource create(PaymentSourceCollectionCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PaymentSource.class, options); - } } diff --git a/src/main/java/com/stripe/model/Payout.java b/src/main/java/com/stripe/model/Payout.java index 40ae5a27587..5d921e61284 100644 --- a/src/main/java/com/stripe/model/Payout.java +++ b/src/main/java/com/stripe/model/Payout.java @@ -17,6 +17,16 @@ import lombok.Getter; import lombok.Setter; +/** + * A {@code Payout} object is created when you receive funds from Stripe, or when you initiate a + * payout to either a bank account or debit card of a connected Stripe account. You + * can retrieve individual payouts, as well as list all payouts. Payouts are made on varying schedules, depending on + * your country and industry. + * + *

Related guide: Receiving Payouts. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -264,89 +274,61 @@ public void setReversedByObject(Payout expandableObject) { } /** - * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout - * creation request or the payout list, and Stripe will return the corresponding payout - * information. + * A previously created payout can be canceled if it has not yet been paid out. Funds will be + * refunded to your available balance. You may not cancel automatic Stripe payouts. */ - public static Payout retrieve(String payout) throws StripeException { - return retrieve(payout, (Map) null, (RequestOptions) null); + public Payout cancel() throws StripeException { + return cancel((Map) null, (RequestOptions) null); } /** - * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout - * creation request or the payout list, and Stripe will return the corresponding payout - * information. + * A previously created payout can be canceled if it has not yet been paid out. Funds will be + * refunded to your available balance. You may not cancel automatic Stripe payouts. */ - public static Payout retrieve(String payout, RequestOptions options) throws StripeException { - return retrieve(payout, (Map) null, options); + public Payout cancel(RequestOptions options) throws StripeException { + return cancel((Map) null, options); } /** - * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout - * creation request or the payout list, and Stripe will return the corresponding payout - * information. + * A previously created payout can be canceled if it has not yet been paid out. Funds will be + * refunded to your available balance. You may not cancel automatic Stripe payouts. */ - public static Payout retrieve(String payout, Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), String.format("/v1/payouts/%s", ApiResource.urlEncodeId(payout))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Payout.class, options); + public Payout cancel(Map params) throws StripeException { + return cancel(params, (RequestOptions) null); } /** - * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout - * creation request or the payout list, and Stripe will return the corresponding payout - * information. + * A previously created payout can be canceled if it has not yet been paid out. Funds will be + * refunded to your available balance. You may not cancel automatic Stripe payouts. */ - public static Payout retrieve(String payout, PayoutRetrieveParams params, RequestOptions options) - throws StripeException { + public Payout cancel(Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", - Stripe.getApiBase(), String.format("/v1/payouts/%s", ApiResource.urlEncodeId(payout))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Payout.class, options); - } - - /** - * Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent - * you. The payouts are returned in sorted order, with the most recently created payouts appearing - * first. - */ - public static PayoutCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** - * Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent - * you. The payouts are returned in sorted order, with the most recently created payouts appearing - * first. - */ - public static PayoutCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payouts"); - return ApiResource.requestCollection(url, params, PayoutCollection.class, options); + Stripe.getApiBase(), + String.format("/v1/payouts/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Payout.class, options); } /** - * Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent - * you. The payouts are returned in sorted order, with the most recently created payouts appearing - * first. + * A previously created payout can be canceled if it has not yet been paid out. Funds will be + * refunded to your available balance. You may not cancel automatic Stripe payouts. */ - public static PayoutCollection list(PayoutListParams params) throws StripeException { - return list(params, (RequestOptions) null); + public Payout cancel(PayoutCancelParams params) throws StripeException { + return cancel(params, (RequestOptions) null); } /** - * Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent - * you. The payouts are returned in sorted order, with the most recently created payouts appearing - * first. + * A previously created payout can be canceled if it has not yet been paid out. Funds will be + * refunded to your available balance. You may not cancel automatic Stripe payouts. */ - public static PayoutCollection list(PayoutListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payouts"); - return ApiResource.requestCollection(url, params, PayoutCollection.class, options); + public Payout cancel(PayoutCancelParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/payouts/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Payout.class, options); } /** @@ -422,105 +404,89 @@ public static Payout create(PayoutCreateParams params, RequestOptions options) } /** - * Updates the specified payout by setting the values of the parameters passed. Any parameters not - * provided will be left unchanged. This request accepts only the metadata as arguments. - */ - @Override - public Payout update(Map params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** - * Updates the specified payout by setting the values of the parameters passed. Any parameters not - * provided will be left unchanged. This request accepts only the metadata as arguments. + * Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent + * you. The payouts are returned in sorted order, with the most recently created payouts appearing + * first. */ - @Override - public Payout update(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/payouts/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Payout.class, options); + public static PayoutCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); } /** - * Updates the specified payout by setting the values of the parameters passed. Any parameters not - * provided will be left unchanged. This request accepts only the metadata as arguments. + * Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent + * you. The payouts are returned in sorted order, with the most recently created payouts appearing + * first. */ - public Payout update(PayoutUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + public static PayoutCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payouts"); + return ApiResource.requestCollection(url, params, PayoutCollection.class, options); } /** - * Updates the specified payout by setting the values of the parameters passed. Any parameters not - * provided will be left unchanged. This request accepts only the metadata as arguments. + * Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent + * you. The payouts are returned in sorted order, with the most recently created payouts appearing + * first. */ - public Payout update(PayoutUpdateParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/payouts/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Payout.class, options); + public static PayoutCollection list(PayoutListParams params) throws StripeException { + return list(params, (RequestOptions) null); } /** - * A previously created payout can be canceled if it has not yet been paid out. Funds will be - * refunded to your available balance. You may not cancel automatic Stripe payouts. + * Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent + * you. The payouts are returned in sorted order, with the most recently created payouts appearing + * first. */ - public Payout cancel() throws StripeException { - return cancel((Map) null, (RequestOptions) null); + public static PayoutCollection list(PayoutListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/payouts"); + return ApiResource.requestCollection(url, params, PayoutCollection.class, options); } /** - * A previously created payout can be canceled if it has not yet been paid out. Funds will be - * refunded to your available balance. You may not cancel automatic Stripe payouts. + * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout + * creation request or the payout list, and Stripe will return the corresponding payout + * information. */ - public Payout cancel(RequestOptions options) throws StripeException { - return cancel((Map) null, options); + public static Payout retrieve(String payout) throws StripeException { + return retrieve(payout, (Map) null, (RequestOptions) null); } /** - * A previously created payout can be canceled if it has not yet been paid out. Funds will be - * refunded to your available balance. You may not cancel automatic Stripe payouts. + * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout + * creation request or the payout list, and Stripe will return the corresponding payout + * information. */ - public Payout cancel(Map params) throws StripeException { - return cancel(params, (RequestOptions) null); + public static Payout retrieve(String payout, RequestOptions options) throws StripeException { + return retrieve(payout, (Map) null, options); } /** - * A previously created payout can be canceled if it has not yet been paid out. Funds will be - * refunded to your available balance. You may not cancel automatic Stripe payouts. + * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout + * creation request or the payout list, and Stripe will return the corresponding payout + * information. */ - public Payout cancel(Map params, RequestOptions options) throws StripeException { + public static Payout retrieve(String payout, Map params, RequestOptions options) + throws StripeException { String url = String.format( "%s%s", - Stripe.getApiBase(), - String.format("/v1/payouts/%s/cancel", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Payout.class, options); - } - - /** - * A previously created payout can be canceled if it has not yet been paid out. Funds will be - * refunded to your available balance. You may not cancel automatic Stripe payouts. - */ - public Payout cancel(PayoutCancelParams params) throws StripeException { - return cancel(params, (RequestOptions) null); + Stripe.getApiBase(), String.format("/v1/payouts/%s", ApiResource.urlEncodeId(payout))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Payout.class, options); } /** - * A previously created payout can be canceled if it has not yet been paid out. Funds will be - * refunded to your available balance. You may not cancel automatic Stripe payouts. + * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout + * creation request or the payout list, and Stripe will return the corresponding payout + * information. */ - public Payout cancel(PayoutCancelParams params, RequestOptions options) throws StripeException { + public static Payout retrieve(String payout, PayoutRetrieveParams params, RequestOptions options) + throws StripeException { String url = String.format( "%s%s", - Stripe.getApiBase(), - String.format("/v1/payouts/%s/cancel", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Payout.class, options); + Stripe.getApiBase(), String.format("/v1/payouts/%s", ApiResource.urlEncodeId(payout))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Payout.class, options); } /** @@ -610,4 +576,48 @@ public Payout reverse(PayoutReverseParams params, RequestOptions options) throws String.format("/v1/payouts/%s/reverse", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Payout.class, options); } + + /** + * Updates the specified payout by setting the values of the parameters passed. Any parameters not + * provided will be left unchanged. This request accepts only the metadata as arguments. + */ + @Override + public Payout update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates the specified payout by setting the values of the parameters passed. Any parameters not + * provided will be left unchanged. This request accepts only the metadata as arguments. + */ + @Override + public Payout update(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/payouts/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Payout.class, options); + } + + /** + * Updates the specified payout by setting the values of the parameters passed. Any parameters not + * provided will be left unchanged. This request accepts only the metadata as arguments. + */ + public Payout update(PayoutUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates the specified payout by setting the values of the parameters passed. Any parameters not + * provided will be left unchanged. This request accepts only the metadata as arguments. + */ + public Payout update(PayoutUpdateParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/payouts/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Payout.class, options); + } } diff --git a/src/main/java/com/stripe/model/Person.java b/src/main/java/com/stripe/model/Person.java index 3a71c40d1e9..e5d7dec8fae 100644 --- a/src/main/java/com/stripe/model/Person.java +++ b/src/main/java/com/stripe/model/Person.java @@ -14,6 +14,19 @@ import lombok.Getter; import lombok.Setter; +/** + * This is an object representing a person associated with a Stripe account. + * + *

A platform cannot access a Standard or Express account's persons after the account starts + * onboarding, such as after generating an account link for the account. See the Standard onboarding or Express onboarding documentation for + * information about platform pre-filling and account onboarding steps. + * + *

Related guide: Handling + * Identity Verification with the API. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -165,42 +178,6 @@ public class Person extends ApiResource implements HasId, MetadataStore @SerializedName("verification") Verification verification; - /** Updates an existing person. */ - @Override - public Person update(Map params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** Updates an existing person. */ - @Override - public Person update(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/accounts/%s/persons/%s", - ApiResource.urlEncodeId(this.getAccount()), ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Person.class, options); - } - - /** Updates an existing person. */ - public Person update(PersonUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** Updates an existing person. */ - public Person update(PersonUpdateParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/accounts/%s/persons/%s", - ApiResource.urlEncodeId(this.getAccount()), ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Person.class, options); - } - /** * Deletes an existing person’s relationship to the account’s legal entity. Any person with a * relationship for an account can be deleted through the API, except if the person is the @@ -249,6 +226,42 @@ public Person delete(Map params, RequestOptions options) throws ApiResource.RequestMethod.DELETE, url, params, Person.class, options); } + /** Updates an existing person. */ + @Override + public Person update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates an existing person. */ + @Override + public Person update(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/accounts/%s/persons/%s", + ApiResource.urlEncodeId(this.getAccount()), ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Person.class, options); + } + + /** Updates an existing person. */ + public Person update(PersonUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates an existing person. */ + public Person update(PersonUpdateParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/accounts/%s/persons/%s", + ApiResource.urlEncodeId(this.getAccount()), ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Person.class, options); + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/PersonCollection.java b/src/main/java/com/stripe/model/PersonCollection.java index 66fc07bd84d..fcd93242fe8 100644 --- a/src/main/java/com/stripe/model/PersonCollection.java +++ b/src/main/java/com/stripe/model/PersonCollection.java @@ -11,6 +11,29 @@ import java.util.Map; public class PersonCollection extends StripeCollection { + /** Creates a new person. */ + public Person create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new person. */ + public Person create(Map params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Person.class, options); + } + + /** Creates a new person. */ + public Person create(PersonCollectionCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new person. */ + public Person create(PersonCollectionCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Person.class, options); + } + /** * Returns a list of people associated with the account’s legal entity. The people are returned * sorted by creation date, with the most recent people appearing first. @@ -78,27 +101,4 @@ public Person retrieve(String id, PersonCollectionRetrieveParams params, Request String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id))); return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Person.class, options); } - - /** Creates a new person. */ - public Person create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new person. */ - public Person create(Map params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Person.class, options); - } - - /** Creates a new person. */ - public Person create(PersonCollectionCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new person. */ - public Person create(PersonCollectionCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Person.class, options); - } } diff --git a/src/main/java/com/stripe/model/Plan.java b/src/main/java/com/stripe/model/Plan.java index 6401ac04c61..8647503b058 100644 --- a/src/main/java/com/stripe/model/Plan.java +++ b/src/main/java/com/stripe/model/Plan.java @@ -17,6 +17,25 @@ import lombok.Getter; import lombok.Setter; +/** + * You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is + * backwards compatible to simplify your migration. + * + *

Plans define the base price, currency, and billing cycle for recurring purchases of products. + * Products help you track inventory or + * provisioning, and plans help you track pricing. Different physical goods or levels of service + * should be represented by products, and pricing options should be represented by plans. This + * approach lets you change prices without having to change your provisioning scheme. + * + *

For example, you might have a single "gold" product that has plans for $10/month, + * $100/year, €9/month, and €90/year. + * + *

Related guides: Set up a + * subscription and more about products and prices. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -192,30 +211,6 @@ public void setProductObject(Product expandableObject) { this.product = new ExpandableField(expandableObject.getId(), expandableObject); } - /** Returns a list of your plans. */ - public static PlanCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of your plans. */ - public static PlanCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/plans"); - return ApiResource.requestCollection(url, params, PlanCollection.class, options); - } - - /** Returns a list of your plans. */ - public static PlanCollection list(PlanListParams params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of your plans. */ - public static PlanCollection list(PlanListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/plans"); - return ApiResource.requestCollection(url, params, PlanCollection.class, options); - } - /** * You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is @@ -256,6 +251,55 @@ public static Plan create(PlanCreateParams params, RequestOptions options) return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Plan.class, options); } + /** Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected. */ + public Plan delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); + } + + /** Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected. */ + public Plan delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected. */ + public Plan delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected. */ + public Plan delete(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/plans/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.DELETE, url, params, Plan.class, options); + } + + /** Returns a list of your plans. */ + public static PlanCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of your plans. */ + public static PlanCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/plans"); + return ApiResource.requestCollection(url, params, PlanCollection.class, options); + } + + /** Returns a list of your plans. */ + public static PlanCollection list(PlanListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of your plans. */ + public static PlanCollection list(PlanListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/plans"); + return ApiResource.requestCollection(url, params, PlanCollection.class, options); + } + /** Retrieves the plan with the given ID. */ public static Plan retrieve(String plan) throws StripeException { return retrieve(plan, (Map) null, (RequestOptions) null); @@ -334,31 +378,6 @@ public Plan update(PlanUpdateParams params, RequestOptions options) throws Strip return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Plan.class, options); } - /** Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected. */ - public Plan delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected. */ - public Plan delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected. */ - public Plan delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected. */ - public Plan delete(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/plans/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.DELETE, url, params, Plan.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Price.java b/src/main/java/com/stripe/model/Price.java index 683b09fea93..fa29658da85 100644 --- a/src/main/java/com/stripe/model/Price.java +++ b/src/main/java/com/stripe/model/Price.java @@ -18,6 +18,23 @@ import lombok.Getter; import lombok.Setter; +/** + * Prices define the unit cost, currency, and (optional) billing cycle for both recurring and + * one-time purchases of products. Products help + * you track inventory or provisioning, and prices help you track payment terms. Different physical + * goods or levels of service should be represented by products, and pricing options should be + * represented by prices. This approach lets you change prices without having to change your + * provisioning scheme. + * + *

For example, you might have a single "gold" product that has prices for $10/month, + * $100/year, and €9 once. + * + *

Related guides: Set up a + * subscription, create an + * invoice, and more about products + * and prices. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -190,56 +207,28 @@ public void setProductObject(Product expandableObject) { this.product = new ExpandableField(expandableObject.getId(), expandableObject); } - /** - * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static PriceSearchResult search(Map params) throws StripeException { - return search(params, (RequestOptions) null); + /** Creates a new price for an existing product. The price can be recurring or one-time. */ + public static Price create(Map params) throws StripeException { + return create(params, (RequestOptions) null); } - /** - * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static PriceSearchResult search(Map params, RequestOptions options) + /** Creates a new price for an existing product. The price can be recurring or one-time. */ + public static Price create(Map params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/prices/search"); - return ApiResource.requestSearchResult(url, params, PriceSearchResult.class, options); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/prices"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Price.class, options); } - /** - * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static PriceSearchResult search(PriceSearchParams params) throws StripeException { - return search(params, (RequestOptions) null); + /** Creates a new price for an existing product. The price can be recurring or one-time. */ + public static Price create(PriceCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); } - /** - * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static PriceSearchResult search(PriceSearchParams params, RequestOptions options) + /** Creates a new price for an existing product. The price can be recurring or one-time. */ + public static Price create(PriceCreateParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/prices/search"); - return ApiResource.requestSearchResult(url, params, PriceSearchResult.class, options); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/prices"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Price.class, options); } /** Returns a list of your prices. */ @@ -266,30 +255,6 @@ public static PriceCollection list(PriceListParams params, RequestOptions option return ApiResource.requestCollection(url, params, PriceCollection.class, options); } - /** Creates a new price for an existing product. The price can be recurring or one-time. */ - public static Price create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new price for an existing product. The price can be recurring or one-time. */ - public static Price create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/prices"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Price.class, options); - } - - /** Creates a new price for an existing product. The price can be recurring or one-time. */ - public static Price create(PriceCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new price for an existing product. The price can be recurring or one-time. */ - public static Price create(PriceCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/prices"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Price.class, options); - } - /** Retrieves the price with the given ID. */ public static Price retrieve(String price) throws StripeException { return retrieve(price, (Map) null, (RequestOptions) null); @@ -320,6 +285,58 @@ public static Price retrieve(String price, PriceRetrieveParams params, RequestOp return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Price.class, options); } + /** + * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static PriceSearchResult search(Map params) throws StripeException { + return search(params, (RequestOptions) null); + } + + /** + * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static PriceSearchResult search(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/prices/search"); + return ApiResource.requestSearchResult(url, params, PriceSearchResult.class, options); + } + + /** + * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static PriceSearchResult search(PriceSearchParams params) throws StripeException { + return search(params, (RequestOptions) null); + } + + /** + * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static PriceSearchResult search(PriceSearchParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/prices/search"); + return ApiResource.requestSearchResult(url, params, PriceSearchResult.class, options); + } + /** * Updates the specified price by setting the values of the parameters passed. Any parameters not * provided are left unchanged. diff --git a/src/main/java/com/stripe/model/Product.java b/src/main/java/com/stripe/model/Product.java index cf6ced92177..1110acabdd0 100644 --- a/src/main/java/com/stripe/model/Product.java +++ b/src/main/java/com/stripe/model/Product.java @@ -17,6 +17,21 @@ import lombok.Getter; import lombok.Setter; +/** + * Products describe the specific goods or services you offer to your customers. For example, you + * might offer a Standard and Premium version of your goods or service; each version would be a + * separate Product. They can be used in conjunction with Prices to configure pricing in Payment Links, + * Checkout, and Subscriptions. + * + *

Related guides: Set up a + * subscription, share a + * Payment Link, accept + * payments with Checkout, and more about Products and Prices + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -191,80 +206,106 @@ public void setTaxCodeObject(TaxCode expandableObject) { this.taxCode = new ExpandableField(expandableObject.getId(), expandableObject); } + /** Creates a new product object. */ + public static Product create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new product object. */ + public static Product create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/products"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Product.class, options); + } + + /** Creates a new product object. */ + public static Product create(ProductCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new product object. */ + public static Product create(ProductCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/products"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Product.class, options); + } + /** - * Search for products you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * Delete a product. Deleting a product is only possible if it has no prices associated with it. + * Additionally, deleting a product with type=good is only possible if it has no SKUs + * associated with it. */ - public static ProductSearchResult search(Map params) throws StripeException { - return search(params, (RequestOptions) null); + public Product delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); } /** - * Search for products you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * Delete a product. Deleting a product is only possible if it has no prices associated with it. + * Additionally, deleting a product with type=good is only possible if it has no SKUs + * associated with it. */ - public static ProductSearchResult search(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/products/search"); - return ApiResource.requestSearchResult(url, params, ProductSearchResult.class, options); + public Product delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); } /** - * Search for products you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * Delete a product. Deleting a product is only possible if it has no prices associated with it. + * Additionally, deleting a product with type=good is only possible if it has no SKUs + * associated with it. */ - public static ProductSearchResult search(ProductSearchParams params) throws StripeException { - return search(params, (RequestOptions) null); + public Product delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); } /** - * Search for products you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * Delete a product. Deleting a product is only possible if it has no prices associated with it. + * Additionally, deleting a product with type=good is only possible if it has no SKUs + * associated with it. */ - public static ProductSearchResult search(ProductSearchParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/products/search"); - return ApiResource.requestSearchResult(url, params, ProductSearchResult.class, options); + public Product delete(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/products/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, Product.class, options); } - /** Creates a new product object. */ - public static Product create(Map params) throws StripeException { - return create(params, (RequestOptions) null); + /** + * Returns a list of your products. The products are returned sorted by creation date, with the + * most recently created products appearing first. + */ + public static ProductCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); } - /** Creates a new product object. */ - public static Product create(Map params, RequestOptions options) + /** + * Returns a list of your products. The products are returned sorted by creation date, with the + * most recently created products appearing first. + */ + public static ProductCollection list(Map params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/products"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Product.class, options); + return ApiResource.requestCollection(url, params, ProductCollection.class, options); } - /** Creates a new product object. */ - public static Product create(ProductCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); + /** + * Returns a list of your products. The products are returned sorted by creation date, with the + * most recently created products appearing first. + */ + public static ProductCollection list(ProductListParams params) throws StripeException { + return list(params, (RequestOptions) null); } - /** Creates a new product object. */ - public static Product create(ProductCreateParams params, RequestOptions options) + /** + * Returns a list of your products. The products are returned sorted by creation date, with the + * most recently created products appearing first. + */ + public static ProductCollection list(ProductListParams params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/products"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Product.class, options); + return ApiResource.requestCollection(url, params, ProductCollection.class, options); } /** @@ -313,6 +354,58 @@ public static Product retrieve(String id, ProductRetrieveParams params, RequestO return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Product.class, options); } + /** + * Search for products you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static ProductSearchResult search(Map params) throws StripeException { + return search(params, (RequestOptions) null); + } + + /** + * Search for products you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static ProductSearchResult search(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/products/search"); + return ApiResource.requestSearchResult(url, params, ProductSearchResult.class, options); + } + + /** + * Search for products you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static ProductSearchResult search(ProductSearchParams params) throws StripeException { + return search(params, (RequestOptions) null); + } + + /** + * Search for products you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. + */ + public static ProductSearchResult search(ProductSearchParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/products/search"); + return ApiResource.requestSearchResult(url, params, ProductSearchResult.class, options); + } + /** * Updates the specific product by setting the values of the parameters passed. Any parameters not * provided will be left unchanged. @@ -356,82 +449,4 @@ public Product update(ProductUpdateParams params, RequestOptions options) throws String.format("/v1/products/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Product.class, options); } - - /** - * Returns a list of your products. The products are returned sorted by creation date, with the - * most recently created products appearing first. - */ - public static ProductCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** - * Returns a list of your products. The products are returned sorted by creation date, with the - * most recently created products appearing first. - */ - public static ProductCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/products"); - return ApiResource.requestCollection(url, params, ProductCollection.class, options); - } - - /** - * Returns a list of your products. The products are returned sorted by creation date, with the - * most recently created products appearing first. - */ - public static ProductCollection list(ProductListParams params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** - * Returns a list of your products. The products are returned sorted by creation date, with the - * most recently created products appearing first. - */ - public static ProductCollection list(ProductListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/products"); - return ApiResource.requestCollection(url, params, ProductCollection.class, options); - } - - /** - * Delete a product. Deleting a product is only possible if it has no prices associated with it. - * Additionally, deleting a product with type=good is only possible if it has no SKUs - * associated with it. - */ - public Product delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** - * Delete a product. Deleting a product is only possible if it has no prices associated with it. - * Additionally, deleting a product with type=good is only possible if it has no SKUs - * associated with it. - */ - public Product delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** - * Delete a product. Deleting a product is only possible if it has no prices associated with it. - * Additionally, deleting a product with type=good is only possible if it has no SKUs - * associated with it. - */ - public Product delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** - * Delete a product. Deleting a product is only possible if it has no prices associated with it. - * Additionally, deleting a product with type=good is only possible if it has no SKUs - * associated with it. - */ - public Product delete(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/products/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, Product.class, options); - } } diff --git a/src/main/java/com/stripe/model/PromotionCode.java b/src/main/java/com/stripe/model/PromotionCode.java index 40688c684ca..c81838dcdc8 100644 --- a/src/main/java/com/stripe/model/PromotionCode.java +++ b/src/main/java/com/stripe/model/PromotionCode.java @@ -15,6 +15,11 @@ import lombok.Getter; import lombok.Setter; +/** + * A Promotion Code represents a customer-redeemable code for a coupon. It can be used to create multiple codes + * for a single coupon. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -118,6 +123,69 @@ public void setCustomerObject(Customer expandableObject) { this.customer = new ExpandableField(expandableObject.getId(), expandableObject); } + /** + * A promotion code points to a coupon. You can optionally restrict the code to a specific + * customer, redemption limit, and expiration date. + */ + public static PromotionCode create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * A promotion code points to a coupon. You can optionally restrict the code to a specific + * customer, redemption limit, and expiration date. + */ + public static PromotionCode create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/promotion_codes"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PromotionCode.class, options); + } + + /** + * A promotion code points to a coupon. You can optionally restrict the code to a specific + * customer, redemption limit, and expiration date. + */ + public static PromotionCode create(PromotionCodeCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * A promotion code points to a coupon. You can optionally restrict the code to a specific + * customer, redemption limit, and expiration date. + */ + public static PromotionCode create(PromotionCodeCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/promotion_codes"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, PromotionCode.class, options); + } + + /** Returns a list of your promotion codes. */ + public static PromotionCodeCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of your promotion codes. */ + public static PromotionCodeCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/promotion_codes"); + return ApiResource.requestCollection(url, params, PromotionCodeCollection.class, options); + } + + /** Returns a list of your promotion codes. */ + public static PromotionCodeCollection list(PromotionCodeListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of your promotion codes. */ + public static PromotionCodeCollection list(PromotionCodeListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/promotion_codes"); + return ApiResource.requestCollection(url, params, PromotionCodeCollection.class, options); + } + /** * Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the * customer-facing code use params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * A promotion code points to a coupon. You can optionally restrict the code to a specific - * customer, redemption limit, and expiration date. - */ - public static PromotionCode create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/promotion_codes"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PromotionCode.class, options); - } - - /** - * A promotion code points to a coupon. You can optionally restrict the code to a specific - * customer, redemption limit, and expiration date. - */ - public static PromotionCode create(PromotionCodeCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * A promotion code points to a coupon. You can optionally restrict the code to a specific - * customer, redemption limit, and expiration date. - */ - public static PromotionCode create(PromotionCodeCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/promotion_codes"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, PromotionCode.class, options); - } - /** * Updates the specified promotion code by setting the values of the parameters passed. Most * fields are, by design, not editable. @@ -261,31 +291,6 @@ public PromotionCode update(PromotionCodeUpdateParams params, RequestOptions opt ApiResource.RequestMethod.POST, url, params, PromotionCode.class, options); } - /** Returns a list of your promotion codes. */ - public static PromotionCodeCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of your promotion codes. */ - public static PromotionCodeCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/promotion_codes"); - return ApiResource.requestCollection(url, params, PromotionCodeCollection.class, options); - } - - /** Returns a list of your promotion codes. */ - public static PromotionCodeCollection list(PromotionCodeListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of your promotion codes. */ - public static PromotionCodeCollection list(PromotionCodeListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/promotion_codes"); - return ApiResource.requestCollection(url, params, PromotionCodeCollection.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Quote.java b/src/main/java/com/stripe/model/Quote.java index fe040a267c1..1bbe0cbbde9 100644 --- a/src/main/java/com/stripe/model/Quote.java +++ b/src/main/java/com/stripe/model/Quote.java @@ -26,6 +26,10 @@ import lombok.Getter; import lombok.Setter; +/** + * A Quote is a way to model prices that you'd like to provide to a customer. Once accepted, it will + * automatically create an invoice, subscription or subscription schedule. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -448,109 +452,43 @@ public void setDiscountObjects(List objs) { : null; } - /** Retrieves the quote with the given ID. */ - public static Quote retrieve(String quote) throws StripeException { - return retrieve(quote, (Map) null, (RequestOptions) null); - } - - /** Retrieves the quote with the given ID. */ - public static Quote retrieve(String quote, RequestOptions options) throws StripeException { - return retrieve(quote, (Map) null, options); - } - - /** Retrieves the quote with the given ID. */ - public static Quote retrieve(String quote, Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), String.format("/v1/quotes/%s", ApiResource.urlEncodeId(quote))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Quote.class, options); - } - - /** Retrieves the quote with the given ID. */ - public static Quote retrieve(String quote, QuoteRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), String.format("/v1/quotes/%s", ApiResource.urlEncodeId(quote))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Quote.class, options); - } - - /** - * A quote models prices and services for a customer. Default options for header, - * description, footer, and expires_at can be set in the - * dashboard via the quote - * template. - */ - public static Quote create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * A quote models prices and services for a customer. Default options for header, - * description, footer, and expires_at can be set in the - * dashboard via the quote - * template. - */ - public static Quote create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/quotes"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); - } - - /** - * A quote models prices and services for a customer. Default options for header, - * description, footer, and expires_at can be set in the - * dashboard via the quote - * template. - */ - public static Quote create(QuoteCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); + /** Accepts the specified quote. */ + public Quote accept() throws StripeException { + return accept((Map) null, (RequestOptions) null); } - /** - * A quote models prices and services for a customer. Default options for header, - * description, footer, and expires_at can be set in the - * dashboard via the quote - * template. - */ - public static Quote create(QuoteCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/quotes"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); + /** Accepts the specified quote. */ + public Quote accept(RequestOptions options) throws StripeException { + return accept((Map) null, options); } - /** A quote models prices and services for a customer. */ - @Override - public Quote update(Map params) throws StripeException { - return update(params, (RequestOptions) null); + /** Accepts the specified quote. */ + public Quote accept(Map params) throws StripeException { + return accept(params, (RequestOptions) null); } - /** A quote models prices and services for a customer. */ - @Override - public Quote update(Map params, RequestOptions options) throws StripeException { + /** Accepts the specified quote. */ + public Quote accept(Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/quotes/%s", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/quotes/%s/accept", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); } - /** A quote models prices and services for a customer. */ - public Quote update(QuoteUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + /** Accepts the specified quote. */ + public Quote accept(QuoteAcceptParams params) throws StripeException { + return accept(params, (RequestOptions) null); } - /** A quote models prices and services for a customer. */ - public Quote update(QuoteUpdateParams params, RequestOptions options) throws StripeException { + /** Accepts the specified quote. */ + public Quote accept(QuoteAcceptParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/quotes/%s", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/quotes/%s/accept", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); } @@ -594,6 +532,50 @@ public Quote cancel(QuoteCancelParams params, RequestOptions options) throws Str return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); } + /** + * A quote models prices and services for a customer. Default options for header, + * description, footer, and expires_at can be set in the + * dashboard via the quote + * template. + */ + public static Quote create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * A quote models prices and services for a customer. Default options for header, + * description, footer, and expires_at can be set in the + * dashboard via the quote + * template. + */ + public static Quote create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/quotes"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); + } + + /** + * A quote models prices and services for a customer. Default options for header, + * description, footer, and expires_at can be set in the + * dashboard via the quote + * template. + */ + public static Quote create(QuoteCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * A quote models prices and services for a customer. Default options for header, + * description, footer, and expires_at can be set in the + * dashboard via the quote + * template. + */ + public static Quote create(QuoteCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/quotes"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); + } + /** Finalizes the quote. */ public Quote finalizeQuote() throws StripeException { return finalizeQuote((Map) null, (RequestOptions) null); @@ -636,46 +618,6 @@ public Quote finalizeQuote(QuoteFinalizeQuoteParams params, RequestOptions optio return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); } - /** Accepts the specified quote. */ - public Quote accept() throws StripeException { - return accept((Map) null, (RequestOptions) null); - } - - /** Accepts the specified quote. */ - public Quote accept(RequestOptions options) throws StripeException { - return accept((Map) null, options); - } - - /** Accepts the specified quote. */ - public Quote accept(Map params) throws StripeException { - return accept(params, (RequestOptions) null); - } - - /** Accepts the specified quote. */ - public Quote accept(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/quotes/%s/accept", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); - } - - /** Accepts the specified quote. */ - public Quote accept(QuoteAcceptParams params) throws StripeException { - return accept(params, (RequestOptions) null); - } - - /** Accepts the specified quote. */ - public Quote accept(QuoteAcceptParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/quotes/%s/accept", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); - } - /** Returns a list of your quotes. */ public static QuoteCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -700,63 +642,6 @@ public static QuoteCollection list(QuoteListParams params, RequestOptions option return ApiResource.requestCollection(url, params, QuoteCollection.class, options); } - /** - * When retrieving a quote, there is an includable line_items property containing - * the first handful of those items. There is also a URL where you can retrieve the full - * (paginated) list of line items. - */ - public LineItemCollection listLineItems() throws StripeException { - return listLineItems((Map) null, (RequestOptions) null); - } - - /** - * When retrieving a quote, there is an includable line_items property containing - * the first handful of those items. There is also a URL where you can retrieve the full - * (paginated) list of line items. - */ - public LineItemCollection listLineItems(Map params) throws StripeException { - return listLineItems(params, (RequestOptions) null); - } - - /** - * When retrieving a quote, there is an includable line_items property containing - * the first handful of those items. There is also a URL where you can retrieve the full - * (paginated) list of line items. - */ - public LineItemCollection listLineItems(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/quotes/%s/line_items", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.requestCollection(url, params, LineItemCollection.class, options); - } - - /** - * When retrieving a quote, there is an includable line_items property containing - * the first handful of those items. There is also a URL where you can retrieve the full - * (paginated) list of line items. - */ - public LineItemCollection listLineItems(QuoteListLineItemsParams params) throws StripeException { - return listLineItems(params, (RequestOptions) null); - } - - /** - * When retrieving a quote, there is an includable line_items property containing - * the first handful of those items. There is also a URL where you can retrieve the full - * (paginated) list of line items. - */ - public LineItemCollection listLineItems(QuoteListLineItemsParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/quotes/%s/line_items", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.requestCollection(url, params, LineItemCollection.class, options); - } - /** * When retrieving a quote, there is an includable computed.upfront.line_items @@ -826,6 +711,63 @@ public LineItemCollection listComputedUpfrontLineItems( return ApiResource.requestCollection(url, params, LineItemCollection.class, options); } + /** + * When retrieving a quote, there is an includable line_items property containing + * the first handful of those items. There is also a URL where you can retrieve the full + * (paginated) list of line items. + */ + public LineItemCollection listLineItems() throws StripeException { + return listLineItems((Map) null, (RequestOptions) null); + } + + /** + * When retrieving a quote, there is an includable line_items property containing + * the first handful of those items. There is also a URL where you can retrieve the full + * (paginated) list of line items. + */ + public LineItemCollection listLineItems(Map params) throws StripeException { + return listLineItems(params, (RequestOptions) null); + } + + /** + * When retrieving a quote, there is an includable line_items property containing + * the first handful of those items. There is also a URL where you can retrieve the full + * (paginated) list of line items. + */ + public LineItemCollection listLineItems(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/quotes/%s/line_items", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.requestCollection(url, params, LineItemCollection.class, options); + } + + /** + * When retrieving a quote, there is an includable line_items property containing + * the first handful of those items. There is also a URL where you can retrieve the full + * (paginated) list of line items. + */ + public LineItemCollection listLineItems(QuoteListLineItemsParams params) throws StripeException { + return listLineItems(params, (RequestOptions) null); + } + + /** + * When retrieving a quote, there is an includable line_items property containing + * the first handful of those items. There is also a URL where you can retrieve the full + * (paginated) list of line items. + */ + public LineItemCollection listLineItems(QuoteListLineItemsParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/quotes/%s/line_items", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.requestCollection(url, params, LineItemCollection.class, options); + } + /** Download the PDF for a finalized quote. */ public InputStream pdf() throws StripeException { return pdf((Map) null, (RequestOptions) null); @@ -862,6 +804,68 @@ public InputStream pdf(QuotePdfParams params, RequestOptions options) throws Str return ApiResource.requestStream(ApiResource.RequestMethod.GET, url, params, options); } + /** Retrieves the quote with the given ID. */ + public static Quote retrieve(String quote) throws StripeException { + return retrieve(quote, (Map) null, (RequestOptions) null); + } + + /** Retrieves the quote with the given ID. */ + public static Quote retrieve(String quote, RequestOptions options) throws StripeException { + return retrieve(quote, (Map) null, options); + } + + /** Retrieves the quote with the given ID. */ + public static Quote retrieve(String quote, Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), String.format("/v1/quotes/%s", ApiResource.urlEncodeId(quote))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Quote.class, options); + } + + /** Retrieves the quote with the given ID. */ + public static Quote retrieve(String quote, QuoteRetrieveParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), String.format("/v1/quotes/%s", ApiResource.urlEncodeId(quote))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Quote.class, options); + } + + /** A quote models prices and services for a customer. */ + @Override + public Quote update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** A quote models prices and services for a customer. */ + @Override + public Quote update(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/quotes/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); + } + + /** A quote models prices and services for a customer. */ + public Quote update(QuoteUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** A quote models prices and services for a customer. */ + public Quote update(QuoteUpdateParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/quotes/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Quote.class, options); + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Refund.java b/src/main/java/com/stripe/model/Refund.java index e6bcce2166b..a35907ebea5 100644 --- a/src/main/java/com/stripe/model/Refund.java +++ b/src/main/java/com/stripe/model/Refund.java @@ -17,6 +17,12 @@ import lombok.Getter; import lombok.Setter; +/** + * {@code Refund} objects allow you to refund a charge that has previously been created but not yet + * refunded. Funds will be refunded to the credit or debit card that was originally charged. + * + *

Related guide: Refunds. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -265,43 +271,73 @@ public void setTransferReversalObject(TransferReversal expandableObject) { } /** - * Returns a list of all refunds you’ve previously created. The refunds are returned in sorted - * order, with the most recent refunds appearing first. For convenience, the 10 most recent - * refunds are always available by default on the charge object. + * Cancels a refund with a status of requires_action. + * + *

Refunds in other states cannot be canceled, and only refunds for payment methods that + * require customer action will enter the requires_action state. */ - public static RefundCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); + public Refund cancel() throws StripeException { + return cancel((Map) null, (RequestOptions) null); } /** - * Returns a list of all refunds you’ve previously created. The refunds are returned in sorted - * order, with the most recent refunds appearing first. For convenience, the 10 most recent - * refunds are always available by default on the charge object. + * Cancels a refund with a status of requires_action. + * + *

Refunds in other states cannot be canceled, and only refunds for payment methods that + * require customer action will enter the requires_action state. */ - public static RefundCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/refunds"); - return ApiResource.requestCollection(url, params, RefundCollection.class, options); + public Refund cancel(RequestOptions options) throws StripeException { + return cancel((Map) null, options); } /** - * Returns a list of all refunds you’ve previously created. The refunds are returned in sorted - * order, with the most recent refunds appearing first. For convenience, the 10 most recent - * refunds are always available by default on the charge object. + * Cancels a refund with a status of requires_action. + * + *

Refunds in other states cannot be canceled, and only refunds for payment methods that + * require customer action will enter the requires_action state. */ - public static RefundCollection list(RefundListParams params) throws StripeException { - return list(params, (RequestOptions) null); + public Refund cancel(Map params) throws StripeException { + return cancel(params, (RequestOptions) null); } /** - * Returns a list of all refunds you’ve previously created. The refunds are returned in sorted - * order, with the most recent refunds appearing first. For convenience, the 10 most recent - * refunds are always available by default on the charge object. + * Cancels a refund with a status of requires_action. + * + *

Refunds in other states cannot be canceled, and only refunds for payment methods that + * require customer action will enter the requires_action state. */ - public static RefundCollection list(RefundListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/refunds"); - return ApiResource.requestCollection(url, params, RefundCollection.class, options); + public Refund cancel(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/refunds/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Refund.class, options); + } + + /** + * Cancels a refund with a status of requires_action. + * + *

Refunds in other states cannot be canceled, and only refunds for payment methods that + * require customer action will enter the requires_action state. + */ + public Refund cancel(RefundCancelParams params) throws StripeException { + return cancel(params, (RequestOptions) null); + } + + /** + * Cancels a refund with a status of requires_action. + * + *

Refunds in other states cannot be canceled, and only refunds for payment methods that + * require customer action will enter the requires_action state. + */ + public Refund cancel(RefundCancelParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/refunds/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Refund.class, options); } /** Create a refund. */ @@ -328,6 +364,46 @@ public static Refund create(RefundCreateParams params, RequestOptions options) return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Refund.class, options); } + /** + * Returns a list of all refunds you’ve previously created. The refunds are returned in sorted + * order, with the most recent refunds appearing first. For convenience, the 10 most recent + * refunds are always available by default on the charge object. + */ + public static RefundCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of all refunds you’ve previously created. The refunds are returned in sorted + * order, with the most recent refunds appearing first. For convenience, the 10 most recent + * refunds are always available by default on the charge object. + */ + public static RefundCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/refunds"); + return ApiResource.requestCollection(url, params, RefundCollection.class, options); + } + + /** + * Returns a list of all refunds you’ve previously created. The refunds are returned in sorted + * order, with the most recent refunds appearing first. For convenience, the 10 most recent + * refunds are always available by default on the charge object. + */ + public static RefundCollection list(RefundListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of all refunds you’ve previously created. The refunds are returned in sorted + * order, with the most recent refunds appearing first. For convenience, the 10 most recent + * refunds are always available by default on the charge object. + */ + public static RefundCollection list(RefundListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/refunds"); + return ApiResource.requestCollection(url, params, RefundCollection.class, options); + } + /** Retrieves the details of an existing refund. */ public static Refund retrieve(String refund) throws StripeException { return retrieve(refund, (Map) null, (RequestOptions) null); @@ -410,76 +486,6 @@ public Refund update(RefundUpdateParams params, RequestOptions options) throws S return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Refund.class, options); } - /** - * Cancels a refund with a status of requires_action. - * - *

Refunds in other states cannot be canceled, and only refunds for payment methods that - * require customer action will enter the requires_action state. - */ - public Refund cancel() throws StripeException { - return cancel((Map) null, (RequestOptions) null); - } - - /** - * Cancels a refund with a status of requires_action. - * - *

Refunds in other states cannot be canceled, and only refunds for payment methods that - * require customer action will enter the requires_action state. - */ - public Refund cancel(RequestOptions options) throws StripeException { - return cancel((Map) null, options); - } - - /** - * Cancels a refund with a status of requires_action. - * - *

Refunds in other states cannot be canceled, and only refunds for payment methods that - * require customer action will enter the requires_action state. - */ - public Refund cancel(Map params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** - * Cancels a refund with a status of requires_action. - * - *

Refunds in other states cannot be canceled, and only refunds for payment methods that - * require customer action will enter the requires_action state. - */ - public Refund cancel(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/refunds/%s/cancel", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Refund.class, options); - } - - /** - * Cancels a refund with a status of requires_action. - * - *

Refunds in other states cannot be canceled, and only refunds for payment methods that - * require customer action will enter the requires_action state. - */ - public Refund cancel(RefundCancelParams params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** - * Cancels a refund with a status of requires_action. - * - *

Refunds in other states cannot be canceled, and only refunds for payment methods that - * require customer action will enter the requires_action state. - */ - public Refund cancel(RefundCancelParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/refunds/%s/cancel", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Refund.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Review.java b/src/main/java/com/stripe/model/Review.java index 052855b177f..22cc1ecfc06 100644 --- a/src/main/java/com/stripe/model/Review.java +++ b/src/main/java/com/stripe/model/Review.java @@ -15,6 +15,12 @@ import lombok.Getter; import lombok.Setter; +/** + * Reviews can be used to supplement automated fraud detection with human expertise. + * + *

Learn more about Radar and reviewing payments here. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -134,6 +140,46 @@ public void setPaymentIntentObject(PaymentIntent expandableObject) { new ExpandableField(expandableObject.getId(), expandableObject); } + /** Approves a Review object, closing it and removing it from the list of reviews. */ + public Review approve() throws StripeException { + return approve((Map) null, (RequestOptions) null); + } + + /** Approves a Review object, closing it and removing it from the list of reviews. */ + public Review approve(RequestOptions options) throws StripeException { + return approve((Map) null, options); + } + + /** Approves a Review object, closing it and removing it from the list of reviews. */ + public Review approve(Map params) throws StripeException { + return approve(params, (RequestOptions) null); + } + + /** Approves a Review object, closing it and removing it from the list of reviews. */ + public Review approve(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/reviews/%s/approve", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Review.class, options); + } + + /** Approves a Review object, closing it and removing it from the list of reviews. */ + public Review approve(ReviewApproveParams params) throws StripeException { + return approve(params, (RequestOptions) null); + } + + /** Approves a Review object, closing it and removing it from the list of reviews. */ + public Review approve(ReviewApproveParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/reviews/%s/approve", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Review.class, options); + } + /** * Returns a list of Review objects that have open set to true * . The objects are sorted in descending order by creation date, with the most recently @@ -204,46 +250,6 @@ public static Review retrieve(String review, ReviewRetrieveParams params, Reques return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Review.class, options); } - /** Approves a Review object, closing it and removing it from the list of reviews. */ - public Review approve() throws StripeException { - return approve((Map) null, (RequestOptions) null); - } - - /** Approves a Review object, closing it and removing it from the list of reviews. */ - public Review approve(RequestOptions options) throws StripeException { - return approve((Map) null, options); - } - - /** Approves a Review object, closing it and removing it from the list of reviews. */ - public Review approve(Map params) throws StripeException { - return approve(params, (RequestOptions) null); - } - - /** Approves a Review object, closing it and removing it from the list of reviews. */ - public Review approve(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/reviews/%s/approve", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Review.class, options); - } - - /** Approves a Review object, closing it and removing it from the list of reviews. */ - public Review approve(ReviewApproveParams params) throws StripeException { - return approve(params, (RequestOptions) null); - } - - /** Approves a Review object, closing it and removing it from the list of reviews. */ - public Review approve(ReviewApproveParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/reviews/%s/approve", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Review.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/SetupAttempt.java b/src/main/java/com/stripe/model/SetupAttempt.java index 50fc6921cef..2b12feda790 100644 --- a/src/main/java/com/stripe/model/SetupAttempt.java +++ b/src/main/java/com/stripe/model/SetupAttempt.java @@ -13,6 +13,11 @@ import lombok.Getter; import lombok.Setter; +/** + * A SetupAttempt describes one attempted confirmation of a SetupIntent, whether that confirmation + * was successful or unsuccessful. You can use SetupAttempts to inspect details of a specific + * attempt at setting up a payment method using a SetupIntent. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/SetupIntent.java b/src/main/java/com/stripe/model/SetupIntent.java index b6f9ff6c7db..aaf6856e018 100644 --- a/src/main/java/com/stripe/model/SetupIntent.java +++ b/src/main/java/com/stripe/model/SetupIntent.java @@ -19,6 +19,37 @@ import lombok.Getter; import lombok.Setter; +/** + * A SetupIntent guides you through the process of setting up and saving a customer's payment + * credentials for future payments. For example, you could use a SetupIntent to set up and save your + * customer's card without immediately collecting a payment. Later, you can use PaymentIntents to drive the payment flow. + * + *

Create a SetupIntent as soon as you're ready to collect your customer's payment credentials. + * Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid. The + * SetupIntent then transitions through multiple statuses as it guides you + * through the setup process. + * + *

Successful SetupIntents result in payment credentials that are optimized for future payments. + * For example, cardholders in certain regions may need to + * be run through Strong Customer + * Authentication at the time of payment method collection in order to streamline later off-session payments. If the + * SetupIntent is used with a Customer, upon success, it + * will automatically attach the resulting payment method to that Customer. We recommend using + * SetupIntents or setup_future_usage + * on PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized + * payment methods. + * + *

By using SetupIntents, you ensure that your customers experience the minimum set of required + * friction, even as regulations change over time. + * + *

Related guide: Setup Intents API. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -312,182 +343,87 @@ public void setSingleUseMandateObject(Mandate expandableObject) { } /** - * Creates a SetupIntent object. + * A SetupIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_confirmation, or requires_action + * . * - *

After the SetupIntent is created, attach a payment method and confirm to collect any required - * permissions to charge the payment method later. + *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an + * error. */ - public static SetupIntent create(Map params) throws StripeException { - return create(params, (RequestOptions) null); + public SetupIntent cancel() throws StripeException { + return cancel((Map) null, (RequestOptions) null); } /** - * Creates a SetupIntent object. + * A SetupIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_confirmation, or requires_action + * . * - *

After the SetupIntent is created, attach a payment method and confirm to collect any required - * permissions to charge the payment method later. + *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an + * error. */ - public static SetupIntent create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options); + public SetupIntent cancel(RequestOptions options) throws StripeException { + return cancel((Map) null, options); } /** - * Creates a SetupIntent object. + * A SetupIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_confirmation, or requires_action + * . * - *

After the SetupIntent is created, attach a payment method and confirm to collect any required - * permissions to charge the payment method later. + *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an + * error. */ - public static SetupIntent create(SetupIntentCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); + public SetupIntent cancel(Map params) throws StripeException { + return cancel(params, (RequestOptions) null); } /** - * Creates a SetupIntent object. + * A SetupIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_confirmation, or requires_action + * . * - *

After the SetupIntent is created, attach a payment method and confirm to collect any required - * permissions to charge the payment method later. + *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an + * error. */ - public static SetupIntent create(SetupIntentCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options); - } - - /** Returns a list of SetupIntents. */ - public static SetupIntentCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of SetupIntents. */ - public static SetupIntentCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents"); - return ApiResource.requestCollection(url, params, SetupIntentCollection.class, options); - } - - /** Returns a list of SetupIntents. */ - public static SetupIntentCollection list(SetupIntentListParams params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of SetupIntents. */ - public static SetupIntentCollection list(SetupIntentListParams params, RequestOptions options) + public SetupIntent cancel(Map params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents"); - return ApiResource.requestCollection(url, params, SetupIntentCollection.class, options); - } - - /** - * Retrieves the details of a SetupIntent that has previously been created. - * - *

Client-side retrieval using a publishable key is allowed when the client_secret - * is provided in the query string. - * - *

When retrieved with a publishable key, only a subset of properties will be returned. Please - * refer to the SetupIntent object - * reference for more details. - */ - public static SetupIntent retrieve(String intent) throws StripeException { - return retrieve(intent, (Map) null, (RequestOptions) null); - } - - /** - * Retrieves the details of a SetupIntent that has previously been created. - * - *

Client-side retrieval using a publishable key is allowed when the client_secret - * is provided in the query string. - * - *

When retrieved with a publishable key, only a subset of properties will be returned. Please - * refer to the SetupIntent object - * reference for more details. - */ - public static SetupIntent retrieve(String intent, RequestOptions options) throws StripeException { - return retrieve(intent, (Map) null, options); - } - - /** - * Retrieves the details of a SetupIntent that has previously been created. - * - *

Client-side retrieval using a publishable key is allowed when the client_secret - * is provided in the query string. - * - *

When retrieved with a publishable key, only a subset of properties will be returned. Please - * refer to the SetupIntent object - * reference for more details. - */ - public static SetupIntent retrieve( - String intent, Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(intent))); + String.format("/v1/setup_intents/%s/cancel", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, SetupIntent.class, options); + ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options); } /** - * Retrieves the details of a SetupIntent that has previously been created. - * - *

Client-side retrieval using a publishable key is allowed when the client_secret - * is provided in the query string. + * A SetupIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_confirmation, or requires_action + * . * - *

When retrieved with a publishable key, only a subset of properties will be returned. Please - * refer to the SetupIntent object - * reference for more details. + *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an + * error. */ - public static SetupIntent retrieve( - String intent, SetupIntentRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(intent))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, SetupIntent.class, options); - } - - /** Updates a SetupIntent object. */ - @Override - public SetupIntent update(Map params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** Updates a SetupIntent object. */ - @Override - public SetupIntent update(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options); - } - - /** Updates a SetupIntent object. */ - public SetupIntent update(SetupIntentUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + public SetupIntent cancel(SetupIntentCancelParams params) throws StripeException { + return cancel(params, (RequestOptions) null); } - /** Updates a SetupIntent object. */ - public SetupIntent update(SetupIntentUpdateParams params, RequestOptions options) + /** + * A SetupIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_confirmation, or requires_action + * . + * + *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an + * error. + */ + public SetupIntent cancel(SetupIntentCancelParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/setup_intents/%s/cancel", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options); } @@ -603,87 +539,182 @@ public SetupIntent confirm(SetupIntentConfirmParams params, RequestOptions optio } /** - * A SetupIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_confirmation, or requires_action - * . + * Creates a SetupIntent object. * - *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an - * error. + *

After the SetupIntent is created, attach a payment method and confirm to collect any required + * permissions to charge the payment method later. */ - public SetupIntent cancel() throws StripeException { - return cancel((Map) null, (RequestOptions) null); + public static SetupIntent create(Map params) throws StripeException { + return create(params, (RequestOptions) null); } /** - * A SetupIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_confirmation, or requires_action - * . + * Creates a SetupIntent object. * - *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an - * error. + *

After the SetupIntent is created, attach a payment method and confirm to collect any required + * permissions to charge the payment method later. */ - public SetupIntent cancel(RequestOptions options) throws StripeException { - return cancel((Map) null, options); + public static SetupIntent create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options); } /** - * A SetupIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_confirmation, or requires_action - * . + * Creates a SetupIntent object. * - *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an - * error. + *

After the SetupIntent is created, attach a payment method and confirm to collect any required + * permissions to charge the payment method later. */ - public SetupIntent cancel(Map params) throws StripeException { - return cancel(params, (RequestOptions) null); + public static SetupIntent create(SetupIntentCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); } /** - * A SetupIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_confirmation, or requires_action - * . + * Creates a SetupIntent object. * - *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an - * error. + *

After the SetupIntent is created, attach a payment method and confirm to collect any required + * permissions to charge the payment method later. */ - public SetupIntent cancel(Map params, RequestOptions options) + public static SetupIntent create(SetupIntentCreateParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/setup_intents/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents"); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options); } + /** Returns a list of SetupIntents. */ + public static SetupIntentCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of SetupIntents. */ + public static SetupIntentCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents"); + return ApiResource.requestCollection(url, params, SetupIntentCollection.class, options); + } + + /** Returns a list of SetupIntents. */ + public static SetupIntentCollection list(SetupIntentListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of SetupIntents. */ + public static SetupIntentCollection list(SetupIntentListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents"); + return ApiResource.requestCollection(url, params, SetupIntentCollection.class, options); + } + /** - * A SetupIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_confirmation, or requires_action - * . + * Retrieves the details of a SetupIntent that has previously been created. * - *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an - * error. + *

Client-side retrieval using a publishable key is allowed when the client_secret + * is provided in the query string. + * + *

When retrieved with a publishable key, only a subset of properties will be returned. Please + * refer to the SetupIntent object + * reference for more details. */ - public SetupIntent cancel(SetupIntentCancelParams params) throws StripeException { - return cancel(params, (RequestOptions) null); + public static SetupIntent retrieve(String intent) throws StripeException { + return retrieve(intent, (Map) null, (RequestOptions) null); } /** - * A SetupIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_confirmation, or requires_action - * . + * Retrieves the details of a SetupIntent that has previously been created. * - *

Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an - * error. + *

Client-side retrieval using a publishable key is allowed when the client_secret + * is provided in the query string. + * + *

When retrieved with a publishable key, only a subset of properties will be returned. Please + * refer to the SetupIntent object + * reference for more details. */ - public SetupIntent cancel(SetupIntentCancelParams params, RequestOptions options) + public static SetupIntent retrieve(String intent, RequestOptions options) throws StripeException { + return retrieve(intent, (Map) null, options); + } + + /** + * Retrieves the details of a SetupIntent that has previously been created. + * + *

Client-side retrieval using a publishable key is allowed when the client_secret + * is provided in the query string. + * + *

When retrieved with a publishable key, only a subset of properties will be returned. Please + * refer to the SetupIntent object + * reference for more details. + */ + public static SetupIntent retrieve( + String intent, Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(intent))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, SetupIntent.class, options); + } + + /** + * Retrieves the details of a SetupIntent that has previously been created. + * + *

Client-side retrieval using a publishable key is allowed when the client_secret + * is provided in the query string. + * + *

When retrieved with a publishable key, only a subset of properties will be returned. Please + * refer to the SetupIntent object + * reference for more details. + */ + public static SetupIntent retrieve( + String intent, SetupIntentRetrieveParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/setup_intents/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(intent))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, SetupIntent.class, options); + } + + /** Updates a SetupIntent object. */ + @Override + public SetupIntent update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates a SetupIntent object. */ + @Override + public SetupIntent update(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options); + } + + /** Updates a SetupIntent object. */ + public SetupIntent update(SetupIntentUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates a SetupIntent object. */ + public SetupIntent update(SetupIntentUpdateParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options); } diff --git a/src/main/java/com/stripe/model/ShippingRate.java b/src/main/java/com/stripe/model/ShippingRate.java index b400018266a..549d596da1d 100644 --- a/src/main/java/com/stripe/model/ShippingRate.java +++ b/src/main/java/com/stripe/model/ShippingRate.java @@ -15,6 +15,11 @@ import lombok.Getter; import lombok.Setter; +/** + * Shipping rates describe the price of shipping presented to your customers and can be applied to + * Checkout Sessions and Orders to collect shipping costs. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -115,6 +120,32 @@ public void setTaxCodeObject(TaxCode expandableObject) { this.taxCode = new ExpandableField(expandableObject.getId(), expandableObject); } + /** Creates a new shipping rate object. */ + public static ShippingRate create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new shipping rate object. */ + public static ShippingRate create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/shipping_rates"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, ShippingRate.class, options); + } + + /** Creates a new shipping rate object. */ + public static ShippingRate create(ShippingRateCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new shipping rate object. */ + public static ShippingRate create(ShippingRateCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/shipping_rates"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, ShippingRate.class, options); + } + /** Returns a list of your shipping rates. */ public static ShippingRateCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -176,32 +207,6 @@ public static ShippingRate retrieve( ApiResource.RequestMethod.GET, url, params, ShippingRate.class, options); } - /** Creates a new shipping rate object. */ - public static ShippingRate create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new shipping rate object. */ - public static ShippingRate create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/shipping_rates"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, ShippingRate.class, options); - } - - /** Creates a new shipping rate object. */ - public static ShippingRate create(ShippingRateCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new shipping rate object. */ - public static ShippingRate create(ShippingRateCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/shipping_rates"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, ShippingRate.class, options); - } - /** Updates an existing shipping rate object. */ @Override public ShippingRate update(Map params) throws StripeException { diff --git a/src/main/java/com/stripe/model/Sku.java b/src/main/java/com/stripe/model/Sku.java index 7967c8427f1..5f5786648f3 100644 --- a/src/main/java/com/stripe/model/Sku.java +++ b/src/main/java/com/stripe/model/Sku.java @@ -15,6 +15,14 @@ import lombok.Getter; import lombok.Setter; +/** + * Stores representations of stock keeping + * units. SKUs describe specific product variations, taking into account any combination of: + * attributes, currency, and cost. For example, a product may be a T-shirt, whereas a specific SKU + * represents the {@code size: large}, {@code color: red} version of that shirt. + * + *

Can also be used to manage inventory. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -121,44 +129,52 @@ public void setProductObject(Product expandableObject) { this.product = new ExpandableField(expandableObject.getId(), expandableObject); } - /** - * Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU - * creation request or from the product, and Stripe will return the corresponding SKU information. - */ - public static Sku retrieve(String id) throws StripeException { - return retrieve(id, (Map) null, (RequestOptions) null); + /** Creates a new SKU associated with a product. */ + public static Sku create(Map params) throws StripeException { + return create(params, (RequestOptions) null); } - /** - * Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU - * creation request or from the product, and Stripe will return the corresponding SKU information. - */ - public static Sku retrieve(String id, RequestOptions options) throws StripeException { - return retrieve(id, (Map) null, options); + /** Creates a new SKU associated with a product. */ + public static Sku create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/skus"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Sku.class, options); } - /** - * Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU - * creation request or from the product, and Stripe will return the corresponding SKU information. - */ - public static Sku retrieve(String id, Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", Stripe.getApiBase(), String.format("/v1/skus/%s", ApiResource.urlEncodeId(id))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Sku.class, options); + /** Creates a new SKU associated with a product. */ + public static Sku create(SkuCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); } - /** - * Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU - * creation request or from the product, and Stripe will return the corresponding SKU information. - */ - public static Sku retrieve(String id, SkuRetrieveParams params, RequestOptions options) - throws StripeException { + /** Creates a new SKU associated with a product. */ + public static Sku create(SkuCreateParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/skus"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Sku.class, options); + } + + /** Delete a SKU. Deleting a SKU is only possible until it has been used in an order. */ + public Sku delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); + } + + /** Delete a SKU. Deleting a SKU is only possible until it has been used in an order. */ + public Sku delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** Delete a SKU. Deleting a SKU is only possible until it has been used in an order. */ + public Sku delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** Delete a SKU. Deleting a SKU is only possible until it has been used in an order. */ + public Sku delete(Map params, RequestOptions options) throws StripeException { String url = String.format( - "%s%s", Stripe.getApiBase(), String.format("/v1/skus/%s", ApiResource.urlEncodeId(id))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Sku.class, options); + "%s%s", + Stripe.getApiBase(), + String.format("/v1/skus/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.DELETE, url, params, Sku.class, options); } /** @@ -197,6 +213,46 @@ public static SkuCollection list(SkuListParams params, RequestOptions options) return ApiResource.requestCollection(url, params, SkuCollection.class, options); } + /** + * Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU + * creation request or from the product, and Stripe will return the corresponding SKU information. + */ + public static Sku retrieve(String id) throws StripeException { + return retrieve(id, (Map) null, (RequestOptions) null); + } + + /** + * Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU + * creation request or from the product, and Stripe will return the corresponding SKU information. + */ + public static Sku retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (Map) null, options); + } + + /** + * Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU + * creation request or from the product, and Stripe will return the corresponding SKU information. + */ + public static Sku retrieve(String id, Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", Stripe.getApiBase(), String.format("/v1/skus/%s", ApiResource.urlEncodeId(id))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Sku.class, options); + } + + /** + * Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU + * creation request or from the product, and Stripe will return the corresponding SKU information. + */ + public static Sku retrieve(String id, SkuRetrieveParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", Stripe.getApiBase(), String.format("/v1/skus/%s", ApiResource.urlEncodeId(id))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Sku.class, options); + } + /** * Updates the specific SKU by setting the values of the parameters passed. Any parameters not * provided will be left unchanged. @@ -253,54 +309,6 @@ public Sku update(SkuUpdateParams params, RequestOptions options) throws StripeE return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Sku.class, options); } - /** Creates a new SKU associated with a product. */ - public static Sku create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new SKU associated with a product. */ - public static Sku create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/skus"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Sku.class, options); - } - - /** Creates a new SKU associated with a product. */ - public static Sku create(SkuCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new SKU associated with a product. */ - public static Sku create(SkuCreateParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/skus"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Sku.class, options); - } - - /** Delete a SKU. Deleting a SKU is only possible until it has been used in an order. */ - public Sku delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** Delete a SKU. Deleting a SKU is only possible until it has been used in an order. */ - public Sku delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** Delete a SKU. Deleting a SKU is only possible until it has been used in an order. */ - public Sku delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** Delete a SKU. Deleting a SKU is only possible until it has been used in an order. */ - public Sku delete(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/skus/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.DELETE, url, params, Sku.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Source.java b/src/main/java/com/stripe/model/Source.java index e9d15669068..e404789df3e 100644 --- a/src/main/java/com/stripe/model/Source.java +++ b/src/main/java/com/stripe/model/Source.java @@ -18,6 +18,14 @@ import lombok.Getter; import lombok.Setter; +/** + * {@code Source} objects allow you to accept a variety of payment methods. They represent a + * customer's payment instrument, and can be used with the Stripe API just like a {@code Card} + * object: once chargeable, they can be charged, or can be attached to customers. + * + *

Related guides: Sources API and Sources & Customers. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -200,6 +208,30 @@ public class Source extends ApiResource implements MetadataStore, Paymen @SerializedName("wechat") Wechat wechat; + /** Creates a new source object. */ + public static Source create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new source object. */ + public static Source create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/sources"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Source.class, options); + } + + /** Creates a new source object. */ + public static Source create(SourceCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new source object. */ + public static Source create(SourceCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/sources"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Source.class, options); + } + /** Delete a specified source for a given customer. */ public Source detach() throws StripeException { return detach((Map) null, (RequestOptions) null); @@ -285,28 +317,45 @@ public static Source retrieve(String source, SourceRetrieveParams params, Reques return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Source.class, options); } - /** Creates a new source object. */ - public static Source create(Map params) throws StripeException { - return create(params, (RequestOptions) null); + /** List source transactions for a given source. */ + public SourceTransactionCollection sourceTransactions() throws StripeException { + return sourceTransactions((Map) null, (RequestOptions) null); } - /** Creates a new source object. */ - public static Source create(Map params, RequestOptions options) + /** List source transactions for a given source. */ + public SourceTransactionCollection sourceTransactions(Map params) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/sources"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Source.class, options); + return sourceTransactions(params, (RequestOptions) null); } - /** Creates a new source object. */ - public static Source create(SourceCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); + /** List source transactions for a given source. */ + public SourceTransactionCollection sourceTransactions( + Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/sources/%s/source_transactions", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.requestCollection(url, params, SourceTransactionCollection.class, options); } - /** Creates a new source object. */ - public static Source create(SourceCreateParams params, RequestOptions options) + /** List source transactions for a given source. */ + public SourceTransactionCollection sourceTransactions(SourceSourceTransactionsParams params) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/sources"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Source.class, options); + return sourceTransactions(params, (RequestOptions) null); + } + + /** List source transactions for a given source. */ + public SourceTransactionCollection sourceTransactions( + SourceSourceTransactionsParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/sources/%s/source_transactions", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.requestCollection(url, params, SourceTransactionCollection.class, options); } /** @@ -399,47 +448,6 @@ public Source verify(SourceVerifyParams params, RequestOptions options) throws S return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Source.class, options); } - /** List source transactions for a given source. */ - public SourceTransactionCollection sourceTransactions() throws StripeException { - return sourceTransactions((Map) null, (RequestOptions) null); - } - - /** List source transactions for a given source. */ - public SourceTransactionCollection sourceTransactions(Map params) - throws StripeException { - return sourceTransactions(params, (RequestOptions) null); - } - - /** List source transactions for a given source. */ - public SourceTransactionCollection sourceTransactions( - Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/sources/%s/source_transactions", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.requestCollection(url, params, SourceTransactionCollection.class, options); - } - - /** List source transactions for a given source. */ - public SourceTransactionCollection sourceTransactions(SourceSourceTransactionsParams params) - throws StripeException { - return sourceTransactions(params, (RequestOptions) null); - } - - /** List source transactions for a given source. */ - public SourceTransactionCollection sourceTransactions( - SourceSourceTransactionsParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/sources/%s/source_transactions", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.requestCollection(url, params, SourceTransactionCollection.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -704,12 +712,12 @@ public static class CardPresent extends StripeObject { @SerializedName("pos_entry_mode") String posEntryMode; - @SerializedName("reader") - String reader; - @SerializedName("read_method") String readMethod; + @SerializedName("reader") + String reader; + @SerializedName("terminal_verification_results") String terminalVerificationResults; @@ -819,9 +827,6 @@ public static class Klarna extends StripeObject { @SerializedName("pay_later_redirect_url") String payLaterRedirectUrl; - @SerializedName("payment_method_categories") - String paymentMethodCategories; - @SerializedName("pay_now_asset_urls_descriptive") String payNowAssetUrlsDescriptive; @@ -846,6 +851,9 @@ public static class Klarna extends StripeObject { @SerializedName("pay_over_time_redirect_url") String payOverTimeRedirectUrl; + @SerializedName("payment_method_categories") + String paymentMethodCategories; + @SerializedName("purchase_country") String purchaseCountry; diff --git a/src/main/java/com/stripe/model/SourceMandateNotification.java b/src/main/java/com/stripe/model/SourceMandateNotification.java index 7d3e3b1703c..84a8dd8977b 100644 --- a/src/main/java/com/stripe/model/SourceMandateNotification.java +++ b/src/main/java/com/stripe/model/SourceMandateNotification.java @@ -6,6 +6,10 @@ import lombok.Getter; import lombok.Setter; +/** + * Source mandate notifications should be created when a notification related to a source mandate + * must be sent to the payer. They will trigger a webhook or deliver an email to the customer. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/SourceTransaction.java b/src/main/java/com/stripe/model/SourceTransaction.java index 3d662a589cb..7151842b11c 100644 --- a/src/main/java/com/stripe/model/SourceTransaction.java +++ b/src/main/java/com/stripe/model/SourceTransaction.java @@ -6,6 +6,11 @@ import lombok.Getter; import lombok.Setter; +/** + * Some payment methods have no required amount that a customer must send. Customers can be + * instructed to send any amount, and it can be made up of multiple transactions. As such, sources + * can have multiple associated transactions. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/StripeErrorResponse.java b/src/main/java/com/stripe/model/StripeErrorResponse.java index 717e4bab6d5..aec92c02098 100644 --- a/src/main/java/com/stripe/model/StripeErrorResponse.java +++ b/src/main/java/com/stripe/model/StripeErrorResponse.java @@ -6,6 +6,7 @@ import lombok.Getter; import lombok.Setter; +/** An error response from the Stripe API. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index 937d6c7a190..3179b5a0776 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -20,6 +20,12 @@ import lombok.Getter; import lombok.Setter; +/** + * Subscriptions allow you to charge a customer on a recurring basis. + * + *

Related guide: Creating + * Subscriptions. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -473,92 +479,122 @@ public void setTestClockObject(TestClock expandableObject) { } /** - * Search for subscriptions you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static SubscriptionSearchResult search(Map params) throws StripeException { - return search(params, (RequestOptions) null); - } - - /** - * Search for subscriptions you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static SubscriptionSearchResult search(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscriptions/search"); - return ApiResource.requestSearchResult(url, params, SubscriptionSearchResult.class, options); - } - - /** - * Search for subscriptions you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. - */ - public static SubscriptionSearchResult search(SubscriptionSearchParams params) - throws StripeException { - return search(params, (RequestOptions) null); - } - - /** - * Search for subscriptions you’ve previously created using Stripe’s Search Query Language. Don’t - * use search in read-after-write flows where strict consistency is necessary. Under normal - * operating conditions, data is searchable in less than a minute. Occasionally, propagation of - * new or updated data can be up to an hour behind during outages. Search functionality is not - * available to merchants in India. + * Cancels a customer’s subscription immediately. The customer will not be charged again for the + * subscription. + * + *

Note, however, that any pending invoice items that you’ve created will still be charged for + * 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 will also be left in + * place and collected at the end of the period. But if the subscription is set to cancel + * immediately, pending prorations will be removed. + * + *

By default, upon subscription cancellation, Stripe will stop automatic collection of all + * finalized invoices for the customer. This is intended to prevent unexpected payment attempts + * after the customer has canceled a subscription. However, you can resume automatic collection of + * the invoices manually after subscription cancellation to have us proceed. Or, you could check + * for unpaid invoices before allowing the customer to cancel the subscription at all. */ - public static SubscriptionSearchResult search( - SubscriptionSearchParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscriptions/search"); - return ApiResource.requestSearchResult(url, params, SubscriptionSearchResult.class, options); + public Subscription cancel() throws StripeException { + return cancel((Map) null, (RequestOptions) null); } /** - * By default, returns a list of subscriptions that have not been canceled. In order to list - * canceled subscriptions, specify status=canceled. + * Cancels a customer’s subscription immediately. The customer will not be charged again for the + * subscription. + * + *

Note, however, that any pending invoice items that you’ve created will still be charged for + * 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 will also be left in + * place and collected at the end of the period. But if the subscription is set to cancel + * immediately, pending prorations will be removed. + * + *

By default, upon subscription cancellation, Stripe will stop automatic collection of all + * finalized invoices for the customer. This is intended to prevent unexpected payment attempts + * after the customer has canceled a subscription. However, you can resume automatic collection of + * the invoices manually after subscription cancellation to have us proceed. Or, you could check + * for unpaid invoices before allowing the customer to cancel the subscription at all. */ - public static SubscriptionCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); + public Subscription cancel(Map params) throws StripeException { + return cancel(params, (RequestOptions) null); } /** - * By default, returns a list of subscriptions that have not been canceled. In order to list - * canceled subscriptions, specify status=canceled. + * Cancels a customer’s subscription immediately. The customer will not be charged again for the + * subscription. + * + *

Note, however, that any pending invoice items that you’ve created will still be charged for + * 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 will also be left in + * place and collected at the end of the period. But if the subscription is set to cancel + * immediately, pending prorations will be removed. + * + *

By default, upon subscription cancellation, Stripe will stop automatic collection of all + * finalized invoices for the customer. This is intended to prevent unexpected payment attempts + * after the customer has canceled a subscription. However, you can resume automatic collection of + * the invoices manually after subscription cancellation to have us proceed. Or, you could check + * for unpaid invoices before allowing the customer to cancel the subscription at all. */ - public static SubscriptionCollection list(Map params, RequestOptions options) + public Subscription cancel(Map params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscriptions"); - return ApiResource.requestCollection(url, params, SubscriptionCollection.class, options); + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/subscriptions/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, Subscription.class, options); } /** - * By default, returns a list of subscriptions that have not been canceled. In order to list - * canceled subscriptions, specify status=canceled. + * Cancels a customer’s subscription immediately. The customer will not be charged again for the + * subscription. + * + *

Note, however, that any pending invoice items that you’ve created will still be charged for + * 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 will also be left in + * place and collected at the end of the period. But if the subscription is set to cancel + * immediately, pending prorations will be removed. + * + *

By default, upon subscription cancellation, Stripe will stop automatic collection of all + * finalized invoices for the customer. This is intended to prevent unexpected payment attempts + * after the customer has canceled a subscription. However, you can resume automatic collection of + * the invoices manually after subscription cancellation to have us proceed. Or, you could check + * for unpaid invoices before allowing the customer to cancel the subscription at all. */ - public static SubscriptionCollection list(SubscriptionListParams params) throws StripeException { - return list(params, (RequestOptions) null); + public Subscription cancel(SubscriptionCancelParams params) throws StripeException { + return cancel(params, (RequestOptions) null); } /** - * By default, returns a list of subscriptions that have not been canceled. In order to list - * canceled subscriptions, specify status=canceled. + * Cancels a customer’s subscription immediately. The customer will not be charged again for the + * subscription. + * + *

Note, however, that any pending invoice items that you’ve created will still be charged for + * 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 will also be left in + * place and collected at the end of the period. But if the subscription is set to cancel + * immediately, pending prorations will be removed. + * + *

By default, upon subscription cancellation, Stripe will stop automatic collection of all + * finalized invoices for the customer. This is intended to prevent unexpected payment attempts + * after the customer has canceled a subscription. However, you can resume automatic collection of + * the invoices manually after subscription cancellation to have us proceed. Or, you could check + * for unpaid invoices before allowing the customer to cancel the subscription at all. */ - public static SubscriptionCollection list(SubscriptionListParams params, RequestOptions options) + public Subscription cancel(SubscriptionCancelParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscriptions"); - return ApiResource.requestCollection(url, params, SubscriptionCollection.class, options); + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/subscriptions/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, Subscription.class, options); } /** @@ -639,60 +675,62 @@ public static Subscription create(SubscriptionCreateParams params, RequestOption ApiResource.RequestMethod.POST, url, params, Subscription.class, options); } - /** - * Updates an existing subscription on a customer to match the specified parameters. When changing - * plans or quantities, we will optionally prorate the price we charge next month to make up for - * any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint. - */ - @Override - public Subscription update(Map params) throws StripeException { - return update(params, (RequestOptions) null); + /** Removes the currently applied discount on a subscription. */ + public Discount deleteDiscount() throws StripeException { + return deleteDiscount((Map) null, (RequestOptions) null); } - /** - * Updates an existing subscription on a customer to match the specified parameters. When changing - * plans or quantities, we will optionally prorate the price we charge next month to make up for - * any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint. - */ - @Override - public Subscription update(Map params, RequestOptions options) + /** Removes the currently applied discount on a subscription. */ + public Discount deleteDiscount(Map params) throws StripeException { + return deleteDiscount(params, (RequestOptions) null); + } + + /** Removes the currently applied discount on a subscription. */ + public Discount deleteDiscount(Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/subscriptions/%s", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/subscriptions/%s/discount", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Subscription.class, options); + ApiResource.RequestMethod.DELETE, url, params, Discount.class, options); } /** - * Updates an existing subscription on a customer to match the specified parameters. When changing - * plans or quantities, we will optionally prorate the price we charge next month to make up for - * any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint. + * By default, returns a list of subscriptions that have not been canceled. In order to list + * canceled subscriptions, specify status=canceled. */ - public Subscription update(SubscriptionUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + public static SubscriptionCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); } /** - * Updates an existing subscription on a customer to match the specified parameters. When changing - * plans or quantities, we will optionally prorate the price we charge next month to make up for - * any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint. + * By default, returns a list of subscriptions that have not been canceled. In order to list + * canceled subscriptions, specify status=canceled. */ - public Subscription update(SubscriptionUpdateParams params, RequestOptions options) + public static SubscriptionCollection list(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/subscriptions/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Subscription.class, options); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscriptions"); + return ApiResource.requestCollection(url, params, SubscriptionCollection.class, options); + } + + /** + * By default, returns a list of subscriptions that have not been canceled. In order to list + * canceled subscriptions, specify status=canceled. + */ + public static SubscriptionCollection list(SubscriptionListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * By default, returns a list of subscriptions that have not been canceled. In order to list + * canceled subscriptions, specify status=canceled. + */ + public static SubscriptionCollection list(SubscriptionListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscriptions"); + return ApiResource.requestCollection(url, params, SubscriptionCollection.class, options); } /** Retrieves the subscription with the given ID. */ @@ -733,114 +771,77 @@ public static Subscription retrieve( } /** - * Cancels a customer’s subscription immediately. The customer will not be charged again for the - * subscription. - * - *

Note, however, that any pending invoice items that you’ve created will still be charged for - * 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 will also be left in - * place and collected at the end of the period. But if the subscription is set to cancel - * immediately, pending prorations will be removed. - * - *

By default, upon subscription cancellation, Stripe will stop automatic collection of all - * finalized invoices for the customer. This is intended to prevent unexpected payment attempts - * after the customer has canceled a subscription. However, you can resume automatic collection of - * the invoices manually after subscription cancellation to have us proceed. Or, you could check - * for unpaid invoices before allowing the customer to cancel the subscription at all. + * Search for subscriptions you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public Subscription cancel() throws StripeException { - return cancel((Map) null, (RequestOptions) null); + public static SubscriptionSearchResult search(Map params) throws StripeException { + return search(params, (RequestOptions) null); } /** - * Cancels a customer’s subscription immediately. The customer will not be charged again for the - * subscription. - * - *

Note, however, that any pending invoice items that you’ve created will still be charged for - * 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 will also be left in - * place and collected at the end of the period. But if the subscription is set to cancel - * immediately, pending prorations will be removed. - * - *

By default, upon subscription cancellation, Stripe will stop automatic collection of all - * finalized invoices for the customer. This is intended to prevent unexpected payment attempts - * after the customer has canceled a subscription. However, you can resume automatic collection of - * the invoices manually after subscription cancellation to have us proceed. Or, you could check - * for unpaid invoices before allowing the customer to cancel the subscription at all. + * Search for subscriptions you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public Subscription cancel(Map params) throws StripeException { - return cancel(params, (RequestOptions) null); + public static SubscriptionSearchResult search(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscriptions/search"); + return ApiResource.requestSearchResult(url, params, SubscriptionSearchResult.class, options); } /** - * Cancels a customer’s subscription immediately. The customer will not be charged again for the - * subscription. - * - *

Note, however, that any pending invoice items that you’ve created will still be charged for - * 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 will also be left in - * place and collected at the end of the period. But if the subscription is set to cancel - * immediately, pending prorations will be removed. - * - *

By default, upon subscription cancellation, Stripe will stop automatic collection of all - * finalized invoices for the customer. This is intended to prevent unexpected payment attempts - * after the customer has canceled a subscription. However, you can resume automatic collection of - * the invoices manually after subscription cancellation to have us proceed. Or, you could check - * for unpaid invoices before allowing the customer to cancel the subscription at all. + * Search for subscriptions you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public Subscription cancel(Map params, RequestOptions options) + public static SubscriptionSearchResult search(SubscriptionSearchParams params) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/subscriptions/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, Subscription.class, options); + return search(params, (RequestOptions) null); } /** - * Cancels a customer’s subscription immediately. The customer will not be charged again for the - * subscription. - * - *

Note, however, that any pending invoice items that you’ve created will still be charged for - * 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 will also be left in - * place and collected at the end of the period. But if the subscription is set to cancel - * immediately, pending prorations will be removed. - * - *

By default, upon subscription cancellation, Stripe will stop automatic collection of all - * finalized invoices for the customer. This is intended to prevent unexpected payment attempts - * after the customer has canceled a subscription. However, you can resume automatic collection of - * the invoices manually after subscription cancellation to have us proceed. Or, you could check - * for unpaid invoices before allowing the customer to cancel the subscription at all. + * Search for subscriptions you’ve previously created using Stripe’s Search Query Language. Don’t + * use search in read-after-write flows where strict consistency is necessary. Under normal + * operating conditions, data is searchable in less than a minute. Occasionally, propagation of + * new or updated data can be up to an hour behind during outages. Search functionality is not + * available to merchants in India. */ - public Subscription cancel(SubscriptionCancelParams params) throws StripeException { - return cancel(params, (RequestOptions) null); + public static SubscriptionSearchResult search( + SubscriptionSearchParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscriptions/search"); + return ApiResource.requestSearchResult(url, params, SubscriptionSearchResult.class, options); } /** - * Cancels a customer’s subscription immediately. The customer will not be charged again for the - * subscription. - * - *

Note, however, that any pending invoice items that you’ve created will still be charged for - * 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 will also be left in - * place and collected at the end of the period. But if the subscription is set to cancel - * immediately, pending prorations will be removed. - * - *

By default, upon subscription cancellation, Stripe will stop automatic collection of all - * finalized invoices for the customer. This is intended to prevent unexpected payment attempts - * after the customer has canceled a subscription. However, you can resume automatic collection of - * the invoices manually after subscription cancellation to have us proceed. Or, you could check - * for unpaid invoices before allowing the customer to cancel the subscription at all. + * Updates an existing subscription on a customer to match the specified parameters. When changing + * plans or quantities, we will optionally prorate the price we charge next month to make up for + * any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint. */ - public Subscription cancel(SubscriptionCancelParams params, RequestOptions options) + @Override + public Subscription update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates an existing subscription on a customer to match the specified parameters. When changing + * plans or quantities, we will optionally prorate the price we charge next month to make up for + * any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint. + */ + @Override + public Subscription update(Map params, RequestOptions options) throws StripeException { String url = String.format( @@ -848,29 +849,34 @@ public Subscription cancel(SubscriptionCancelParams params, RequestOptions optio Stripe.getApiBase(), String.format("/v1/subscriptions/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, Subscription.class, options); - } - - /** Removes the currently applied discount on a subscription. */ - public Discount deleteDiscount() throws StripeException { - return deleteDiscount((Map) null, (RequestOptions) null); + ApiResource.RequestMethod.POST, url, params, Subscription.class, options); } - /** Removes the currently applied discount on a subscription. */ - public Discount deleteDiscount(Map params) throws StripeException { - return deleteDiscount(params, (RequestOptions) null); + /** + * Updates an existing subscription on a customer to match the specified parameters. When changing + * plans or quantities, we will optionally prorate the price we charge next month to make up for + * any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint. + */ + public Subscription update(SubscriptionUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); } - /** Removes the currently applied discount on a subscription. */ - public Discount deleteDiscount(Map params, RequestOptions options) + /** + * Updates an existing subscription on a customer to match the specified parameters. When changing + * plans or quantities, we will optionally prorate the price we charge next month to make up for + * any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint. + */ + public Subscription update(SubscriptionUpdateParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/subscriptions/%s/discount", ApiResource.urlEncodeId(this.getId()))); + String.format("/v1/subscriptions/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, Discount.class, options); + ApiResource.RequestMethod.POST, url, params, Subscription.class, options); } @Getter @@ -900,6 +906,10 @@ public static class BillingThresholds extends StripeObject { Boolean resetBillingCycleAnchor; } + /** + * The Pause Collection settings determine how we will pause collection for this subscription and + * for how long the subscription should be paused. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -1011,6 +1021,13 @@ public static class Card extends StripeObject { @SerializedName("mandate_options") MandateOptions mandateOptions; + /** + * Selected network to process this Subscription on. Depends on the available networks of the + * card attached to the Subscription. Can be only set confirm-time. + */ + @SerializedName("network") + String network; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and taxRates; + /** Adds a new item to an existing subscription. No existing items will be changed or replaced. */ + public static SubscriptionItem create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Adds a new item to an existing subscription. No existing items will be changed or replaced. */ + public static SubscriptionItem create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_items"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, SubscriptionItem.class, options); + } + + /** Adds a new item to an existing subscription. No existing items will be changed or replaced. */ + public static SubscriptionItem create(SubscriptionItemCreateParams params) + throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Adds a new item to an existing subscription. No existing items will be changed or replaced. */ + public static SubscriptionItem create(SubscriptionItemCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_items"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, SubscriptionItem.class, options); + } + + /** + * Deletes an item from the subscription. Removing a subscription item from a subscription will + * not cancel the subscription. + */ + public SubscriptionItem delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); + } + + /** + * Deletes an item from the subscription. Removing a subscription item from a subscription will + * not cancel the subscription. + */ + public SubscriptionItem delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** + * Deletes an item from the subscription. Removing a subscription item from a subscription will + * not cancel the subscription. + */ + public SubscriptionItem delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** + * Deletes an item from the subscription. Removing a subscription item from a subscription will + * not cancel the subscription. + */ + public SubscriptionItem delete(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/subscription_items/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, SubscriptionItem.class, options); + } + + /** + * Deletes an item from the subscription. Removing a subscription item from a subscription will + * not cancel the subscription. + */ + public SubscriptionItem delete(SubscriptionItemDeleteParams params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** + * Deletes an item from the subscription. Removing a subscription item from a subscription will + * not cancel the subscription. + */ + public SubscriptionItem delete(SubscriptionItemDeleteParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/subscription_items/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, SubscriptionItem.class, options); + } + /** Returns a list of your subscription items for a given subscription. */ public static SubscriptionItemCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -181,33 +274,6 @@ public static SubscriptionItem retrieve( ApiResource.RequestMethod.GET, url, params, SubscriptionItem.class, options); } - /** Adds a new item to an existing subscription. No existing items will be changed or replaced. */ - public static SubscriptionItem create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Adds a new item to an existing subscription. No existing items will be changed or replaced. */ - public static SubscriptionItem create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_items"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, SubscriptionItem.class, options); - } - - /** Adds a new item to an existing subscription. No existing items will be changed or replaced. */ - public static SubscriptionItem create(SubscriptionItemCreateParams params) - throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Adds a new item to an existing subscription. No existing items will be changed or replaced. */ - public static SubscriptionItem create(SubscriptionItemCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_items"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, SubscriptionItem.class, options); - } - /** Updates the plan or quantity of an item on a current subscription. */ @Override public SubscriptionItem update(Map params) throws StripeException { @@ -244,68 +310,6 @@ public SubscriptionItem update(SubscriptionItemUpdateParams params, RequestOptio ApiResource.RequestMethod.POST, url, params, SubscriptionItem.class, options); } - /** - * Deletes an item from the subscription. Removing a subscription item from a subscription will - * not cancel the subscription. - */ - public SubscriptionItem delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** - * Deletes an item from the subscription. Removing a subscription item from a subscription will - * not cancel the subscription. - */ - public SubscriptionItem delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** - * Deletes an item from the subscription. Removing a subscription item from a subscription will - * not cancel the subscription. - */ - public SubscriptionItem delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** - * Deletes an item from the subscription. Removing a subscription item from a subscription will - * not cancel the subscription. - */ - public SubscriptionItem delete(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/subscription_items/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, SubscriptionItem.class, options); - } - - /** - * Deletes an item from the subscription. Removing a subscription item from a subscription will - * not cancel the subscription. - */ - public SubscriptionItem delete(SubscriptionItemDeleteParams params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** - * Deletes an item from the subscription. Removing a subscription item from a subscription will - * not cancel the subscription. - */ - public SubscriptionItem delete(SubscriptionItemDeleteParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/subscription_items/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, SubscriptionItem.class, options); - } - /** * For the specified subscription item, returns a list of summary objects. Each object in the list * provides usage information that’s been summarized from multiple usage records and over a diff --git a/src/main/java/com/stripe/model/SubscriptionSchedule.java b/src/main/java/com/stripe/model/SubscriptionSchedule.java index 7cad85e3784..ce83096ef68 100644 --- a/src/main/java/com/stripe/model/SubscriptionSchedule.java +++ b/src/main/java/com/stripe/model/SubscriptionSchedule.java @@ -20,6 +20,14 @@ import lombok.Getter; import lombok.Setter; +/** + * A subscription schedule allows you to create and manage the lifecycle of a subscription by + * predefining expected changes. + * + *

Related guide: Subscription + * Schedules. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -213,158 +221,6 @@ public void setTestClockObject(TestClock expandableObject) { this.testClock = new ExpandableField(expandableObject.getId(), expandableObject); } - /** Retrieves the list of your subscription schedules. */ - public static SubscriptionScheduleCollection list(Map params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Retrieves the list of your subscription schedules. */ - public static SubscriptionScheduleCollection list( - Map params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_schedules"); - return ApiResource.requestCollection( - url, params, SubscriptionScheduleCollection.class, options); - } - - /** Retrieves the list of your subscription schedules. */ - public static SubscriptionScheduleCollection list(SubscriptionScheduleListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Retrieves the list of your subscription schedules. */ - public static SubscriptionScheduleCollection list( - SubscriptionScheduleListParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_schedules"); - return ApiResource.requestCollection( - url, params, SubscriptionScheduleCollection.class, options); - } - - /** - * Creates a new subscription schedule object. Each customer can have up to 500 active or - * scheduled subscriptions. - */ - public static SubscriptionSchedule create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * Creates a new subscription schedule object. Each customer can have up to 500 active or - * scheduled subscriptions. - */ - public static SubscriptionSchedule create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_schedules"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, SubscriptionSchedule.class, options); - } - - /** - * Creates a new subscription schedule object. Each customer can have up to 500 active or - * scheduled subscriptions. - */ - public static SubscriptionSchedule create(SubscriptionScheduleCreateParams params) - throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * Creates a new subscription schedule object. Each customer can have up to 500 active or - * scheduled subscriptions. - */ - public static SubscriptionSchedule create( - SubscriptionScheduleCreateParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_schedules"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, SubscriptionSchedule.class, options); - } - - /** - * Retrieves the details of an existing subscription schedule. You only need to supply the unique - * subscription schedule identifier that was returned upon subscription schedule creation. - */ - public static SubscriptionSchedule retrieve(String schedule) throws StripeException { - return retrieve(schedule, (Map) null, (RequestOptions) null); - } - - /** - * Retrieves the details of an existing subscription schedule. You only need to supply the unique - * subscription schedule identifier that was returned upon subscription schedule creation. - */ - public static SubscriptionSchedule retrieve(String schedule, RequestOptions options) - throws StripeException { - return retrieve(schedule, (Map) null, options); - } - - /** - * Retrieves the details of an existing subscription schedule. You only need to supply the unique - * subscription schedule identifier that was returned upon subscription schedule creation. - */ - public static SubscriptionSchedule retrieve( - String schedule, Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/subscription_schedules/%s", ApiResource.urlEncodeId(schedule))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, SubscriptionSchedule.class, options); - } - - /** - * Retrieves the details of an existing subscription schedule. You only need to supply the unique - * subscription schedule identifier that was returned upon subscription schedule creation. - */ - public static SubscriptionSchedule retrieve( - String schedule, SubscriptionScheduleRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/subscription_schedules/%s", ApiResource.urlEncodeId(schedule))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, SubscriptionSchedule.class, options); - } - - /** Updates an existing subscription schedule. */ - @Override - public SubscriptionSchedule update(Map params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** Updates an existing subscription schedule. */ - @Override - public SubscriptionSchedule update(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/subscription_schedules/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, SubscriptionSchedule.class, options); - } - - /** Updates an existing subscription schedule. */ - public SubscriptionSchedule update(SubscriptionScheduleUpdateParams params) - throws StripeException { - return update(params, (RequestOptions) null); - } - - /** Updates an existing subscription schedule. */ - public SubscriptionSchedule update( - SubscriptionScheduleUpdateParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/subscription_schedules/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, SubscriptionSchedule.class, options); - } - /** * Cancels a subscription schedule and its associated subscription immediately (if the * subscription schedule has an active subscription). A subscription schedule can only be canceled @@ -436,6 +292,73 @@ public SubscriptionSchedule cancel( ApiResource.RequestMethod.POST, url, params, SubscriptionSchedule.class, options); } + /** + * Creates a new subscription schedule object. Each customer can have up to 500 active or + * scheduled subscriptions. + */ + public static SubscriptionSchedule create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Creates a new subscription schedule object. Each customer can have up to 500 active or + * scheduled subscriptions. + */ + public static SubscriptionSchedule create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_schedules"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, SubscriptionSchedule.class, options); + } + + /** + * Creates a new subscription schedule object. Each customer can have up to 500 active or + * scheduled subscriptions. + */ + public static SubscriptionSchedule create(SubscriptionScheduleCreateParams params) + throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Creates a new subscription schedule object. Each customer can have up to 500 active or + * scheduled subscriptions. + */ + public static SubscriptionSchedule create( + SubscriptionScheduleCreateParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_schedules"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, SubscriptionSchedule.class, options); + } + + /** Retrieves the list of your subscription schedules. */ + public static SubscriptionScheduleCollection list(Map params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Retrieves the list of your subscription schedules. */ + public static SubscriptionScheduleCollection list( + Map params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_schedules"); + return ApiResource.requestCollection( + url, params, SubscriptionScheduleCollection.class, options); + } + + /** Retrieves the list of your subscription schedules. */ + public static SubscriptionScheduleCollection list(SubscriptionScheduleListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Retrieves the list of your subscription schedules. */ + public static SubscriptionScheduleCollection list( + SubscriptionScheduleListParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/subscription_schedules"); + return ApiResource.requestCollection( + url, params, SubscriptionScheduleCollection.class, options); + } + /** * Releases the subscription schedule immediately, which will stop scheduling of its phases, but * leave any existing subscription in place. A schedule can only be released if its status is @@ -519,6 +442,95 @@ public SubscriptionSchedule release( ApiResource.RequestMethod.POST, url, params, SubscriptionSchedule.class, options); } + /** + * Retrieves the details of an existing subscription schedule. You only need to supply the unique + * subscription schedule identifier that was returned upon subscription schedule creation. + */ + public static SubscriptionSchedule retrieve(String schedule) throws StripeException { + return retrieve(schedule, (Map) null, (RequestOptions) null); + } + + /** + * Retrieves the details of an existing subscription schedule. You only need to supply the unique + * subscription schedule identifier that was returned upon subscription schedule creation. + */ + public static SubscriptionSchedule retrieve(String schedule, RequestOptions options) + throws StripeException { + return retrieve(schedule, (Map) null, options); + } + + /** + * Retrieves the details of an existing subscription schedule. You only need to supply the unique + * subscription schedule identifier that was returned upon subscription schedule creation. + */ + public static SubscriptionSchedule retrieve( + String schedule, Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/subscription_schedules/%s", ApiResource.urlEncodeId(schedule))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, SubscriptionSchedule.class, options); + } + + /** + * Retrieves the details of an existing subscription schedule. You only need to supply the unique + * subscription schedule identifier that was returned upon subscription schedule creation. + */ + public static SubscriptionSchedule retrieve( + String schedule, SubscriptionScheduleRetrieveParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/subscription_schedules/%s", ApiResource.urlEncodeId(schedule))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, SubscriptionSchedule.class, options); + } + + /** Updates an existing subscription schedule. */ + @Override + public SubscriptionSchedule update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates an existing subscription schedule. */ + @Override + public SubscriptionSchedule update(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/subscription_schedules/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, SubscriptionSchedule.class, options); + } + + /** Updates an existing subscription schedule. */ + public SubscriptionSchedule update(SubscriptionScheduleUpdateParams params) + throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates an existing subscription schedule. */ + public SubscriptionSchedule update( + SubscriptionScheduleUpdateParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/subscription_schedules/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, SubscriptionSchedule.class, options); + } + + /** + * An Add Invoice Item describes the prices and quantities that will be added as pending invoice + * items when entering a phase. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -680,6 +692,10 @@ public static class InvoiceSettings extends StripeObject { Long daysUntilDue; } + /** + * A phase describes the plans, coupon, and trialing status of a subscription for a predefined + * time period. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -859,6 +875,7 @@ public static class AutomaticTax extends StripeObject { } } + /** A phase item describes the price and quantity of a phase. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/TaxCode.java b/src/main/java/com/stripe/model/TaxCode.java index 31e89a2b6f6..540e9625b68 100644 --- a/src/main/java/com/stripe/model/TaxCode.java +++ b/src/main/java/com/stripe/model/TaxCode.java @@ -13,6 +13,10 @@ import lombok.Getter; import lombok.Setter; +/** + * Tax codes classify goods and services + * for tax purposes. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/TaxId.java b/src/main/java/com/stripe/model/TaxId.java index e8bddfc8d63..9dd250d36c6 100644 --- a/src/main/java/com/stripe/model/TaxId.java +++ b/src/main/java/com/stripe/model/TaxId.java @@ -11,6 +11,14 @@ import lombok.Getter; import lombok.Setter; +/** + * You can add one or multiple tax IDs to a customer. A customer's tax IDs are displayed on + * invoices and credit notes issued for the customer. + * + *

Related guide: Customer Tax + * Identification Numbers. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/TaxIdCollection.java b/src/main/java/com/stripe/model/TaxIdCollection.java index 219767ee505..5936b098d5e 100644 --- a/src/main/java/com/stripe/model/TaxIdCollection.java +++ b/src/main/java/com/stripe/model/TaxIdCollection.java @@ -34,6 +34,30 @@ public TaxId create(TaxIdCollectionCreateParams params, RequestOptions options) return ApiResource.request(ApiResource.RequestMethod.POST, url, params, TaxId.class, options); } + /** Returns a list of tax IDs for a customer. */ + public TaxIdCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of tax IDs for a customer. */ + public TaxIdCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + return ApiResource.requestCollection(url, params, TaxIdCollection.class, options); + } + + /** Returns a list of tax IDs for a customer. */ + public TaxIdCollection list(TaxIdCollectionListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of tax IDs for a customer. */ + public TaxIdCollection list(TaxIdCollectionListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); + return ApiResource.requestCollection(url, params, TaxIdCollection.class, options); + } + /** Retrieves the TaxID object with the given identifier. */ public TaxId retrieve(String id) throws StripeException { return retrieve(id, (Map) null, (RequestOptions) null); @@ -65,28 +89,4 @@ public TaxId retrieve(String id, TaxIdCollectionRetrieveParams params, RequestOp String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id))); return ApiResource.request(ApiResource.RequestMethod.GET, url, params, TaxId.class, options); } - - /** Returns a list of tax IDs for a customer. */ - public TaxIdCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of tax IDs for a customer. */ - public TaxIdCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); - return ApiResource.requestCollection(url, params, TaxIdCollection.class, options); - } - - /** Returns a list of tax IDs for a customer. */ - public TaxIdCollection list(TaxIdCollectionListParams params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of tax IDs for a customer. */ - public TaxIdCollection list(TaxIdCollectionListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl()); - return ApiResource.requestCollection(url, params, TaxIdCollection.class, options); - } } diff --git a/src/main/java/com/stripe/model/TaxRate.java b/src/main/java/com/stripe/model/TaxRate.java index ae582715661..17bd490ce36 100644 --- a/src/main/java/com/stripe/model/TaxRate.java +++ b/src/main/java/com/stripe/model/TaxRate.java @@ -16,6 +16,15 @@ import lombok.Getter; import lombok.Setter; +/** + * Tax rates can be applied to invoices, subscriptions and Checkout + * Sessions to collect tax. + * + *

Related guide: Tax Rates. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -113,6 +122,30 @@ public class TaxRate extends ApiResource implements HasId, MetadataStore params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new tax rate. */ + public static TaxRate create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/tax_rates"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, TaxRate.class, options); + } + + /** Creates a new tax rate. */ + public static TaxRate create(TaxRateCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new tax rate. */ + public static TaxRate create(TaxRateCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/tax_rates"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, TaxRate.class, options); + } + /** * Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most * recently created tax rates appearing first. @@ -181,30 +214,6 @@ public static TaxRate retrieve( return ApiResource.request(ApiResource.RequestMethod.GET, url, params, TaxRate.class, options); } - /** Creates a new tax rate. */ - public static TaxRate create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new tax rate. */ - public static TaxRate create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/tax_rates"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, TaxRate.class, options); - } - - /** Creates a new tax rate. */ - public static TaxRate create(TaxRateCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new tax rate. */ - public static TaxRate create(TaxRateCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/tax_rates"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, TaxRate.class, options); - } - /** Updates an existing tax rate. */ @Override public TaxRate update(Map params) throws StripeException { diff --git a/src/main/java/com/stripe/model/Token.java b/src/main/java/com/stripe/model/Token.java index df1f2fde190..fbc4a8ca4ec 100644 --- a/src/main/java/com/stripe/model/Token.java +++ b/src/main/java/com/stripe/model/Token.java @@ -13,6 +13,30 @@ import lombok.Getter; import lombok.Setter; +/** + * Tokenization is the process Stripe uses to collect sensitive card or bank account details, or + * personally identifiable information (PII), directly from your customers in a secure manner. A + * token representing this information is returned to your server to use. You should use our recommended payments integrations to perform this + * process client-side. This ensures that no sensitive card data touches your server, and allows + * your integration to operate in a PCI-compliant way. + * + *

If you cannot use client-side tokenization, you can also create tokens using the API with + * either your publishable or secret API key. Keep in mind that if your integration uses this + * method, you are responsible for any PCI compliance that may be required, and you must keep your + * secret API key safe. Unlike with client-side tokenization, your customer's information is not + * sent directly to Stripe, so we cannot determine how it is handled or stored. + * + *

Tokens cannot be stored or used more than once. To store card or bank account information for + * later use, you can create Customer objects or + * Custom accounts. Note that Radar, our integrated solution for automatic fraud + * protection, performs best with integrations that use client-side tokenization. + * + *

Related guide: Accept a + * payment + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -77,36 +101,6 @@ public class Token extends ApiResource implements HasId { @SerializedName("used") Boolean used; - /** Retrieves the token with the given ID. */ - public static Token retrieve(String token) throws StripeException { - return retrieve(token, (Map) null, (RequestOptions) null); - } - - /** Retrieves the token with the given ID. */ - public static Token retrieve(String token, RequestOptions options) throws StripeException { - return retrieve(token, (Map) null, options); - } - - /** Retrieves the token with the given ID. */ - public static Token retrieve(String token, Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), String.format("/v1/tokens/%s", ApiResource.urlEncodeId(token))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Token.class, options); - } - - /** Retrieves the token with the given ID. */ - public static Token retrieve(String token, TokenRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), String.format("/v1/tokens/%s", ApiResource.urlEncodeId(token))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Token.class, options); - } - /** * Creates a single-use token that represents a bank account’s details. This token can be used * with any API method in place of a bank account dictionary. This token can be used only once, by @@ -146,4 +140,34 @@ public static Token create(TokenCreateParams params, RequestOptions options) String url = String.format("%s%s", Stripe.getApiBase(), "/v1/tokens"); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Token.class, options); } + + /** Retrieves the token with the given ID. */ + public static Token retrieve(String token) throws StripeException { + return retrieve(token, (Map) null, (RequestOptions) null); + } + + /** Retrieves the token with the given ID. */ + public static Token retrieve(String token, RequestOptions options) throws StripeException { + return retrieve(token, (Map) null, options); + } + + /** Retrieves the token with the given ID. */ + public static Token retrieve(String token, Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), String.format("/v1/tokens/%s", ApiResource.urlEncodeId(token))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Token.class, options); + } + + /** Retrieves the token with the given ID. */ + public static Token retrieve(String token, TokenRetrieveParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), String.format("/v1/tokens/%s", ApiResource.urlEncodeId(token))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Token.class, options); + } } diff --git a/src/main/java/com/stripe/model/Topup.java b/src/main/java/com/stripe/model/Topup.java index ec095554f6c..d299146b629 100644 --- a/src/main/java/com/stripe/model/Topup.java +++ b/src/main/java/com/stripe/model/Topup.java @@ -16,6 +16,13 @@ import lombok.Getter; import lombok.Setter; +/** + * To top up your Stripe balance, you create a top-up object. You can retrieve individual top-ups, + * as well as list all top-ups. Top-ups are identified by a unique, random ID. + * + *

Related guide: Topping Up your Platform + * Account. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -96,12 +103,9 @@ public class Topup extends ApiResource implements MetadataStore, BalanceT String object; /** - * {@code Source} objects allow you to accept a variety of payment methods. They represent a - * customer's payment instrument, and can be used with the Stripe API just like a {@code Card} - * object: once chargeable, they can be charged, or can be attached to customers. - * - *

Related guides: Sources API and Sources & Customers. + * For most Stripe users, the source of every top-up is a bank account. This hash is then the source object describing that bank + * account. */ @SerializedName("source") Source source; @@ -146,6 +150,46 @@ public void setBalanceTransactionObject(BalanceTransaction expandableObject) { new ExpandableField(expandableObject.getId(), expandableObject); } + /** Cancels a top-up. Only pending top-ups can be canceled. */ + public Topup cancel() throws StripeException { + return cancel((Map) null, (RequestOptions) null); + } + + /** Cancels a top-up. Only pending top-ups can be canceled. */ + public Topup cancel(RequestOptions options) throws StripeException { + return cancel((Map) null, options); + } + + /** Cancels a top-up. Only pending top-ups can be canceled. */ + public Topup cancel(Map params) throws StripeException { + return cancel(params, (RequestOptions) null); + } + + /** Cancels a top-up. Only pending top-ups can be canceled. */ + public Topup cancel(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/topups/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Topup.class, options); + } + + /** Cancels a top-up. Only pending top-ups can be canceled. */ + public Topup cancel(TopupCancelParams params) throws StripeException { + return cancel(params, (RequestOptions) null); + } + + /** Cancels a top-up. Only pending top-ups can be canceled. */ + public Topup cancel(TopupCancelParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/topups/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Topup.class, options); + } + /** Top up the balance of an account. */ public static Topup create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -271,44 +315,4 @@ public Topup update(TopupUpdateParams params, RequestOptions options) throws Str String.format("/v1/topups/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Topup.class, options); } - - /** Cancels a top-up. Only pending top-ups can be canceled. */ - public Topup cancel() throws StripeException { - return cancel((Map) null, (RequestOptions) null); - } - - /** Cancels a top-up. Only pending top-ups can be canceled. */ - public Topup cancel(RequestOptions options) throws StripeException { - return cancel((Map) null, options); - } - - /** Cancels a top-up. Only pending top-ups can be canceled. */ - public Topup cancel(Map params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** Cancels a top-up. Only pending top-ups can be canceled. */ - public Topup cancel(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/topups/%s/cancel", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Topup.class, options); - } - - /** Cancels a top-up. Only pending top-ups can be canceled. */ - public Topup cancel(TopupCancelParams params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** Cancels a top-up. Only pending top-ups can be canceled. */ - public Topup cancel(TopupCancelParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/topups/%s/cancel", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Topup.class, options); - } } diff --git a/src/main/java/com/stripe/model/Transfer.java b/src/main/java/com/stripe/model/Transfer.java index 6ebe68e80f8..ae045cdf9e9 100644 --- a/src/main/java/com/stripe/model/Transfer.java +++ b/src/main/java/com/stripe/model/Transfer.java @@ -15,6 +15,19 @@ import lombok.Getter; import lombok.Setter; +/** + * A {@code Transfer} object is created when you move funds between Stripe accounts as part of + * Connect. + * + *

Before April 6, 2017, transfers also represented movement of funds from a Stripe account to a + * card or bank account. This behavior has since been split out into a Payout object, with corresponding payout + * endpoints. For more information, read about the transfer/payout split. + * + *

Related guide: Creating Separate + * Charges and Transfers. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/TransferReversal.java b/src/main/java/com/stripe/model/TransferReversal.java index 15fa58d4f05..94ad9a70107 100644 --- a/src/main/java/com/stripe/model/TransferReversal.java +++ b/src/main/java/com/stripe/model/TransferReversal.java @@ -12,6 +12,22 @@ import lombok.Getter; import lombok.Setter; +/** + * Stripe Connect platforms can reverse transfers made + * to a connected account, either entirely or partially, and can also specify whether to refund any + * related application fees. Transfer reversals add to the platform's balance and subtract from the + * destination account's balance. + * + *

Reversing a transfer that was made for a destination charge is allowed only + * up to the amount of the charge. It is possible to reverse a transfer_group + * transfer only if the destination account has enough balance to cover the reversal. + * + *

Related guide: Reversing + * Transfers. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/UsageRecord.java b/src/main/java/com/stripe/model/UsageRecord.java index 1fa8448a553..f951aae8882 100644 --- a/src/main/java/com/stripe/model/UsageRecord.java +++ b/src/main/java/com/stripe/model/UsageRecord.java @@ -12,6 +12,13 @@ import lombok.Getter; import lombok.Setter; +/** + * Usage records allow you to report customer usage and metrics to Stripe for metered billing of + * subscription prices. + * + *

Related guide: Metered + * Billing. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/WebhookEndpoint.java b/src/main/java/com/stripe/model/WebhookEndpoint.java index d5806dc6ea7..7bd18d0e8f0 100644 --- a/src/main/java/com/stripe/model/WebhookEndpoint.java +++ b/src/main/java/com/stripe/model/WebhookEndpoint.java @@ -16,6 +16,16 @@ import lombok.Getter; import lombok.Setter; +/** + * You can configure webhook endpoints via the API + * to be notified about events that happen in your Stripe account or connected accounts. + * + *

Most users configure webhooks from the + * dashboard, which provides a user interface for registering and testing your webhook + * endpoints. + * + *

Related guide: Setting up Webhooks. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -92,6 +102,107 @@ public class WebhookEndpoint extends ApiResource implements HasId, MetadataStore @SerializedName("url") String url; + /** + * A webhook endpoint must have a url and a list of enabled_events. You + * may optionally specify the Boolean connect parameter. If set to true, then a + * Connect webhook endpoint that notifies the specified url about events from all + * connected accounts is created; otherwise an account webhook endpoint that notifies the + * specified url only about events from your account is created. You can also create + * webhook endpoints in the webhooks + * settings section of the Dashboard. + */ + public static WebhookEndpoint create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * A webhook endpoint must have a url and a list of enabled_events. You + * may optionally specify the Boolean connect parameter. If set to true, then a + * Connect webhook endpoint that notifies the specified url about events from all + * connected accounts is created; otherwise an account webhook endpoint that notifies the + * specified url only about events from your account is created. You can also create + * webhook endpoints in the webhooks + * settings section of the Dashboard. + */ + public static WebhookEndpoint create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/webhook_endpoints"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, WebhookEndpoint.class, options); + } + + /** + * A webhook endpoint must have a url and a list of enabled_events. You + * may optionally specify the Boolean connect parameter. If set to true, then a + * Connect webhook endpoint that notifies the specified url about events from all + * connected accounts is created; otherwise an account webhook endpoint that notifies the + * specified url only about events from your account is created. You can also create + * webhook endpoints in the webhooks + * settings section of the Dashboard. + */ + public static WebhookEndpoint create(WebhookEndpointCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * A webhook endpoint must have a url and a list of enabled_events. You + * may optionally specify the Boolean connect parameter. If set to true, then a + * Connect webhook endpoint that notifies the specified url about events from all + * connected accounts is created; otherwise an account webhook endpoint that notifies the + * specified url only about events from your account is created. You can also create + * webhook endpoints in the webhooks + * settings section of the Dashboard. + */ + public static WebhookEndpoint create(WebhookEndpointCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/webhook_endpoints"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, WebhookEndpoint.class, options); + } + + /** + * You can also delete webhook endpoints via the webhook endpoint management page of + * the Stripe dashboard. + */ + public WebhookEndpoint delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); + } + + /** + * You can also delete webhook endpoints via the webhook endpoint management page of + * the Stripe dashboard. + */ + public WebhookEndpoint delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** + * You can also delete webhook endpoints via the webhook endpoint management page of + * the Stripe dashboard. + */ + public WebhookEndpoint delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** + * You can also delete webhook endpoints via the webhook endpoint management page of + * the Stripe dashboard. + */ + public WebhookEndpoint delete(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/webhook_endpoints/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, WebhookEndpoint.class, options); + } + /** Returns a list of your webhook endpoints. */ public static WebhookEndpointCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -154,64 +265,6 @@ public static WebhookEndpoint retrieve( ApiResource.RequestMethod.GET, url, params, WebhookEndpoint.class, options); } - /** - * A webhook endpoint must have a url and a list of enabled_events. You - * may optionally specify the Boolean connect parameter. If set to true, then a - * Connect webhook endpoint that notifies the specified url about events from all - * connected accounts is created; otherwise an account webhook endpoint that notifies the - * specified url only about events from your account is created. You can also create - * webhook endpoints in the webhooks - * settings section of the Dashboard. - */ - public static WebhookEndpoint create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * A webhook endpoint must have a url and a list of enabled_events. You - * may optionally specify the Boolean connect parameter. If set to true, then a - * Connect webhook endpoint that notifies the specified url about events from all - * connected accounts is created; otherwise an account webhook endpoint that notifies the - * specified url only about events from your account is created. You can also create - * webhook endpoints in the webhooks - * settings section of the Dashboard. - */ - public static WebhookEndpoint create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/webhook_endpoints"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, WebhookEndpoint.class, options); - } - - /** - * A webhook endpoint must have a url and a list of enabled_events. You - * may optionally specify the Boolean connect parameter. If set to true, then a - * Connect webhook endpoint that notifies the specified url about events from all - * connected accounts is created; otherwise an account webhook endpoint that notifies the - * specified url only about events from your account is created. You can also create - * webhook endpoints in the webhooks - * settings section of the Dashboard. - */ - public static WebhookEndpoint create(WebhookEndpointCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * A webhook endpoint must have a url and a list of enabled_events. You - * may optionally specify the Boolean connect parameter. If set to true, then a - * Connect webhook endpoint that notifies the specified url about events from all - * connected accounts is created; otherwise an account webhook endpoint that notifies the - * specified url only about events from your account is created. You can also create - * webhook endpoints in the webhooks - * settings section of the Dashboard. - */ - public static WebhookEndpoint create(WebhookEndpointCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/webhook_endpoints"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, WebhookEndpoint.class, options); - } - /** * Updates the webhook endpoint. You may edit the url, the list of * enabled_events, and the status of your endpoint. @@ -259,47 +312,4 @@ public WebhookEndpoint update(WebhookEndpointUpdateParams params, RequestOptions return ApiResource.request( ApiResource.RequestMethod.POST, url, params, WebhookEndpoint.class, options); } - - /** - * You can also delete webhook endpoints via the webhook endpoint management page of - * the Stripe dashboard. - */ - public WebhookEndpoint delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** - * You can also delete webhook endpoints via the webhook endpoint management page of - * the Stripe dashboard. - */ - public WebhookEndpoint delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** - * You can also delete webhook endpoints via the webhook endpoint management page of - * the Stripe dashboard. - */ - public WebhookEndpoint delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** - * You can also delete webhook endpoints via the webhook endpoint management page of - * the Stripe dashboard. - */ - public WebhookEndpoint delete(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/webhook_endpoints/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, WebhookEndpoint.class, options); - } } diff --git a/src/main/java/com/stripe/model/apps/Secret.java b/src/main/java/com/stripe/model/apps/Secret.java index 8a4b886bfcf..668896342cc 100644 --- a/src/main/java/com/stripe/model/apps/Secret.java +++ b/src/main/java/com/stripe/model/apps/Secret.java @@ -17,6 +17,24 @@ import lombok.Getter; import lombok.Setter; +/** + * Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by + * UI Extensions and app backends. + * + *

The primary resource in Secret Store is a {@code secret}. Other apps can't view secrets + * created by an app. Additionally, secrets are scoped to provide further permission control. + * + *

All Dashboard users and the app backend share {@code account} scoped secrets. Use the {@code + * account} scope for secrets that don't change per-user, like a third-party API key. + * + *

A {@code user} scoped secret is accessible by the app backend and one specific Dashboard user. + * Use the {@code user} scope for per-user secrets like per-user OAuth tokens, where different users + * might have different permissions. + * + *

Related guide: Store data between page + * reloads. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -64,30 +82,6 @@ public class Secret extends ApiResource implements HasId { @SerializedName("scope") Scope scope; - /** Finds a secret in the secret store by name and scope. */ - public static Secret find(Map params) throws StripeException { - return find(params, (RequestOptions) null); - } - - /** Finds a secret in the secret store by name and scope. */ - public static Secret find(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apps/secrets/find"); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Secret.class, options); - } - - /** Finds a secret in the secret store by name and scope. */ - public static Secret find(SecretFindParams params) throws StripeException { - return find(params, (RequestOptions) null); - } - - /** Finds a secret in the secret store by name and scope. */ - public static Secret find(SecretFindParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apps/secrets/find"); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Secret.class, options); - } - /** Create or replace a secret in the secret store. */ public static Secret create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -136,6 +130,30 @@ public static Secret deleteWhere(SecretDeleteWhereParams params, RequestOptions return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Secret.class, options); } + /** Finds a secret in the secret store by name and scope. */ + public static Secret find(Map params) throws StripeException { + return find(params, (RequestOptions) null); + } + + /** Finds a secret in the secret store by name and scope. */ + public static Secret find(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apps/secrets/find"); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Secret.class, options); + } + + /** Finds a secret in the secret store by name and scope. */ + public static Secret find(SecretFindParams params) throws StripeException { + return find(params, (RequestOptions) null); + } + + /** Finds a secret in the secret store by name and scope. */ + public static Secret find(SecretFindParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apps/secrets/find"); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Secret.class, options); + } + /** List all secrets stored on the given scope. */ public static SecretCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); diff --git a/src/main/java/com/stripe/model/billingportal/Configuration.java b/src/main/java/com/stripe/model/billingportal/Configuration.java index 17502cf4e37..147017f5d88 100644 --- a/src/main/java/com/stripe/model/billingportal/Configuration.java +++ b/src/main/java/com/stripe/model/billingportal/Configuration.java @@ -21,6 +21,7 @@ import lombok.Getter; import lombok.Setter; +/** A portal configuration describes the functionality and behavior of a portal session. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -113,31 +114,6 @@ public void setApplicationObject(Application expandableObject) { this.application = new ExpandableField(expandableObject.getId(), expandableObject); } - /** Returns a list of configurations that describe the functionality of the customer portal. */ - public static ConfigurationCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of configurations that describe the functionality of the customer portal. */ - public static ConfigurationCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/billing_portal/configurations"); - return ApiResource.requestCollection(url, params, ConfigurationCollection.class, options); - } - - /** Returns a list of configurations that describe the functionality of the customer portal. */ - public static ConfigurationCollection list(ConfigurationListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of configurations that describe the functionality of the customer portal. */ - public static ConfigurationCollection list(ConfigurationListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/billing_portal/configurations"); - return ApiResource.requestCollection(url, params, ConfigurationCollection.class, options); - } - /** Creates a configuration that describes the functionality and behavior of a PortalSession. */ public static Configuration create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -164,42 +140,29 @@ public static Configuration create(ConfigurationCreateParams params, RequestOpti ApiResource.RequestMethod.POST, url, params, Configuration.class, options); } - /** Updates a configuration that describes the functionality of the customer portal. */ - @Override - public Configuration update(Map params) throws StripeException { - return update(params, (RequestOptions) null); + /** Returns a list of configurations that describe the functionality of the customer portal. */ + public static ConfigurationCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); } - /** Updates a configuration that describes the functionality of the customer portal. */ - @Override - public Configuration update(Map params, RequestOptions options) + /** Returns a list of configurations that describe the functionality of the customer portal. */ + public static ConfigurationCollection list(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/billing_portal/configurations/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Configuration.class, options); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/billing_portal/configurations"); + return ApiResource.requestCollection(url, params, ConfigurationCollection.class, options); } - /** Updates a configuration that describes the functionality of the customer portal. */ - public Configuration update(ConfigurationUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + /** Returns a list of configurations that describe the functionality of the customer portal. */ + public static ConfigurationCollection list(ConfigurationListParams params) + throws StripeException { + return list(params, (RequestOptions) null); } - /** Updates a configuration that describes the functionality of the customer portal. */ - public Configuration update(ConfigurationUpdateParams params, RequestOptions options) + /** Returns a list of configurations that describe the functionality of the customer portal. */ + public static ConfigurationCollection list(ConfigurationListParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/billing_portal/configurations/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Configuration.class, options); + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/billing_portal/configurations"); + return ApiResource.requestCollection(url, params, ConfigurationCollection.class, options); } /** Retrieves a configuration that describes the functionality of the customer portal. */ @@ -241,6 +204,44 @@ public static Configuration retrieve( ApiResource.RequestMethod.GET, url, params, Configuration.class, options); } + /** Updates a configuration that describes the functionality of the customer portal. */ + @Override + public Configuration update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates a configuration that describes the functionality of the customer portal. */ + @Override + public Configuration update(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/billing_portal/configurations/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, Configuration.class, options); + } + + /** Updates a configuration that describes the functionality of the customer portal. */ + public Configuration update(ConfigurationUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates a configuration that describes the functionality of the customer portal. */ + public Configuration update(ConfigurationUpdateParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/billing_portal/configurations/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, Configuration.class, options); + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/billingportal/Session.java b/src/main/java/com/stripe/model/billingportal/Session.java index 30b028b6dda..3675ed7e9cc 100644 --- a/src/main/java/com/stripe/model/billingportal/Session.java +++ b/src/main/java/com/stripe/model/billingportal/Session.java @@ -14,6 +14,22 @@ import lombok.Getter; import lombok.Setter; +/** + * The Billing customer portal is a Stripe-hosted UI for subscription and billing management. + * + *

A portal configuration describes the functionality and features that you want to provide to + * your customers through the portal. + * + *

A portal session describes the instantiation of the customer portal for a particular customer. + * By visiting the session's URL, the customer can manage their subscriptions and billing details. + * For security reasons, sessions are short-lived and will expire if the customer does not visit the + * URL. Create sessions on-demand when customers intend to manage their subscriptions and billing + * details. + * + *

Learn more in the integration + * guide. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index f88504299d9..8cd2af9b25d 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -30,6 +30,22 @@ import lombok.Getter; import lombok.Setter; +/** + * A Checkout Session represents your customer's session as they pay for one-time purchases or + * subscriptions through Checkout or Payment Links. We recommend creating a + * new Session each time your customer attempts to pay. + * + *

Once payment is successful, the Checkout Session will contain a reference to the Customer, and either the successful PaymentIntent or an active Subscription. + * + *

You can create a Checkout Session on your server and pass its ID to the client to begin + * Checkout. + * + *

Related guide: Checkout Quickstart. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -393,84 +409,124 @@ public void setSubscriptionObject(Subscription expandableObject) { new ExpandableField(expandableObject.getId(), expandableObject); } - /** Returns a list of Checkout Sessions. */ - public static SessionCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); + /** Creates a Session object. */ + public static Session create(Map params) throws StripeException { + return create(params, (RequestOptions) null); } - /** Returns a list of Checkout Sessions. */ - public static SessionCollection list(Map params, RequestOptions options) + /** Creates a Session object. */ + public static Session create(Map params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/checkout/sessions"); - return ApiResource.requestCollection(url, params, SessionCollection.class, options); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Session.class, options); } - /** Returns a list of Checkout Sessions. */ - public static SessionCollection list(SessionListParams params) throws StripeException { - return list(params, (RequestOptions) null); + /** Creates a Session object. */ + public static Session create(SessionCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); } - /** Returns a list of Checkout Sessions. */ - public static SessionCollection list(SessionListParams params, RequestOptions options) + /** Creates a Session object. */ + public static Session create(SessionCreateParams params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/checkout/sessions"); - return ApiResource.requestCollection(url, params, SessionCollection.class, options); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Session.class, options); } - /** Retrieves a Session object. */ - public static Session retrieve(String session) throws StripeException { - return retrieve(session, (Map) null, (RequestOptions) null); + /** + * A Session can be expired when it is in one of these statuses: open + * + *

After it expires, a customer can’t complete a Session and customers loading the Session see + * a message saying the Session is expired. + */ + public Session expire() throws StripeException { + return expire((Map) null, (RequestOptions) null); } - /** Retrieves a Session object. */ - public static Session retrieve(String session, RequestOptions options) throws StripeException { - return retrieve(session, (Map) null, options); + /** + * A Session can be expired when it is in one of these statuses: open + * + *

After it expires, a customer can’t complete a Session and customers loading the Session see + * a message saying the Session is expired. + */ + public Session expire(RequestOptions options) throws StripeException { + return expire((Map) null, options); } - /** Retrieves a Session object. */ - public static Session retrieve(String session, Map params, RequestOptions options) - throws StripeException { + /** + * A Session can be expired when it is in one of these statuses: open + * + *

After it expires, a customer can’t complete a Session and customers loading the Session see + * a message saying the Session is expired. + */ + public Session expire(Map params) throws StripeException { + return expire(params, (RequestOptions) null); + } + + /** + * A Session can be expired when it is in one of these statuses: open + * + *

After it expires, a customer can’t complete a Session and customers loading the Session see + * a message saying the Session is expired. + */ + public Session expire(Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/checkout/sessions/%s", ApiResource.urlEncodeId(session))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Session.class, options); + String.format( + "/v1/checkout/sessions/%s/expire", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Session.class, options); } - /** Retrieves a Session object. */ - public static Session retrieve( - String session, SessionRetrieveParams params, RequestOptions options) throws StripeException { + /** + * A Session can be expired when it is in one of these statuses: open + * + *

After it expires, a customer can’t complete a Session and customers loading the Session see + * a message saying the Session is expired. + */ + public Session expire(SessionExpireParams params) throws StripeException { + return expire(params, (RequestOptions) null); + } + + /** + * A Session can be expired when it is in one of these statuses: open + * + *

After it expires, a customer can’t complete a Session and customers loading the Session see + * a message saying the Session is expired. + */ + public Session expire(SessionExpireParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/checkout/sessions/%s", ApiResource.urlEncodeId(session))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Session.class, options); + String.format( + "/v1/checkout/sessions/%s/expire", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Session.class, options); } - /** Creates a Session object. */ - public static Session create(Map params) throws StripeException { - return create(params, (RequestOptions) null); + /** Returns a list of Checkout Sessions. */ + public static SessionCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); } - /** Creates a Session object. */ - public static Session create(Map params, RequestOptions options) + /** Returns a list of Checkout Sessions. */ + public static SessionCollection list(Map params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/checkout/sessions"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Session.class, options); + return ApiResource.requestCollection(url, params, SessionCollection.class, options); } - /** Creates a Session object. */ - public static Session create(SessionCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); + /** Returns a list of Checkout Sessions. */ + public static SessionCollection list(SessionListParams params) throws StripeException { + return list(params, (RequestOptions) null); } - /** Creates a Session object. */ - public static Session create(SessionCreateParams params, RequestOptions options) + /** Returns a list of Checkout Sessions. */ + public static SessionCollection list(SessionListParams params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/checkout/sessions"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Session.class, options); + return ApiResource.requestCollection(url, params, SessionCollection.class, options); } /** @@ -533,76 +589,36 @@ public LineItemCollection listLineItems(SessionListLineItemsParams params, Reque return ApiResource.requestCollection(url, params, LineItemCollection.class, options); } - /** - * A Session can be expired when it is in one of these statuses: open - * - *

After it expires, a customer can’t complete a Session and customers loading the Session see - * a message saying the Session is expired. - */ - public Session expire() throws StripeException { - return expire((Map) null, (RequestOptions) null); - } - - /** - * A Session can be expired when it is in one of these statuses: open - * - *

After it expires, a customer can’t complete a Session and customers loading the Session see - * a message saying the Session is expired. - */ - public Session expire(RequestOptions options) throws StripeException { - return expire((Map) null, options); + /** Retrieves a Session object. */ + public static Session retrieve(String session) throws StripeException { + return retrieve(session, (Map) null, (RequestOptions) null); } - /** - * A Session can be expired when it is in one of these statuses: open - * - *

After it expires, a customer can’t complete a Session and customers loading the Session see - * a message saying the Session is expired. - */ - public Session expire(Map params) throws StripeException { - return expire(params, (RequestOptions) null); + /** Retrieves a Session object. */ + public static Session retrieve(String session, RequestOptions options) throws StripeException { + return retrieve(session, (Map) null, options); } - /** - * A Session can be expired when it is in one of these statuses: open - * - *

After it expires, a customer can’t complete a Session and customers loading the Session see - * a message saying the Session is expired. - */ - public Session expire(Map params, RequestOptions options) throws StripeException { + /** Retrieves a Session object. */ + public static Session retrieve(String session, Map params, RequestOptions options) + throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format( - "/v1/checkout/sessions/%s/expire", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Session.class, options); - } - - /** - * A Session can be expired when it is in one of these statuses: open - * - *

After it expires, a customer can’t complete a Session and customers loading the Session see - * a message saying the Session is expired. - */ - public Session expire(SessionExpireParams params) throws StripeException { - return expire(params, (RequestOptions) null); + String.format("/v1/checkout/sessions/%s", ApiResource.urlEncodeId(session))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Session.class, options); } - /** - * A Session can be expired when it is in one of these statuses: open - * - *

After it expires, a customer can’t complete a Session and customers loading the Session see - * a message saying the Session is expired. - */ - public Session expire(SessionExpireParams params, RequestOptions options) throws StripeException { + /** Retrieves a Session object. */ + public static Session retrieve( + String session, SessionRetrieveParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format( - "/v1/checkout/sessions/%s/expire", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Session.class, options); + String.format("/v1/checkout/sessions/%s", ApiResource.urlEncodeId(session))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Session.class, options); } @Getter diff --git a/src/main/java/com/stripe/model/financialconnections/Account.java b/src/main/java/com/stripe/model/financialconnections/Account.java index a1f1c811576..461bb4f759c 100644 --- a/src/main/java/com/stripe/model/financialconnections/Account.java +++ b/src/main/java/com/stripe/model/financialconnections/Account.java @@ -21,6 +21,10 @@ import lombok.Getter; import lombok.Setter; +/** + * A Financial Connections Account represents an account that exists outside of Stripe, to which you + * have been granted some degree of access. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -147,76 +151,107 @@ public void setOwnershipObject(AccountOwnership expandableObject) { new ExpandableField(expandableObject.getId(), expandableObject); } - /** Returns a list of Financial Connections Account objects. */ - public static AccountCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of Financial Connections Account objects. */ - public static AccountCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/financial_connections/accounts"); - return ApiResource.requestCollection(url, params, AccountCollection.class, options); - } - - /** Returns a list of Financial Connections Account objects. */ - public static AccountCollection list(AccountListParams params) throws StripeException { - return list(params, (RequestOptions) null); + /** + * Disables your access to a Financial Connections Account. You will no longer be + * able to access data associated with the account (e.g. balances, transactions). + */ + public com.stripe.model.financialconnections.Account disconnect() throws StripeException { + return disconnect((Map) null, (RequestOptions) null); } - /** Returns a list of Financial Connections Account objects. */ - public static AccountCollection list(AccountListParams params, RequestOptions options) + /** + * Disables your access to a Financial Connections Account. You will no longer be + * able to access data associated with the account (e.g. balances, transactions). + */ + public com.stripe.model.financialconnections.Account disconnect(RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/financial_connections/accounts"); - return ApiResource.requestCollection(url, params, AccountCollection.class, options); + return disconnect((Map) null, options); } - /** Retrieves the details of an Financial Connections Account. */ - public static com.stripe.model.financialconnections.Account retrieve(String account) + /** + * Disables your access to a Financial Connections Account. You will no longer be + * able to access data associated with the account (e.g. balances, transactions). + */ + public com.stripe.model.financialconnections.Account disconnect(Map params) throws StripeException { - return retrieve(account, (Map) null, (RequestOptions) null); - } - - /** Retrieves the details of an Financial Connections Account. */ - public static com.stripe.model.financialconnections.Account retrieve( - String account, RequestOptions options) throws StripeException { - return retrieve(account, (Map) null, options); + return disconnect(params, (RequestOptions) null); } - /** Retrieves the details of an Financial Connections Account. */ - public static com.stripe.model.financialconnections.Account retrieve( - String account, Map params, RequestOptions options) throws StripeException { + /** + * Disables your access to a Financial Connections Account. You will no longer be + * able to access data associated with the account (e.g. balances, transactions). + */ + public com.stripe.model.financialconnections.Account disconnect( + Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), String.format( - "/v1/financial_connections/accounts/%s", ApiResource.urlEncodeId(account))); + "/v1/financial_connections/accounts/%s/disconnect", + ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.GET, + ApiResource.RequestMethod.POST, url, params, com.stripe.model.financialconnections.Account.class, options); } - /** Retrieves the details of an Financial Connections Account. */ - public static com.stripe.model.financialconnections.Account retrieve( - String account, AccountRetrieveParams params, RequestOptions options) throws StripeException { + /** + * Disables your access to a Financial Connections Account. You will no longer be + * able to access data associated with the account (e.g. balances, transactions). + */ + public com.stripe.model.financialconnections.Account disconnect(AccountDisconnectParams params) + throws StripeException { + return disconnect(params, (RequestOptions) null); + } + + /** + * Disables your access to a Financial Connections Account. You will no longer be + * able to access data associated with the account (e.g. balances, transactions). + */ + public com.stripe.model.financialconnections.Account disconnect( + AccountDisconnectParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), String.format( - "/v1/financial_connections/accounts/%s", ApiResource.urlEncodeId(account))); + "/v1/financial_connections/accounts/%s/disconnect", + ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.GET, + ApiResource.RequestMethod.POST, url, params, com.stripe.model.financialconnections.Account.class, options); } + /** Returns a list of Financial Connections Account objects. */ + public static AccountCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of Financial Connections Account objects. */ + public static AccountCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/financial_connections/accounts"); + return ApiResource.requestCollection(url, params, AccountCollection.class, options); + } + + /** Returns a list of Financial Connections Account objects. */ + public static AccountCollection list(AccountListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of Financial Connections Account objects. */ + public static AccountCollection list(AccountListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/financial_connections/accounts"); + return ApiResource.requestCollection(url, params, AccountCollection.class, options); + } + /** Lists all owners for a given Account. */ public AccountOwnerCollection listOwners(Map params) throws StripeException { return listOwners(params, (RequestOptions) null); @@ -301,77 +336,46 @@ public com.stripe.model.financialconnections.Account refresh( options); } - /** - * Disables your access to a Financial Connections Account. You will no longer be - * able to access data associated with the account (e.g. balances, transactions). - */ - public com.stripe.model.financialconnections.Account disconnect() throws StripeException { - return disconnect((Map) null, (RequestOptions) null); - } - - /** - * Disables your access to a Financial Connections Account. You will no longer be - * able to access data associated with the account (e.g. balances, transactions). - */ - public com.stripe.model.financialconnections.Account disconnect(RequestOptions options) + /** Retrieves the details of an Financial Connections Account. */ + public static com.stripe.model.financialconnections.Account retrieve(String account) throws StripeException { - return disconnect((Map) null, options); + return retrieve(account, (Map) null, (RequestOptions) null); } - /** - * Disables your access to a Financial Connections Account. You will no longer be - * able to access data associated with the account (e.g. balances, transactions). - */ - public com.stripe.model.financialconnections.Account disconnect(Map params) - throws StripeException { - return disconnect(params, (RequestOptions) null); + /** Retrieves the details of an Financial Connections Account. */ + public static com.stripe.model.financialconnections.Account retrieve( + String account, RequestOptions options) throws StripeException { + return retrieve(account, (Map) null, options); } - /** - * Disables your access to a Financial Connections Account. You will no longer be - * able to access data associated with the account (e.g. balances, transactions). - */ - public com.stripe.model.financialconnections.Account disconnect( - Map params, RequestOptions options) throws StripeException { + /** Retrieves the details of an Financial Connections Account. */ + public static com.stripe.model.financialconnections.Account retrieve( + String account, Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), String.format( - "/v1/financial_connections/accounts/%s/disconnect", - ApiResource.urlEncodeId(this.getId()))); + "/v1/financial_connections/accounts/%s", ApiResource.urlEncodeId(account))); return ApiResource.request( - ApiResource.RequestMethod.POST, + ApiResource.RequestMethod.GET, url, params, com.stripe.model.financialconnections.Account.class, options); } - /** - * Disables your access to a Financial Connections Account. You will no longer be - * able to access data associated with the account (e.g. balances, transactions). - */ - public com.stripe.model.financialconnections.Account disconnect(AccountDisconnectParams params) - throws StripeException { - return disconnect(params, (RequestOptions) null); - } - - /** - * Disables your access to a Financial Connections Account. You will no longer be - * able to access data associated with the account (e.g. balances, transactions). - */ - public com.stripe.model.financialconnections.Account disconnect( - AccountDisconnectParams params, RequestOptions options) throws StripeException { + /** Retrieves the details of an Financial Connections Account. */ + public static com.stripe.model.financialconnections.Account retrieve( + String account, AccountRetrieveParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), String.format( - "/v1/financial_connections/accounts/%s/disconnect", - ApiResource.urlEncodeId(this.getId()))); + "/v1/financial_connections/accounts/%s", ApiResource.urlEncodeId(account))); return ApiResource.request( - ApiResource.RequestMethod.POST, + ApiResource.RequestMethod.GET, url, params, com.stripe.model.financialconnections.Account.class, diff --git a/src/main/java/com/stripe/model/financialconnections/AccountOwnership.java b/src/main/java/com/stripe/model/financialconnections/AccountOwnership.java index 6f67a39d9f0..fc50dc5efb7 100644 --- a/src/main/java/com/stripe/model/financialconnections/AccountOwnership.java +++ b/src/main/java/com/stripe/model/financialconnections/AccountOwnership.java @@ -8,6 +8,7 @@ import lombok.Getter; import lombok.Setter; +/** Describes a snapshot of the owners of an account at a particular point in time. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/financialconnections/Session.java b/src/main/java/com/stripe/model/financialconnections/Session.java index 9998c494b50..98074d9ea51 100644 --- a/src/main/java/com/stripe/model/financialconnections/Session.java +++ b/src/main/java/com/stripe/model/financialconnections/Session.java @@ -19,6 +19,10 @@ import lombok.Getter; import lombok.Setter; +/** + * A Financial Connections Session is the secure way to programmatically launch the client-side + * Stripe.js modal that lets your users link their accounts. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/identity/VerificationReport.java b/src/main/java/com/stripe/model/identity/VerificationReport.java index e168132f4bb..45fdb83e9e3 100644 --- a/src/main/java/com/stripe/model/identity/VerificationReport.java +++ b/src/main/java/com/stripe/model/identity/VerificationReport.java @@ -17,6 +17,22 @@ import lombok.Getter; import lombok.Setter; +/** + * A VerificationReport is the result of an attempt to collect and verify data from a user. The + * collection of verification checks performed is determined from the {@code type} and {@code + * options} parameters used. You can find the result of each verification check performed in the + * appropriate sub-resource: {@code document}, {@code id_number}, {@code selfie}. + * + *

Each VerificationReport contains a copy of any data collected by the user as well as reference + * IDs which can be used to access collected images through the FileUpload API. To configure and create + * VerificationReports, use the VerificationSession API. + * + *

Related guides: Accessing verification + * results. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -72,6 +88,32 @@ public class VerificationReport extends ApiResource implements HasId { @SerializedName("verification_session") String verificationSession; + /** List all verification reports. */ + public static VerificationReportCollection list(Map params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** List all verification reports. */ + public static VerificationReportCollection list( + Map params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/identity/verification_reports"); + return ApiResource.requestCollection(url, params, VerificationReportCollection.class, options); + } + + /** List all verification reports. */ + public static VerificationReportCollection list(VerificationReportListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** List all verification reports. */ + public static VerificationReportCollection list( + VerificationReportListParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/identity/verification_reports"); + return ApiResource.requestCollection(url, params, VerificationReportCollection.class, options); + } + /** Retrieves an existing VerificationReport. */ public static VerificationReport retrieve(String report) throws StripeException { return retrieve(report, (Map) null, (RequestOptions) null); @@ -108,32 +150,7 @@ public static VerificationReport retrieve( ApiResource.RequestMethod.GET, url, params, VerificationReport.class, options); } - /** List all verification reports. */ - public static VerificationReportCollection list(Map params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** List all verification reports. */ - public static VerificationReportCollection list( - Map params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/identity/verification_reports"); - return ApiResource.requestCollection(url, params, VerificationReportCollection.class, options); - } - - /** List all verification reports. */ - public static VerificationReportCollection list(VerificationReportListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** List all verification reports. */ - public static VerificationReportCollection list( - VerificationReportListParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/identity/verification_reports"); - return ApiResource.requestCollection(url, params, VerificationReportCollection.class, options); - } - + /** Result from a document check. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -197,6 +214,7 @@ public static class Document extends StripeObject { @SerializedName("type") String type; + /** Point in Time. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -235,6 +253,7 @@ public static class DocumentCheckError extends StripeObject { String reason; } + /** Point in Time. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -252,6 +271,7 @@ public static class ExpirationDate extends StripeObject { Long year; } + /** Point in Time. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -270,6 +290,7 @@ public static class IssuedDate extends StripeObject { } } + /** Result from an id_number check. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -310,6 +331,7 @@ public static class IdNumber extends StripeObject { @SerializedName("status") String status; + /** Point in Time. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -402,6 +424,7 @@ public static class Document extends StripeObject { public static class IdNumber extends StripeObject {} } + /** Result from a selfie check. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/identity/VerificationSession.java b/src/main/java/com/stripe/model/identity/VerificationSession.java index 02f46dd7d44..110ba36a53c 100644 --- a/src/main/java/com/stripe/model/identity/VerificationSession.java +++ b/src/main/java/com/stripe/model/identity/VerificationSession.java @@ -23,6 +23,20 @@ import lombok.Getter; import lombok.Setter; +/** + * A VerificationSession guides you through the process of collecting and verifying the identities + * of your users. It contains details about the type of verification, such as what verification check to perform. + * Only create one VerificationSession for each verification in your system. + * + *

A VerificationSession transitions through multiple statuses throughout its + * lifetime as it progresses through the verification flow. The VerificationSession contains the + * user's verified data after verification checks are complete. + * + *

Related guide: The + * Verification Sessions API + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -152,6 +166,90 @@ public void setLastVerificationReportObject(VerificationReport expandableObject) new ExpandableField(expandableObject.getId(), expandableObject); } + /** + * A VerificationSession object can be canceled when it is in requires_input status. + * + *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. + */ + public VerificationSession cancel() throws StripeException { + return cancel((Map) null, (RequestOptions) null); + } + + /** + * A VerificationSession object can be canceled when it is in requires_input status. + * + *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. + */ + public VerificationSession cancel(RequestOptions options) throws StripeException { + return cancel((Map) null, options); + } + + /** + * A VerificationSession object can be canceled when it is in requires_input status. + * + *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. + */ + public VerificationSession cancel(Map params) throws StripeException { + return cancel(params, (RequestOptions) null); + } + + /** + * A VerificationSession object can be canceled when it is in requires_input status. + * + *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. + */ + public VerificationSession cancel(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/identity/verification_sessions/%s/cancel", + ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, VerificationSession.class, options); + } + + /** + * A VerificationSession object can be canceled when it is in requires_input status. + * + *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. + */ + public VerificationSession cancel(VerificationSessionCancelParams params) throws StripeException { + return cancel(params, (RequestOptions) null); + } + + /** + * A VerificationSession object can be canceled when it is in requires_input status. + * + *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. + */ + public VerificationSession cancel(VerificationSessionCancelParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/identity/verification_sessions/%s/cancel", + ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, VerificationSession.class, options); + } + /** * Creates a VerificationSession object. * @@ -223,64 +321,6 @@ public static VerificationSession create( ApiResource.RequestMethod.POST, url, params, VerificationSession.class, options); } - /** - * Retrieves the details of a VerificationSession that was previously created. - * - *

When the session status is requires_input, you can use this method to retrieve - * a valid client_secret or url to allow re-submission. - */ - public static VerificationSession retrieve(String session) throws StripeException { - return retrieve(session, (Map) null, (RequestOptions) null); - } - - /** - * Retrieves the details of a VerificationSession that was previously created. - * - *

When the session status is requires_input, you can use this method to retrieve - * a valid client_secret or url to allow re-submission. - */ - public static VerificationSession retrieve(String session, RequestOptions options) - throws StripeException { - return retrieve(session, (Map) null, options); - } - - /** - * Retrieves the details of a VerificationSession that was previously created. - * - *

When the session status is requires_input, you can use this method to retrieve - * a valid client_secret or url to allow re-submission. - */ - public static VerificationSession retrieve( - String session, Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/identity/verification_sessions/%s", ApiResource.urlEncodeId(session))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, VerificationSession.class, options); - } - - /** - * Retrieves the details of a VerificationSession that was previously created. - * - *

When the session status is requires_input, you can use this method to retrieve - * a valid client_secret or url to allow re-submission. - */ - public static VerificationSession retrieve( - String session, VerificationSessionRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/identity/verification_sessions/%s", ApiResource.urlEncodeId(session))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, VerificationSession.class, options); - } - /** Returns a list of VerificationSessions. */ public static VerificationSessionCollection list(Map params) throws StripeException { @@ -307,90 +347,6 @@ public static VerificationSessionCollection list( return ApiResource.requestCollection(url, params, VerificationSessionCollection.class, options); } - /** - * A VerificationSession object can be canceled when it is in requires_input status. - * - *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. - */ - public VerificationSession cancel() throws StripeException { - return cancel((Map) null, (RequestOptions) null); - } - - /** - * A VerificationSession object can be canceled when it is in requires_input status. - * - *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. - */ - public VerificationSession cancel(RequestOptions options) throws StripeException { - return cancel((Map) null, options); - } - - /** - * A VerificationSession object can be canceled when it is in requires_input status. - * - *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. - */ - public VerificationSession cancel(Map params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** - * A VerificationSession object can be canceled when it is in requires_input status. - * - *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. - */ - public VerificationSession cancel(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/identity/verification_sessions/%s/cancel", - ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, VerificationSession.class, options); - } - - /** - * A VerificationSession object can be canceled when it is in requires_input status. - * - *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. - */ - public VerificationSession cancel(VerificationSessionCancelParams params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** - * A VerificationSession object can be canceled when it is in requires_input status. - * - *

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more. - */ - public VerificationSession cancel(VerificationSessionCancelParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/identity/verification_sessions/%s/cancel", - ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, VerificationSession.class, options); - } - /** * Redact a VerificationSession to remove all collected information from Stripe. This will redact * the VerificationSession and all objects related to it, including VerificationReports, Events, @@ -565,6 +521,64 @@ public VerificationSession redact(VerificationSessionRedactParams params, Reques ApiResource.RequestMethod.POST, url, params, VerificationSession.class, options); } + /** + * Retrieves the details of a VerificationSession that was previously created. + * + *

When the session status is requires_input, you can use this method to retrieve + * a valid client_secret or url to allow re-submission. + */ + public static VerificationSession retrieve(String session) throws StripeException { + return retrieve(session, (Map) null, (RequestOptions) null); + } + + /** + * Retrieves the details of a VerificationSession that was previously created. + * + *

When the session status is requires_input, you can use this method to retrieve + * a valid client_secret or url to allow re-submission. + */ + public static VerificationSession retrieve(String session, RequestOptions options) + throws StripeException { + return retrieve(session, (Map) null, options); + } + + /** + * Retrieves the details of a VerificationSession that was previously created. + * + *

When the session status is requires_input, you can use this method to retrieve + * a valid client_secret or url to allow re-submission. + */ + public static VerificationSession retrieve( + String session, Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/identity/verification_sessions/%s", ApiResource.urlEncodeId(session))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, VerificationSession.class, options); + } + + /** + * Retrieves the details of a VerificationSession that was previously created. + * + *

When the session status is requires_input, you can use this method to retrieve + * a valid client_secret or url to allow re-submission. + */ + public static VerificationSession retrieve( + String session, VerificationSessionRetrieveParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/identity/verification_sessions/%s", ApiResource.urlEncodeId(session))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, VerificationSession.class, options); + } + /** * Updates a VerificationSession object. * @@ -623,6 +637,7 @@ public VerificationSession update(VerificationSessionUpdateParams params, Reques ApiResource.RequestMethod.POST, url, params, VerificationSession.class, options); } + /** Shows last VerificationSession error. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -744,6 +759,7 @@ public static class VerifiedOutputs extends StripeObject { @SerializedName("last_name") String lastName; + /** Point in Time. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/issuing/Authorization.java b/src/main/java/com/stripe/model/issuing/Authorization.java index 12a54ac1ccb..cd11bfc661f 100644 --- a/src/main/java/com/stripe/model/issuing/Authorization.java +++ b/src/main/java/com/stripe/model/issuing/Authorization.java @@ -22,6 +22,15 @@ import lombok.Getter; import lombok.Setter; +/** + * When an issued card is used to make a purchase, an + * Issuing {@code Authorization} object is created. Authorizations must be + * approved for the purchase to be completed successfully. + * + *

Related guide: Issued Card + * Authorizations. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -198,128 +207,6 @@ public void setCardholderObject(Cardholder expandableObject) { this.cardholder = new ExpandableField(expandableObject.getId(), expandableObject); } - /** - * Returns a list of Issuing Authorization objects. The objects are sorted in - * descending order by creation date, with the most recently created object appearing first. - */ - public static AuthorizationCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** - * Returns a list of Issuing Authorization objects. The objects are sorted in - * descending order by creation date, with the most recently created object appearing first. - */ - public static AuthorizationCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/authorizations"); - return ApiResource.requestCollection(url, params, AuthorizationCollection.class, options); - } - - /** - * Returns a list of Issuing Authorization objects. The objects are sorted in - * descending order by creation date, with the most recently created object appearing first. - */ - public static AuthorizationCollection list(AuthorizationListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** - * Returns a list of Issuing Authorization objects. The objects are sorted in - * descending order by creation date, with the most recently created object appearing first. - */ - public static AuthorizationCollection list(AuthorizationListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/authorizations"); - return ApiResource.requestCollection(url, params, AuthorizationCollection.class, options); - } - - /** Retrieves an Issuing Authorization object. */ - public static Authorization retrieve(String authorization) throws StripeException { - return retrieve(authorization, (Map) null, (RequestOptions) null); - } - - /** Retrieves an Issuing Authorization object. */ - public static Authorization retrieve(String authorization, RequestOptions options) - throws StripeException { - return retrieve(authorization, (Map) null, options); - } - - /** Retrieves an Issuing Authorization object. */ - public static Authorization retrieve( - String authorization, Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(authorization))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, Authorization.class, options); - } - - /** Retrieves an Issuing Authorization object. */ - public static Authorization retrieve( - String authorization, AuthorizationRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(authorization))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, Authorization.class, options); - } - - /** - * Updates the specified Issuing Authorization object by setting the values of the - * parameters passed. Any parameters not provided will be left unchanged. - */ - @Override - public Authorization update(Map params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** - * Updates the specified Issuing Authorization object by setting the values of the - * parameters passed. Any parameters not provided will be left unchanged. - */ - @Override - public Authorization update(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Authorization.class, options); - } - - /** - * Updates the specified Issuing Authorization object by setting the values of the - * parameters passed. Any parameters not provided will be left unchanged. - */ - public Authorization update(AuthorizationUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** - * Updates the specified Issuing Authorization object by setting the values of the - * parameters passed. Any parameters not provided will be left unchanged. - */ - public Authorization update(AuthorizationUpdateParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Authorization.class, options); - } - /** * Approves a pending Issuing Authorization object. This request should be made * within the timeout window of the Authorization objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public static AuthorizationCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of Issuing Authorization objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public static AuthorizationCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/authorizations"); + return ApiResource.requestCollection(url, params, AuthorizationCollection.class, options); + } + + /** + * Returns a list of Issuing Authorization objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public static AuthorizationCollection list(AuthorizationListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of Issuing Authorization objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public static AuthorizationCollection list(AuthorizationListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/authorizations"); + return ApiResource.requestCollection(url, params, AuthorizationCollection.class, options); + } + + /** Retrieves an Issuing Authorization object. */ + public static Authorization retrieve(String authorization) throws StripeException { + return retrieve(authorization, (Map) null, (RequestOptions) null); + } + + /** Retrieves an Issuing Authorization object. */ + public static Authorization retrieve(String authorization, RequestOptions options) + throws StripeException { + return retrieve(authorization, (Map) null, options); + } + + /** Retrieves an Issuing Authorization object. */ + public static Authorization retrieve( + String authorization, Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(authorization))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, Authorization.class, options); + } + + /** Retrieves an Issuing Authorization object. */ + public static Authorization retrieve( + String authorization, AuthorizationRetrieveParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(authorization))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, Authorization.class, options); + } + + /** + * Updates the specified Issuing Authorization object by setting the values of the + * parameters passed. Any parameters not provided will be left unchanged. + */ + @Override + public Authorization update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates the specified Issuing Authorization object by setting the values of the + * parameters passed. Any parameters not provided will be left unchanged. + */ + @Override + public Authorization update(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, Authorization.class, options); + } + + /** + * Updates the specified Issuing Authorization object by setting the values of the + * parameters passed. Any parameters not provided will be left unchanged. + */ + public Authorization update(AuthorizationUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates the specified Issuing Authorization object by setting the values of the + * parameters passed. Any parameters not provided will be left unchanged. + */ + public Authorization update(AuthorizationUpdateParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, Authorization.class, options); + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/issuing/Card.java b/src/main/java/com/stripe/model/issuing/Card.java index c7a76185fbf..935b15f7579 100644 --- a/src/main/java/com/stripe/model/issuing/Card.java +++ b/src/main/java/com/stripe/model/issuing/Card.java @@ -25,6 +25,10 @@ import lombok.Getter; import lombok.Setter; +/** + * You can create physical or virtual cards that + * are issued to cardholders. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -213,6 +217,30 @@ public void setReplacementForObject(Card expandableObject) { this.replacementFor = new ExpandableField(expandableObject.getId(), expandableObject); } + /** Creates an Issuing Card object. */ + public static Card create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates an Issuing Card object. */ + public static Card create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/cards"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Card.class, options); + } + + /** Creates an Issuing Card object. */ + public static Card create(CardCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates an Issuing Card object. */ + public static Card create(CardCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/cards"); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Card.class, options); + } + /** * Returns a list of Issuing Card objects. The objects are sorted in descending order * by creation date, with the most recently created object appearing first. @@ -249,30 +277,6 @@ public static CardCollection list(CardListParams params, RequestOptions options) return ApiResource.requestCollection(url, params, CardCollection.class, options); } - /** Creates an Issuing Card object. */ - public static Card create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates an Issuing Card object. */ - public static Card create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/cards"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Card.class, options); - } - - /** Creates an Issuing Card object. */ - public static Card create(CardCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates an Issuing Card object. */ - public static Card create(CardCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/cards"); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Card.class, options); - } - /** Retrieves an Issuing Card object. */ public static Card retrieve(String card) throws StripeException { return retrieve(card, (Map) null, (RequestOptions) null); diff --git a/src/main/java/com/stripe/model/issuing/Cardholder.java b/src/main/java/com/stripe/model/issuing/Cardholder.java index e85eec9163b..2cab791bbc1 100644 --- a/src/main/java/com/stripe/model/issuing/Cardholder.java +++ b/src/main/java/com/stripe/model/issuing/Cardholder.java @@ -22,6 +22,13 @@ import lombok.Getter; import lombok.Setter; +/** + * An Issuing {@code Cardholder} object represents an individual or business entity who is issued cards. + * + *

Related guide: How to create + * a Cardholder + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -109,6 +116,32 @@ public class Cardholder extends ApiResource implements HasId, MetadataStoreCardholder object that can be issued cards. */ + public static Cardholder create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new Issuing Cardholder object that can be issued cards. */ + public static Cardholder create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/cardholders"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, Cardholder.class, options); + } + + /** Creates a new Issuing Cardholder object that can be issued cards. */ + public static Cardholder create(CardholderCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new Issuing Cardholder object that can be issued cards. */ + public static Cardholder create(CardholderCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/cardholders"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, Cardholder.class, options); + } + /** * Returns a list of Issuing Cardholder objects. The objects are sorted in descending * order by creation date, with the most recently created object appearing first. @@ -145,32 +178,6 @@ public static CardholderCollection list(CardholderListParams params, RequestOpti return ApiResource.requestCollection(url, params, CardholderCollection.class, options); } - /** Creates a new Issuing Cardholder object that can be issued cards. */ - public static Cardholder create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new Issuing Cardholder object that can be issued cards. */ - public static Cardholder create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/cardholders"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Cardholder.class, options); - } - - /** Creates a new Issuing Cardholder object that can be issued cards. */ - public static Cardholder create(CardholderCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new Issuing Cardholder object that can be issued cards. */ - public static Cardholder create(CardholderCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/cardholders"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Cardholder.class, options); - } - /** Retrieves an Issuing Cardholder object. */ public static Cardholder retrieve(String cardholder) throws StripeException { return retrieve(cardholder, (Map) null, (RequestOptions) null); diff --git a/src/main/java/com/stripe/model/issuing/Dispute.java b/src/main/java/com/stripe/model/issuing/Dispute.java index c71716bb0bb..a019b3e01b9 100644 --- a/src/main/java/com/stripe/model/issuing/Dispute.java +++ b/src/main/java/com/stripe/model/issuing/Dispute.java @@ -23,6 +23,13 @@ import lombok.Getter; import lombok.Setter; +/** + * As a card issuer, you can dispute transactions that + * the cardholder does not recognize, suspects to be fraudulent, or has other issues with. + * + *

Related guide: Disputing + * Transactions + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -120,42 +127,6 @@ public void setTransactionObject(Transaction expandableObject) { this.transaction = new ExpandableField(expandableObject.getId(), expandableObject); } - /** - * Returns a list of Issuing Dispute objects. The objects are sorted in descending - * order by creation date, with the most recently created object appearing first. - */ - public static DisputeCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** - * Returns a list of Issuing Dispute objects. The objects are sorted in descending - * order by creation date, with the most recently created object appearing first. - */ - public static DisputeCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/disputes"); - return ApiResource.requestCollection(url, params, DisputeCollection.class, options); - } - - /** - * Returns a list of Issuing Dispute objects. The objects are sorted in descending - * order by creation date, with the most recently created object appearing first. - */ - public static DisputeCollection list(DisputeListParams params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** - * Returns a list of Issuing Dispute objects. The objects are sorted in descending - * order by creation date, with the most recently created object appearing first. - */ - public static DisputeCollection list(DisputeListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/disputes"); - return ApiResource.requestCollection(url, params, DisputeCollection.class, options); - } - /** * Creates an Issuing Dispute object. Individual pieces of evidence within the * evidence object are optional at this point. Stripe only validates that required evidence @@ -205,51 +176,39 @@ public static Dispute create(DisputeCreateParams params, RequestOptions options) } /** - * Updates the specified Issuing Dispute object by setting the values of the - * parameters passed. Any parameters not provided will be left unchanged. Properties on the - * evidence object can be unset by passing in an empty string. + * Returns a list of Issuing Dispute objects. The objects are sorted in descending + * order by creation date, with the most recently created object appearing first. */ - @Override - public Dispute update(Map params) throws StripeException { - return update(params, (RequestOptions) null); + public static DisputeCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); } /** - * Updates the specified Issuing Dispute object by setting the values of the - * parameters passed. Any parameters not provided will be left unchanged. Properties on the - * evidence object can be unset by passing in an empty string. + * Returns a list of Issuing Dispute objects. The objects are sorted in descending + * order by creation date, with the most recently created object appearing first. */ - @Override - public Dispute update(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/issuing/disputes/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options); + public static DisputeCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/disputes"); + return ApiResource.requestCollection(url, params, DisputeCollection.class, options); } /** - * Updates the specified Issuing Dispute object by setting the values of the - * parameters passed. Any parameters not provided will be left unchanged. Properties on the - * evidence object can be unset by passing in an empty string. + * Returns a list of Issuing Dispute objects. The objects are sorted in descending + * order by creation date, with the most recently created object appearing first. */ - public Dispute update(DisputeUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + public static DisputeCollection list(DisputeListParams params) throws StripeException { + return list(params, (RequestOptions) null); } /** - * Updates the specified Issuing Dispute object by setting the values of the - * parameters passed. Any parameters not provided will be left unchanged. Properties on the - * evidence object can be unset by passing in an empty string. + * Returns a list of Issuing Dispute objects. The objects are sorted in descending + * order by creation date, with the most recently created object appearing first. */ - public Dispute update(DisputeUpdateParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/issuing/disputes/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options); + public static DisputeCollection list(DisputeListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/issuing/disputes"); + return ApiResource.requestCollection(url, params, DisputeCollection.class, options); } /** Retrieves an Issuing Dispute object. */ @@ -354,6 +313,54 @@ public Dispute submit(DisputeSubmitParams params, RequestOptions options) throws return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options); } + /** + * Updates the specified Issuing Dispute object by setting the values of the + * parameters passed. Any parameters not provided will be left unchanged. Properties on the + * evidence object can be unset by passing in an empty string. + */ + @Override + public Dispute update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates the specified Issuing Dispute object by setting the values of the + * parameters passed. Any parameters not provided will be left unchanged. Properties on the + * evidence object can be unset by passing in an empty string. + */ + @Override + public Dispute update(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/issuing/disputes/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options); + } + + /** + * Updates the specified Issuing Dispute object by setting the values of the + * parameters passed. Any parameters not provided will be left unchanged. Properties on the + * evidence object can be unset by passing in an empty string. + */ + public Dispute update(DisputeUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates the specified Issuing Dispute object by setting the values of the + * parameters passed. Any parameters not provided will be left unchanged. Properties on the + * evidence object can be unset by passing in an empty string. + */ + public Dispute update(DisputeUpdateParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/issuing/disputes/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options); + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -434,10 +441,6 @@ public static class Canceled extends StripeObject { @SerializedName("product_type") String productType; - /** Date when the product was returned or attempted to be returned. */ - @SerializedName("returned_at") - Long returnedAt; - /** * Result of cardholder's attempt to return the product. * @@ -446,6 +449,10 @@ public static class Canceled extends StripeObject { @SerializedName("return_status") String returnStatus; + /** Date when the product was returned or attempted to be returned. */ + @SerializedName("returned_at") + Long returnedAt; + /** Get ID of expandable {@code additionalDocumentation} object. */ public String getAdditionalDocumentation() { return (this.additionalDocumentation != null) ? this.additionalDocumentation.getId() : null; @@ -662,10 +669,6 @@ public static class MerchandiseNotAsDescribed extends StripeObject { @SerializedName("return_description") String returnDescription; - /** Date when the product was returned or attempted to be returned. */ - @SerializedName("returned_at") - Long returnedAt; - /** * Result of cardholder's attempt to return the product. * @@ -674,6 +677,10 @@ public static class MerchandiseNotAsDescribed extends StripeObject { @SerializedName("return_status") String returnStatus; + /** Date when the product was returned or attempted to be returned. */ + @SerializedName("returned_at") + Long returnedAt; + /** Get ID of expandable {@code additionalDocumentation} object. */ public String getAdditionalDocumentation() { return (this.additionalDocumentation != null) ? this.additionalDocumentation.getId() : null; diff --git a/src/main/java/com/stripe/model/issuing/Transaction.java b/src/main/java/com/stripe/model/issuing/Transaction.java index 52c093dd61e..dc01c80b366 100644 --- a/src/main/java/com/stripe/model/issuing/Transaction.java +++ b/src/main/java/com/stripe/model/issuing/Transaction.java @@ -21,6 +21,14 @@ import lombok.Getter; import lombok.Setter; +/** + * Any use of an issued card that results in funds + * entering or leaving your Stripe account, such as a completed purchase or refund, is represented + * by an Issuing {@code Transaction} object. + * + *

Related guide: Issued Card + * Transactions. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java b/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java index 25b065670d6..5eefbfffcbe 100644 --- a/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java +++ b/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java @@ -17,6 +17,13 @@ import lombok.Getter; import lombok.Setter; +/** + * An early fraud warning indicates that the card issuer has notified us that a charge may be + * fraudulent. + * + *

Related guide: Early + * Fraud Warnings. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/radar/ValueList.java b/src/main/java/com/stripe/model/radar/ValueList.java index 00201efb761..8d76426d4d3 100644 --- a/src/main/java/com/stripe/model/radar/ValueList.java +++ b/src/main/java/com/stripe/model/radar/ValueList.java @@ -17,6 +17,12 @@ import lombok.Getter; import lombok.Setter; +/** + * Value lists allow you to group values together which can then be referenced in rules. + * + *

Related guide: Default + * Stripe Lists. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -82,6 +88,71 @@ public class ValueList extends ApiResource implements HasId, MetadataStoreValueList object, which can then be referenced in rules. */ + public static ValueList create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new ValueList object, which can then be referenced in rules. */ + public static ValueList create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/value_lists"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, ValueList.class, options); + } + + /** Creates a new ValueList object, which can then be referenced in rules. */ + public static ValueList create(ValueListCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new ValueList object, which can then be referenced in rules. */ + public static ValueList create(ValueListCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/value_lists"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, ValueList.class, options); + } + + /** + * Deletes a ValueList object, also deleting any items contained within the value + * list. To be deleted, a value list must not be referenced in any rules. + */ + public ValueList delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); + } + + /** + * Deletes a ValueList object, also deleting any items contained within the value + * list. To be deleted, a value list must not be referenced in any rules. + */ + public ValueList delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** + * Deletes a ValueList object, also deleting any items contained within the value + * list. To be deleted, a value list must not be referenced in any rules. + */ + public ValueList delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** + * Deletes a ValueList object, also deleting any items contained within the value + * list. To be deleted, a value list must not be referenced in any rules. + */ + public ValueList delete(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/radar/value_lists/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, ValueList.class, options); + } + /** * Returns a list of ValueList objects. The objects are sorted in descending order by * creation date, with the most recently created object appearing first. @@ -154,32 +225,6 @@ public static ValueList retrieve( ApiResource.RequestMethod.GET, url, params, ValueList.class, options); } - /** Creates a new ValueList object, which can then be referenced in rules. */ - public static ValueList create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new ValueList object, which can then be referenced in rules. */ - public static ValueList create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/value_lists"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, ValueList.class, options); - } - - /** Creates a new ValueList object, which can then be referenced in rules. */ - public static ValueList create(ValueListCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Creates a new ValueList object, which can then be referenced in rules. */ - public static ValueList create(ValueListCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/value_lists"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, ValueList.class, options); - } - /** * Updates a ValueList object by setting the values of the parameters passed. Any * parameters not provided will be left unchanged. Note that item_type is immutable. @@ -227,43 +272,4 @@ public ValueList update(ValueListUpdateParams params, RequestOptions options) return ApiResource.request( ApiResource.RequestMethod.POST, url, params, ValueList.class, options); } - - /** - * Deletes a ValueList object, also deleting any items contained within the value - * list. To be deleted, a value list must not be referenced in any rules. - */ - public ValueList delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** - * Deletes a ValueList object, also deleting any items contained within the value - * list. To be deleted, a value list must not be referenced in any rules. - */ - public ValueList delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** - * Deletes a ValueList object, also deleting any items contained within the value - * list. To be deleted, a value list must not be referenced in any rules. - */ - public ValueList delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** - * Deletes a ValueList object, also deleting any items contained within the value - * list. To be deleted, a value list must not be referenced in any rules. - */ - public ValueList delete(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/radar/value_lists/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, ValueList.class, options); - } } diff --git a/src/main/java/com/stripe/model/radar/ValueListItem.java b/src/main/java/com/stripe/model/radar/ValueListItem.java index 63b553f1801..c963abb40a4 100644 --- a/src/main/java/com/stripe/model/radar/ValueListItem.java +++ b/src/main/java/com/stripe/model/radar/ValueListItem.java @@ -15,6 +15,13 @@ import lombok.Getter; import lombok.Setter; +/** + * Value list items allow you to add specific values to a given Radar value list, which can then be + * used in rules. + * + *

Related guide: Managing List + * Items. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -59,6 +66,71 @@ public class ValueListItem extends ApiResource implements HasId { @SerializedName("value_list") String valueList; + /** + * Creates a new ValueListItem object, which is added to the specified parent value + * list. + */ + public static ValueListItem create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Creates a new ValueListItem object, which is added to the specified parent value + * list. + */ + public static ValueListItem create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/value_list_items"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, ValueListItem.class, options); + } + + /** + * Creates a new ValueListItem object, which is added to the specified parent value + * list. + */ + public static ValueListItem create(ValueListItemCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Creates a new ValueListItem object, which is added to the specified parent value + * list. + */ + public static ValueListItem create(ValueListItemCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/value_list_items"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, ValueListItem.class, options); + } + + /** Deletes a ValueListItem object, removing it from its parent value list. */ + public ValueListItem delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); + } + + /** Deletes a ValueListItem object, removing it from its parent value list. */ + public ValueListItem delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** Deletes a ValueListItem object, removing it from its parent value list. */ + public ValueListItem delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** Deletes a ValueListItem object, removing it from its parent value list. */ + public ValueListItem delete(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/radar/value_list_items/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, ValueListItem.class, options); + } + /** * Returns a list of ValueListItem objects. The objects are sorted in descending * order by creation date, with the most recently created object appearing first. @@ -130,69 +202,4 @@ public static ValueListItem retrieve( return ApiResource.request( ApiResource.RequestMethod.GET, url, params, ValueListItem.class, options); } - - /** - * Creates a new ValueListItem object, which is added to the specified parent value - * list. - */ - public static ValueListItem create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * Creates a new ValueListItem object, which is added to the specified parent value - * list. - */ - public static ValueListItem create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/value_list_items"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, ValueListItem.class, options); - } - - /** - * Creates a new ValueListItem object, which is added to the specified parent value - * list. - */ - public static ValueListItem create(ValueListItemCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** - * Creates a new ValueListItem object, which is added to the specified parent value - * list. - */ - public static ValueListItem create(ValueListItemCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/value_list_items"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, ValueListItem.class, options); - } - - /** Deletes a ValueListItem object, removing it from its parent value list. */ - public ValueListItem delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** Deletes a ValueListItem object, removing it from its parent value list. */ - public ValueListItem delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** Deletes a ValueListItem object, removing it from its parent value list. */ - public ValueListItem delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** Deletes a ValueListItem object, removing it from its parent value list. */ - public ValueListItem delete(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/radar/value_list_items/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, ValueListItem.class, options); - } } diff --git a/src/main/java/com/stripe/model/reporting/ReportRun.java b/src/main/java/com/stripe/model/reporting/ReportRun.java index f6235a838f9..d66c9cacc7d 100644 --- a/src/main/java/com/stripe/model/reporting/ReportRun.java +++ b/src/main/java/com/stripe/model/reporting/ReportRun.java @@ -18,6 +18,17 @@ import lombok.Getter; import lombok.Setter; +/** + * The Report Run object represents an instance of a report type generated with specific run + * parameters. Once the object is created, Stripe begins processing the report. When the report has + * finished running, it will give you a reference to a file where you can retrieve your results. For + * an overview, see API Access to + * Reports. + * + *

Note that certain report types can only be run based on your live-mode data (not test-mode + * data), and will error when queried without a live-mode API key. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -86,42 +97,6 @@ public class ReportRun extends ApiResource implements HasId { @SerializedName("succeeded_at") Long succeededAt; - /** Retrieves the details of an existing Report Run. */ - public static ReportRun retrieve(String reportRun) throws StripeException { - return retrieve(reportRun, (Map) null, (RequestOptions) null); - } - - /** Retrieves the details of an existing Report Run. */ - public static ReportRun retrieve(String reportRun, RequestOptions options) - throws StripeException { - return retrieve(reportRun, (Map) null, options); - } - - /** Retrieves the details of an existing Report Run. */ - public static ReportRun retrieve( - String reportRun, Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/reporting/report_runs/%s", ApiResource.urlEncodeId(reportRun))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, ReportRun.class, options); - } - - /** Retrieves the details of an existing Report Run. */ - public static ReportRun retrieve( - String reportRun, ReportRunRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/reporting/report_runs/%s", ApiResource.urlEncodeId(reportRun))); - return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, ReportRun.class, options); - } - /** * Creates a new object and begin running the report. (Certain report types require a live-mode API key.) @@ -184,6 +159,42 @@ public static ReportRunCollection list(ReportRunListParams params, RequestOption return ApiResource.requestCollection(url, params, ReportRunCollection.class, options); } + /** Retrieves the details of an existing Report Run. */ + public static ReportRun retrieve(String reportRun) throws StripeException { + return retrieve(reportRun, (Map) null, (RequestOptions) null); + } + + /** Retrieves the details of an existing Report Run. */ + public static ReportRun retrieve(String reportRun, RequestOptions options) + throws StripeException { + return retrieve(reportRun, (Map) null, options); + } + + /** Retrieves the details of an existing Report Run. */ + public static ReportRun retrieve( + String reportRun, Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/reporting/report_runs/%s", ApiResource.urlEncodeId(reportRun))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, ReportRun.class, options); + } + + /** Retrieves the details of an existing Report Run. */ + public static ReportRun retrieve( + String reportRun, ReportRunRetrieveParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/reporting/report_runs/%s", ApiResource.urlEncodeId(reportRun))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, ReportRun.class, options); + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/reporting/ReportType.java b/src/main/java/com/stripe/model/reporting/ReportType.java index 93a52351032..b2fd1e69486 100644 --- a/src/main/java/com/stripe/model/reporting/ReportType.java +++ b/src/main/java/com/stripe/model/reporting/ReportType.java @@ -15,6 +15,17 @@ import lombok.Getter; import lombok.Setter; +/** + * The Report Type resource corresponds to a particular type of report, such as the "Activity + * summary" or "Itemized payouts" reports. These objects are identified by an ID + * belonging to a set of enumerated values. See API Access to Reports documentation + * for those Report Type IDs, along with required and optional parameters. + * + *

Note that certain report types can only be run based on your live-mode data (not test-mode + * data), and will error when queried without a live-mode API key. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -78,6 +89,30 @@ public class ReportType extends ApiResource implements HasId { @SerializedName("version") Long version; + /** Returns a full list of Report Types. */ + public static ReportTypeCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a full list of Report Types. */ + public static ReportTypeCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/reporting/report_types"); + return ApiResource.requestCollection(url, params, ReportTypeCollection.class, options); + } + + /** Returns a full list of Report Types. */ + public static ReportTypeCollection list(ReportTypeListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a full list of Report Types. */ + public static ReportTypeCollection list(ReportTypeListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/reporting/report_types"); + return ApiResource.requestCollection(url, params, ReportTypeCollection.class, options); + } + /** * Retrieves the details of a Report Type. (Certain report types require a live-mode API key.) @@ -126,28 +161,4 @@ public static ReportType retrieve( return ApiResource.request( ApiResource.RequestMethod.GET, url, params, ReportType.class, options); } - - /** Returns a full list of Report Types. */ - public static ReportTypeCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a full list of Report Types. */ - public static ReportTypeCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/reporting/report_types"); - return ApiResource.requestCollection(url, params, ReportTypeCollection.class, options); - } - - /** Returns a full list of Report Types. */ - public static ReportTypeCollection list(ReportTypeListParams params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a full list of Report Types. */ - public static ReportTypeCollection list(ReportTypeListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/reporting/report_types"); - return ApiResource.requestCollection(url, params, ReportTypeCollection.class, options); - } } diff --git a/src/main/java/com/stripe/model/sigma/ScheduledQueryRun.java b/src/main/java/com/stripe/model/sigma/ScheduledQueryRun.java index b1913a573a9..394bc8c5769 100644 --- a/src/main/java/com/stripe/model/sigma/ScheduledQueryRun.java +++ b/src/main/java/com/stripe/model/sigma/ScheduledQueryRun.java @@ -16,6 +16,12 @@ import lombok.Getter; import lombok.Setter; +/** + * If you have scheduled a Sigma + * query, you'll receive a {@code sigma.scheduled_query_run.created} webhook each time the query + * runs. The webhook contains a {@code ScheduledQueryRun} object, which you can use to retrieve the + * query results. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/terminal/Configuration.java b/src/main/java/com/stripe/model/terminal/Configuration.java index 4946adc7a23..3b77805622e 100644 --- a/src/main/java/com/stripe/model/terminal/Configuration.java +++ b/src/main/java/com/stripe/model/terminal/Configuration.java @@ -20,6 +20,7 @@ import lombok.Getter; import lombok.Setter; +/** A Configurations object represents how features should be configured for terminal readers. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -87,6 +88,33 @@ public static Configuration create(ConfigurationCreateParams params, RequestOpti ApiResource.RequestMethod.POST, url, params, Configuration.class, options); } + /** Deletes a Configuration object. */ + public Configuration delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); + } + + /** Deletes a Configuration object. */ + public Configuration delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** Deletes a Configuration object. */ + public Configuration delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** Deletes a Configuration object. */ + public Configuration delete(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/terminal/configurations/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.DELETE, url, params, Configuration.class, options); + } + /** Returns a list of Configuration objects. */ public static ConfigurationCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -185,33 +213,6 @@ public Configuration update(ConfigurationUpdateParams params, RequestOptions opt ApiResource.RequestMethod.POST, url, params, Configuration.class, options); } - /** Deletes a Configuration object. */ - public Configuration delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); - } - - /** Deletes a Configuration object. */ - public Configuration delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); - } - - /** Deletes a Configuration object. */ - public Configuration delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); - } - - /** Deletes a Configuration object. */ - public Configuration delete(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/terminal/configurations/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, Configuration.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/terminal/ConnectionToken.java b/src/main/java/com/stripe/model/terminal/ConnectionToken.java index 6e7c165d7c9..c9079dae37e 100644 --- a/src/main/java/com/stripe/model/terminal/ConnectionToken.java +++ b/src/main/java/com/stripe/model/terminal/ConnectionToken.java @@ -12,6 +12,12 @@ import lombok.Getter; import lombok.Setter; +/** + * A Connection Token is used by the Stripe Terminal SDK to connect to a reader. + * + *

Related guide: Fleet + * Management. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/terminal/Location.java b/src/main/java/com/stripe/model/terminal/Location.java index 04b37342dec..a1a362d96b2 100644 --- a/src/main/java/com/stripe/model/terminal/Location.java +++ b/src/main/java/com/stripe/model/terminal/Location.java @@ -18,6 +18,12 @@ import lombok.Getter; import lombok.Setter; +/** + * A Location represents a grouping of readers. + * + *

Related guide: Fleet + * Management. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -66,39 +72,6 @@ public class Location extends ApiResource implements HasId, MetadataStoreLocation object. */ - public static Location retrieve(String location) throws StripeException { - return retrieve(location, (Map) null, (RequestOptions) null); - } - - /** Retrieves a Location object. */ - public static Location retrieve(String location, RequestOptions options) throws StripeException { - return retrieve(location, (Map) null, options); - } - - /** Retrieves a Location object. */ - public static Location retrieve( - String location, Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(location))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Location.class, options); - } - - /** Retrieves a Location object. */ - public static Location retrieve( - String location, LocationRetrieveParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(location))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Location.class, options); - } - /** * Creates a new Location object. For further details, including which address fields * are required in each country, see the Location object by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - */ - @Override - public Location update(Map params) throws StripeException { - return update(params, (RequestOptions) null); + /** Deletes a Location object. */ + public Location delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); } - /** - * Updates a Location object by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - */ - @Override - public Location update(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Location.class, options); + /** Deletes a Location object. */ + public Location delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); } - /** - * Updates a Location object by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - */ - public Location update(LocationUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + /** Deletes a Location object. */ + public Location delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); } - /** - * Updates a Location object by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - */ - public Location update(LocationUpdateParams params, RequestOptions options) + /** Deletes a Location object. */ + public Location delete(Map params, RequestOptions options) throws StripeException { String url = String.format( @@ -186,7 +138,7 @@ public Location update(LocationUpdateParams params, RequestOptions options) Stripe.getApiBase(), String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, Location.class, options); + ApiResource.RequestMethod.DELETE, url, params, Location.class, options); } /** Returns a list of Location objects. */ @@ -213,23 +165,54 @@ public static LocationCollection list(LocationListParams params, RequestOptions return ApiResource.requestCollection(url, params, LocationCollection.class, options); } - /** Deletes a Location object. */ - public Location delete() throws StripeException { - return delete((Map) null, (RequestOptions) null); + /** Retrieves a Location object. */ + public static Location retrieve(String location) throws StripeException { + return retrieve(location, (Map) null, (RequestOptions) null); } - /** Deletes a Location object. */ - public Location delete(RequestOptions options) throws StripeException { - return delete((Map) null, options); + /** Retrieves a Location object. */ + public static Location retrieve(String location, RequestOptions options) throws StripeException { + return retrieve(location, (Map) null, options); } - /** Deletes a Location object. */ - public Location delete(Map params) throws StripeException { - return delete(params, (RequestOptions) null); + /** Retrieves a Location object. */ + public static Location retrieve( + String location, Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(location))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Location.class, options); } - /** Deletes a Location object. */ - public Location delete(Map params, RequestOptions options) + /** Retrieves a Location object. */ + public static Location retrieve( + String location, LocationRetrieveParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(location))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Location.class, options); + } + + /** + * Updates a Location object by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + */ + @Override + public Location update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates a Location object by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + */ + @Override + public Location update(Map params, RequestOptions options) throws StripeException { String url = String.format( @@ -237,6 +220,29 @@ public Location delete(Map params, RequestOptions options) Stripe.getApiBase(), String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.DELETE, url, params, Location.class, options); + ApiResource.RequestMethod.POST, url, params, Location.class, options); + } + + /** + * Updates a Location object by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + */ + public Location update(LocationUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates a Location object by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + */ + public Location update(LocationUpdateParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, Location.class, options); } } diff --git a/src/main/java/com/stripe/model/terminal/Reader.java b/src/main/java/com/stripe/model/terminal/Reader.java index d7cd325fcd1..eb348f72054 100644 --- a/src/main/java/com/stripe/model/terminal/Reader.java +++ b/src/main/java/com/stripe/model/terminal/Reader.java @@ -27,6 +27,12 @@ import lombok.Getter; import lombok.Setter; +/** + * A Reader represents a physical device for accepting payment details. + * + *

Related guide: Connecting + * to a Reader. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -119,80 +125,48 @@ public void setLocationObject(Location expandableObject) { this.location = new ExpandableField(expandableObject.getId(), expandableObject); } - /** - * Updates a Reader object by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - */ - @Override - public Reader update(Map params) throws StripeException { - return update(params, (RequestOptions) null); + /** Cancels the current reader action. */ + public Reader cancelAction() throws StripeException { + return cancelAction((Map) null, (RequestOptions) null); } - /** - * Updates a Reader object by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - */ - @Override - public Reader update(Map params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Reader.class, options); + /** Cancels the current reader action. */ + public Reader cancelAction(RequestOptions options) throws StripeException { + return cancelAction((Map) null, options); } - /** - * Updates a Reader object by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - */ - public Reader update(ReaderUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); + /** Cancels the current reader action. */ + public Reader cancelAction(Map params) throws StripeException { + return cancelAction(params, (RequestOptions) null); } - /** - * Updates a Reader object by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - */ - public Reader update(ReaderUpdateParams params, RequestOptions options) throws StripeException { + /** Cancels the current reader action. */ + public Reader cancelAction(Map params, RequestOptions options) + throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(this.getId()))); + String.format( + "/v1/terminal/readers/%s/cancel_action", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Reader.class, options); } - /** Retrieves a Reader object. */ - public static Reader retrieve(String reader) throws StripeException { - return retrieve(reader, (Map) null, (RequestOptions) null); - } - - /** Retrieves a Reader object. */ - public static Reader retrieve(String reader, RequestOptions options) throws StripeException { - return retrieve(reader, (Map) null, options); - } - - /** Retrieves a Reader object. */ - public static Reader retrieve(String reader, Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(reader))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Reader.class, options); + /** Cancels the current reader action. */ + public Reader cancelAction(ReaderCancelActionParams params) throws StripeException { + return cancelAction(params, (RequestOptions) null); } - /** Retrieves a Reader object. */ - public static Reader retrieve(String reader, ReaderRetrieveParams params, RequestOptions options) + /** Cancels the current reader action. */ + public Reader cancelAction(ReaderCancelActionParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(reader))); - return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Reader.class, options); + String.format( + "/v1/terminal/readers/%s/cancel_action", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Reader.class, options); } /** Creates a new Reader object. */ @@ -219,30 +193,6 @@ public static Reader create(ReaderCreateParams params, RequestOptions options) return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Reader.class, options); } - /** Returns a list of Reader objects. */ - public static ReaderCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of Reader objects. */ - public static ReaderCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/terminal/readers"); - return ApiResource.requestCollection(url, params, ReaderCollection.class, options); - } - - /** Returns a list of Reader objects. */ - public static ReaderCollection list(ReaderListParams params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of Reader objects. */ - public static ReaderCollection list(ReaderListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/terminal/readers"); - return ApiResource.requestCollection(url, params, ReaderCollection.class, options); - } - /** Deletes a Reader object. */ public Reader delete() throws StripeException { return delete((Map) null, (RequestOptions) null); @@ -269,6 +219,30 @@ public Reader delete(Map params, RequestOptions options) throws ApiResource.RequestMethod.DELETE, url, params, Reader.class, options); } + /** Returns a list of Reader objects. */ + public static ReaderCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of Reader objects. */ + public static ReaderCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/terminal/readers"); + return ApiResource.requestCollection(url, params, ReaderCollection.class, options); + } + + /** Returns a list of Reader objects. */ + public static ReaderCollection list(ReaderListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of Reader objects. */ + public static ReaderCollection list(ReaderListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/terminal/readers"); + return ApiResource.requestCollection(url, params, ReaderCollection.class, options); + } + /** Initiates a payment flow on a Reader. */ public Reader processPaymentIntent(Map params) throws StripeException { return processPaymentIntent(params, (RequestOptions) null); @@ -342,48 +316,36 @@ public Reader processSetupIntent(ReaderProcessSetupIntentParams params, RequestO return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Reader.class, options); } - /** Cancels the current reader action. */ - public Reader cancelAction() throws StripeException { - return cancelAction((Map) null, (RequestOptions) null); - } - - /** Cancels the current reader action. */ - public Reader cancelAction(RequestOptions options) throws StripeException { - return cancelAction((Map) null, options); + /** Retrieves a Reader object. */ + public static Reader retrieve(String reader) throws StripeException { + return retrieve(reader, (Map) null, (RequestOptions) null); } - /** Cancels the current reader action. */ - public Reader cancelAction(Map params) throws StripeException { - return cancelAction(params, (RequestOptions) null); + /** Retrieves a Reader object. */ + public static Reader retrieve(String reader, RequestOptions options) throws StripeException { + return retrieve(reader, (Map) null, options); } - /** Cancels the current reader action. */ - public Reader cancelAction(Map params, RequestOptions options) + /** Retrieves a Reader object. */ + public static Reader retrieve(String reader, Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format( - "/v1/terminal/readers/%s/cancel_action", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Reader.class, options); - } - - /** Cancels the current reader action. */ - public Reader cancelAction(ReaderCancelActionParams params) throws StripeException { - return cancelAction(params, (RequestOptions) null); + String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(reader))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Reader.class, options); } - /** Cancels the current reader action. */ - public Reader cancelAction(ReaderCancelActionParams params, RequestOptions options) + /** Retrieves a Reader object. */ + public static Reader retrieve(String reader, ReaderRetrieveParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format( - "/v1/terminal/readers/%s/cancel_action", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Reader.class, options); + String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(reader))); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Reader.class, options); } /** Sets reader display to show cart details. */ @@ -422,6 +384,51 @@ public Reader setReaderDisplay(ReaderSetReaderDisplayParams params, RequestOptio return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Reader.class, options); } + /** + * Updates a Reader object by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + */ + @Override + public Reader update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates a Reader object by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + */ + @Override + public Reader update(Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Reader.class, options); + } + + /** + * Updates a Reader object by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + */ + public Reader update(ReaderUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates a Reader object by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + */ + public Reader update(ReaderUpdateParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Reader.class, options); + } + + /** Represents an action performed by the reader. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -463,6 +470,7 @@ public static class ReaderAction extends StripeObject { @SerializedName("type") String type; + /** Represents a reader action to process a payment intent. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -496,6 +504,7 @@ public void setPaymentIntentObject(PaymentIntent expandableObject) { new ExpandableField(expandableObject.getId(), expandableObject); } + /** Represents a per-transaction override of a reader configuration. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -506,10 +515,16 @@ public static class ProcessConfig extends StripeObject { } } + /** Represents a reader action to process a setup intent. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class ProcessSetupIntentAction extends StripeObject { + /** + * ID of a card PaymentMethod generated from the card_present PaymentMethod that may be + * attached to a Customer for future transactions. Only present if it was possible to generate + * a card PaymentMethod. + */ @SerializedName("generated_card") String generatedCard; @@ -539,6 +554,7 @@ public void setSetupIntentObject(SetupIntent expandableObject) { } } + /** Represents a reader action to set the reader display. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -555,6 +571,7 @@ public static class SetReaderDisplayAction extends StripeObject { @SerializedName("type") String type; + /** Represents a cart to be displayed on the reader. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -585,6 +602,7 @@ public static class Cart extends StripeObject { @SerializedName("total") Long total; + /** Represents a line item to be displayed on the reader. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/testhelpers/TestClock.java b/src/main/java/com/stripe/model/testhelpers/TestClock.java index e7cbbb3e2db..29ce66fd9db 100644 --- a/src/main/java/com/stripe/model/testhelpers/TestClock.java +++ b/src/main/java/com/stripe/model/testhelpers/TestClock.java @@ -16,6 +16,13 @@ import lombok.Getter; import lombok.Setter; +/** + * A test clock enables deterministic control over objects in testmode. With a test clock, you can + * create objects at a frozen time in the past or future, and advance to a specific future time to + * observe webhooks and state changes. After the clock advances, you can either validate the current + * state of your scenario (and test your assumptions), change the current state of your scenario + * (and test more complex scenarios), or keep advancing forward in time. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -68,40 +75,52 @@ public class TestClock extends ApiResource implements HasId { @SerializedName("status") String status; - /** Retrieves a test clock. */ - public static TestClock retrieve(String testClock) throws StripeException { - return retrieve(testClock, (Map) null, (RequestOptions) null); + /** + * Starts advancing a test clock to a specified time in the future. Advancement is done when + * status changes to Ready. + */ + public TestClock advance(Map params) throws StripeException { + return advance(params, (RequestOptions) null); } - /** Retrieves a test clock. */ - public static TestClock retrieve(String testClock, RequestOptions options) + /** + * Starts advancing a test clock to a specified time in the future. Advancement is done when + * status changes to Ready. + */ + public TestClock advance(Map params, RequestOptions options) throws StripeException { - return retrieve(testClock, (Map) null, options); - } - - /** Retrieves a test clock. */ - public static TestClock retrieve( - String testClock, Map params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/test_helpers/test_clocks/%s", ApiResource.urlEncodeId(testClock))); + String.format( + "/v1/test_helpers/test_clocks/%s/advance", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, TestClock.class, options); + ApiResource.RequestMethod.POST, url, params, TestClock.class, options); } - /** Retrieves a test clock. */ - public static TestClock retrieve( - String testClock, TestClockRetrieveParams params, RequestOptions options) + /** + * Starts advancing a test clock to a specified time in the future. Advancement is done when + * status changes to Ready. + */ + public TestClock advance(TestClockAdvanceParams params) throws StripeException { + return advance(params, (RequestOptions) null); + } + + /** + * Starts advancing a test clock to a specified time in the future. Advancement is done when + * status changes to Ready. + */ + public TestClock advance(TestClockAdvanceParams params, RequestOptions options) throws StripeException { String url = String.format( "%s%s", Stripe.getApiBase(), - String.format("/v1/test_helpers/test_clocks/%s", ApiResource.urlEncodeId(testClock))); + String.format( + "/v1/test_helpers/test_clocks/%s/advance", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request( - ApiResource.RequestMethod.GET, url, params, TestClock.class, options); + ApiResource.RequestMethod.POST, url, params, TestClock.class, options); } /** Creates a new test clock that can be attached to new customers and quotes. */ @@ -158,54 +177,6 @@ public TestClock delete(Map params, RequestOptions options) ApiResource.RequestMethod.DELETE, url, params, TestClock.class, options); } - /** - * Starts advancing a test clock to a specified time in the future. Advancement is done when - * status changes to Ready. - */ - public TestClock advance(Map params) throws StripeException { - return advance(params, (RequestOptions) null); - } - - /** - * Starts advancing a test clock to a specified time in the future. Advancement is done when - * status changes to Ready. - */ - public TestClock advance(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/test_helpers/test_clocks/%s/advance", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, TestClock.class, options); - } - - /** - * Starts advancing a test clock to a specified time in the future. Advancement is done when - * status changes to Ready. - */ - public TestClock advance(TestClockAdvanceParams params) throws StripeException { - return advance(params, (RequestOptions) null); - } - - /** - * Starts advancing a test clock to a specified time in the future. Advancement is done when - * status changes to Ready. - */ - public TestClock advance(TestClockAdvanceParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/test_helpers/test_clocks/%s/advance", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, TestClock.class, options); - } - /** Returns a list of your test clocks. */ public static TestClockCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -229,4 +200,40 @@ public static TestClockCollection list(TestClockListParams params, RequestOption String url = String.format("%s%s", Stripe.getApiBase(), "/v1/test_helpers/test_clocks"); return ApiResource.requestCollection(url, params, TestClockCollection.class, options); } + + /** Retrieves a test clock. */ + public static TestClock retrieve(String testClock) throws StripeException { + return retrieve(testClock, (Map) null, (RequestOptions) null); + } + + /** Retrieves a test clock. */ + public static TestClock retrieve(String testClock, RequestOptions options) + throws StripeException { + return retrieve(testClock, (Map) null, options); + } + + /** Retrieves a test clock. */ + public static TestClock retrieve( + String testClock, Map params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/test_helpers/test_clocks/%s", ApiResource.urlEncodeId(testClock))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, TestClock.class, options); + } + + /** Retrieves a test clock. */ + public static TestClock retrieve( + String testClock, TestClockRetrieveParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format("/v1/test_helpers/test_clocks/%s", ApiResource.urlEncodeId(testClock))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, TestClock.class, options); + } } diff --git a/src/main/java/com/stripe/model/treasury/CreditReversal.java b/src/main/java/com/stripe/model/treasury/CreditReversal.java index 1715d41aa79..c690e942cab 100644 --- a/src/main/java/com/stripe/model/treasury/CreditReversal.java +++ b/src/main/java/com/stripe/model/treasury/CreditReversal.java @@ -17,6 +17,11 @@ import lombok.Getter; import lombok.Setter; +/** + * You can reverse some ReceivedCredits + * depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a + * new object known as a CreditReversal. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -119,6 +124,32 @@ public void setTransactionObject(Transaction expandableObject) { this.transaction = new ExpandableField(expandableObject.getId(), expandableObject); } + /** Reverses a ReceivedCredit and creates a CreditReversal object. */ + public static CreditReversal create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Reverses a ReceivedCredit and creates a CreditReversal object. */ + public static CreditReversal create(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/credit_reversals"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, CreditReversal.class, options); + } + + /** Reverses a ReceivedCredit and creates a CreditReversal object. */ + public static CreditReversal create(CreditReversalCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Reverses a ReceivedCredit and creates a CreditReversal object. */ + public static CreditReversal create(CreditReversalCreateParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/credit_reversals"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, CreditReversal.class, options); + } + /** Returns a list of CreditReversals. */ public static CreditReversalCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -195,32 +226,6 @@ public static CreditReversal retrieve( ApiResource.RequestMethod.GET, url, params, CreditReversal.class, options); } - /** Reverses a ReceivedCredit and creates a CreditReversal object. */ - public static CreditReversal create(Map params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Reverses a ReceivedCredit and creates a CreditReversal object. */ - public static CreditReversal create(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/credit_reversals"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, CreditReversal.class, options); - } - - /** Reverses a ReceivedCredit and creates a CreditReversal object. */ - public static CreditReversal create(CreditReversalCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - - /** Reverses a ReceivedCredit and creates a CreditReversal object. */ - public static CreditReversal create(CreditReversalCreateParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/credit_reversals"); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, CreditReversal.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/treasury/DebitReversal.java b/src/main/java/com/stripe/model/treasury/DebitReversal.java index 275fefeaeb5..7e586a93efa 100644 --- a/src/main/java/com/stripe/model/treasury/DebitReversal.java +++ b/src/main/java/com/stripe/model/treasury/DebitReversal.java @@ -17,6 +17,11 @@ import lombok.Getter; import lombok.Setter; +/** + * You can reverse some ReceivedDebits + * depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a + * new object known as a DebitReversal. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -149,6 +154,31 @@ public static DebitReversal create(DebitReversalCreateParams params, RequestOpti ApiResource.RequestMethod.POST, url, params, DebitReversal.class, options); } + /** Returns a list of DebitReversals. */ + public static DebitReversalCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of DebitReversals. */ + public static DebitReversalCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/debit_reversals"); + return ApiResource.requestCollection(url, params, DebitReversalCollection.class, options); + } + + /** Returns a list of DebitReversals. */ + public static DebitReversalCollection list(DebitReversalListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of DebitReversals. */ + public static DebitReversalCollection list(DebitReversalListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/debit_reversals"); + return ApiResource.requestCollection(url, params, DebitReversalCollection.class, options); + } + /** Retrieves a DebitReversal object. */ public static DebitReversal retrieve(String debitReversal) throws StripeException { return retrieve(debitReversal, (Map) null, (RequestOptions) null); @@ -188,31 +218,6 @@ public static DebitReversal retrieve( ApiResource.RequestMethod.GET, url, params, DebitReversal.class, options); } - /** Returns a list of DebitReversals. */ - public static DebitReversalCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of DebitReversals. */ - public static DebitReversalCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/debit_reversals"); - return ApiResource.requestCollection(url, params, DebitReversalCollection.class, options); - } - - /** Returns a list of DebitReversals. */ - public static DebitReversalCollection list(DebitReversalListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of DebitReversals. */ - public static DebitReversalCollection list(DebitReversalListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/debit_reversals"); - return ApiResource.requestCollection(url, params, DebitReversalCollection.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/treasury/FinancialAccount.java b/src/main/java/com/stripe/model/treasury/FinancialAccount.java index 35e4df68473..12366e818fc 100644 --- a/src/main/java/com/stripe/model/treasury/FinancialAccount.java +++ b/src/main/java/com/stripe/model/treasury/FinancialAccount.java @@ -21,6 +21,11 @@ import lombok.Getter; import lombok.Setter; +/** + * Stripe Treasury provides users with a container for money called a FinancialAccount that is + * separate from their Payments balance. FinancialAccounts serve as the source and destination of + * Treasury’s money movement APIs. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -155,94 +160,6 @@ public static FinancialAccount create(FinancialAccountCreateParams params, Reque ApiResource.RequestMethod.POST, url, params, FinancialAccount.class, options); } - /** Updates the details of a FinancialAccount. */ - @Override - public FinancialAccount update(Map params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** Updates the details of a FinancialAccount. */ - @Override - public FinancialAccount update(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/treasury/financial_accounts/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, FinancialAccount.class, options); - } - - /** Updates the details of a FinancialAccount. */ - public FinancialAccount update(FinancialAccountUpdateParams params) throws StripeException { - return update(params, (RequestOptions) null); - } - - /** Updates the details of a FinancialAccount. */ - public FinancialAccount update(FinancialAccountUpdateParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/treasury/financial_accounts/%s", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, FinancialAccount.class, options); - } - - /** Updates the Features associated with a FinancialAccount. */ - public FinancialAccountFeatures updateFeatures() throws StripeException { - return updateFeatures((Map) null, (RequestOptions) null); - } - - /** Updates the Features associated with a FinancialAccount. */ - public FinancialAccountFeatures updateFeatures(RequestOptions options) throws StripeException { - return updateFeatures((Map) null, options); - } - - /** Updates the Features associated with a FinancialAccount. */ - public FinancialAccountFeatures updateFeatures(Map params) - throws StripeException { - return updateFeatures(params, (RequestOptions) null); - } - - /** Updates the Features associated with a FinancialAccount. */ - public FinancialAccountFeatures updateFeatures(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/treasury/financial_accounts/%s/features", - ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, FinancialAccountFeatures.class, options); - } - - /** Updates the Features associated with a FinancialAccount. */ - public FinancialAccountFeatures updateFeatures(FinancialAccountUpdateFeaturesParams params) - throws StripeException { - return updateFeatures(params, (RequestOptions) null); - } - - /** Updates the Features associated with a FinancialAccount. */ - public FinancialAccountFeatures updateFeatures( - FinancialAccountUpdateFeaturesParams params, RequestOptions options) throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/treasury/financial_accounts/%s/features", - ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, FinancialAccountFeatures.class, options); - } - /** Returns a list of FinancialAccounts. */ public static FinancialAccountCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); @@ -353,6 +270,95 @@ public FinancialAccountFeatures retrieveFeatures( ApiResource.RequestMethod.GET, url, params, FinancialAccountFeatures.class, options); } + /** Updates the details of a FinancialAccount. */ + @Override + public FinancialAccount update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates the details of a FinancialAccount. */ + @Override + public FinancialAccount update(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/treasury/financial_accounts/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, FinancialAccount.class, options); + } + + /** Updates the details of a FinancialAccount. */ + public FinancialAccount update(FinancialAccountUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates the details of a FinancialAccount. */ + public FinancialAccount update(FinancialAccountUpdateParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/treasury/financial_accounts/%s", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, FinancialAccount.class, options); + } + + /** Updates the Features associated with a FinancialAccount. */ + public FinancialAccountFeatures updateFeatures() throws StripeException { + return updateFeatures((Map) null, (RequestOptions) null); + } + + /** Updates the Features associated with a FinancialAccount. */ + public FinancialAccountFeatures updateFeatures(RequestOptions options) throws StripeException { + return updateFeatures((Map) null, options); + } + + /** Updates the Features associated with a FinancialAccount. */ + public FinancialAccountFeatures updateFeatures(Map params) + throws StripeException { + return updateFeatures(params, (RequestOptions) null); + } + + /** Updates the Features associated with a FinancialAccount. */ + public FinancialAccountFeatures updateFeatures(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/treasury/financial_accounts/%s/features", + ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, FinancialAccountFeatures.class, options); + } + + /** Updates the Features associated with a FinancialAccount. */ + public FinancialAccountFeatures updateFeatures(FinancialAccountUpdateFeaturesParams params) + throws StripeException { + return updateFeatures(params, (RequestOptions) null); + } + + /** Updates the Features associated with a FinancialAccount. */ + public FinancialAccountFeatures updateFeatures( + FinancialAccountUpdateFeaturesParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/treasury/financial_accounts/%s/features", + ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, FinancialAccountFeatures.class, options); + } + + /** Balance information for the FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -373,6 +379,7 @@ public static class Balance extends StripeObject { Map outboundPending; } + /** FinancialAddresses contain identifying information that resolves to a FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -393,6 +400,7 @@ public static class FinancialAddress extends StripeObject { @SerializedName("type") String type; + /** ABA Records contain U.S. bank account details per the ABA format. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -419,6 +427,7 @@ public static class Aba extends StripeObject { } } + /** Restrictions that a Connect Platform has placed on this FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -458,6 +467,7 @@ public static class Closed extends StripeObject { } } + /** Toggle settings for enabling/disabling a feature. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -478,6 +488,7 @@ public static class ToggleSettings extends StripeObject { @SerializedName("status_details") List statusDetails; + /** Additional details on the FinancialAccount Features information. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/treasury/FinancialAccountFeatures.java b/src/main/java/com/stripe/model/treasury/FinancialAccountFeatures.java index f3312834622..c2f030759a8 100644 --- a/src/main/java/com/stripe/model/treasury/FinancialAccountFeatures.java +++ b/src/main/java/com/stripe/model/treasury/FinancialAccountFeatures.java @@ -8,6 +8,11 @@ import lombok.Getter; import lombok.Setter; +/** + * Encodes whether a FinancialAccount has access to a particular Feature, with a {@code status} enum + * and associated {@code status_details}. Stripe or the platform can control Features via the + * requested field. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -48,6 +53,7 @@ public class FinancialAccountFeatures extends StripeObject { @SerializedName("outbound_transfers") OutboundTransfers outboundTransfers; + /** Toggle settings for enabling/disabling a feature. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -68,6 +74,7 @@ public static class CardIssuing extends StripeObject { @SerializedName("status_details") List statusDetails; + /** Additional details on the FinancialAccount Features information. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -102,6 +109,7 @@ public static class StatusDetails extends StripeObject { } } + /** Toggle settings for enabling/disabling a feature. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -122,6 +130,7 @@ public static class DepositInsurance extends StripeObject { @SerializedName("status_details") List statusDetails; + /** Additional details on the FinancialAccount Features information. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -156,6 +165,7 @@ public static class StatusDetails extends StripeObject { } } + /** Settings related to Financial Addresses features on a Financial Account. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -164,6 +174,7 @@ public static class FinancialAddresses extends StripeObject { @SerializedName("aba") Aba aba; + /** Toggle settings for enabling/disabling a feature. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -184,6 +195,7 @@ public static class Aba extends StripeObject { @SerializedName("status_details") List statusDetails; + /** Additional details on the FinancialAccount Features information. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -219,6 +231,7 @@ public static class StatusDetails extends StripeObject { } } + /** InboundTransfers contains inbound transfers features for a FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -227,6 +240,7 @@ public static class InboundTransfers extends StripeObject { @SerializedName("ach") Ach ach; + /** Toggle settings for enabling/disabling a feature. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -247,6 +261,7 @@ public static class Ach extends StripeObject { @SerializedName("status_details") List statusDetails; + /** Additional details on the FinancialAccount Features information. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -282,6 +297,7 @@ public static class StatusDetails extends StripeObject { } } + /** Toggle settings for enabling/disabling a feature. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -302,6 +318,7 @@ public static class IntraStripeFlows extends StripeObject { @SerializedName("status_details") List statusDetails; + /** Additional details on the FinancialAccount Features information. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -336,6 +353,7 @@ public static class StatusDetails extends StripeObject { } } + /** Settings related to Outbound Payments features on a Financial Account. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -348,6 +366,7 @@ public static class OutboundPayments extends StripeObject { @SerializedName("us_domestic_wire") UsDomesticWire usDomesticWire; + /** Toggle settings for enabling/disabling a feature. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -368,6 +387,7 @@ public static class Ach extends StripeObject { @SerializedName("status_details") List statusDetails; + /** Additional details on the FinancialAccount Features information. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -402,6 +422,7 @@ public static class StatusDetails extends StripeObject { } } + /** Toggle settings for enabling/disabling a feature. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -422,6 +443,7 @@ public static class UsDomesticWire extends StripeObject { @SerializedName("status_details") List statusDetails; + /** Additional details on the FinancialAccount Features information. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -457,6 +479,7 @@ public static class StatusDetails extends StripeObject { } } + /** OutboundTransfers contains outbound transfers features for a FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -469,6 +492,7 @@ public static class OutboundTransfers extends StripeObject { @SerializedName("us_domestic_wire") UsDomesticWire usDomesticWire; + /** Toggle settings for enabling/disabling a feature. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -489,6 +513,7 @@ public static class Ach extends StripeObject { @SerializedName("status_details") List statusDetails; + /** Additional details on the FinancialAccount Features information. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -523,6 +548,7 @@ public static class StatusDetails extends StripeObject { } } + /** Toggle settings for enabling/disabling a feature. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -543,6 +569,7 @@ public static class UsDomesticWire extends StripeObject { @SerializedName("status_details") List statusDetails; + /** Additional details on the FinancialAccount Features information. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -578,6 +605,7 @@ public static class StatusDetails extends StripeObject { } } + /** Restrictions that a Connect Platform has placed on this FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/treasury/InboundTransfer.java b/src/main/java/com/stripe/model/treasury/InboundTransfer.java index 2674a2cdb47..8bc51e33024 100644 --- a/src/main/java/com/stripe/model/treasury/InboundTransfer.java +++ b/src/main/java/com/stripe/model/treasury/InboundTransfer.java @@ -22,6 +22,13 @@ import lombok.Getter; import lombok.Setter; +/** + * Use InboundTransfers + * to add funds to your FinancialAccount via a PaymentMethod + * that is owned by you. The funds will be transferred via an ACH debit. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -228,6 +235,31 @@ public static InboundTransfer create(InboundTransferCreateParams params, Request ApiResource.RequestMethod.POST, url, params, InboundTransfer.class, options); } + /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */ + public static InboundTransferCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */ + public static InboundTransferCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/inbound_transfers"); + return ApiResource.requestCollection(url, params, InboundTransferCollection.class, options); + } + + /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */ + public static InboundTransferCollection list(InboundTransferListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */ + public static InboundTransferCollection list( + InboundTransferListParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/inbound_transfers"); + return ApiResource.requestCollection(url, params, InboundTransferCollection.class, options); + } + /** Retrieves the details of an existing InboundTransfer. */ public static InboundTransfer retrieve(String id) throws StripeException { return retrieve(id, (Map) null, (RequestOptions) null); @@ -263,31 +295,6 @@ public static InboundTransfer retrieve( ApiResource.RequestMethod.GET, url, params, InboundTransfer.class, options); } - /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */ - public static InboundTransferCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */ - public static InboundTransferCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/inbound_transfers"); - return ApiResource.requestCollection(url, params, InboundTransferCollection.class, options); - } - - /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */ - public static InboundTransferCollection list(InboundTransferListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */ - public static InboundTransferCollection list( - InboundTransferListParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/inbound_transfers"); - return ApiResource.requestCollection(url, params, InboundTransferCollection.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/treasury/OutboundPayment.java b/src/main/java/com/stripe/model/treasury/OutboundPayment.java index aff11ba4443..424bbaa9638 100644 --- a/src/main/java/com/stripe/model/treasury/OutboundPayment.java +++ b/src/main/java/com/stripe/model/treasury/OutboundPayment.java @@ -22,6 +22,16 @@ import lombok.Getter; import lombok.Setter; +/** + * Use OutboundPayments to send funds to another party's external bank account or FinancialAccount. To send money to an + * account belonging to the same user, use an OutboundTransfer. + * + *

Simulate OutboundPayment state changes with the {@code + * /v1/test_helpers/treasury/outbound_payments} endpoints. These methods can only be called on test + * mode objects. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -167,6 +177,52 @@ public void setTransactionObject(Transaction expandableObject) { this.transaction = new ExpandableField(expandableObject.getId(), expandableObject); } + /** Cancel an OutboundPayment. */ + public OutboundPayment cancel() throws StripeException { + return cancel((Map) null, (RequestOptions) null); + } + + /** Cancel an OutboundPayment. */ + public OutboundPayment cancel(RequestOptions options) throws StripeException { + return cancel((Map) null, options); + } + + /** Cancel an OutboundPayment. */ + public OutboundPayment cancel(Map params) throws StripeException { + return cancel(params, (RequestOptions) null); + } + + /** Cancel an OutboundPayment. */ + public OutboundPayment cancel(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/treasury/outbound_payments/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, OutboundPayment.class, options); + } + + /** Cancel an OutboundPayment. */ + public OutboundPayment cancel(OutboundPaymentCancelParams params) throws StripeException { + return cancel(params, (RequestOptions) null); + } + + /** Cancel an OutboundPayment. */ + public OutboundPayment cancel(OutboundPaymentCancelParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/treasury/outbound_payments/%s/cancel", ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, OutboundPayment.class, options); + } + /** Creates an OutboundPayment. */ public static OutboundPayment create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -193,6 +249,31 @@ public static OutboundPayment create(OutboundPaymentCreateParams params, Request ApiResource.RequestMethod.POST, url, params, OutboundPayment.class, options); } + /** Returns a list of OutboundPayments sent from the specified FinancialAccount. */ + public static OutboundPaymentCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of OutboundPayments sent from the specified FinancialAccount. */ + public static OutboundPaymentCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/outbound_payments"); + return ApiResource.requestCollection(url, params, OutboundPaymentCollection.class, options); + } + + /** Returns a list of OutboundPayments sent from the specified FinancialAccount. */ + public static OutboundPaymentCollection list(OutboundPaymentListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of OutboundPayments sent from the specified FinancialAccount. */ + public static OutboundPaymentCollection list( + OutboundPaymentListParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/outbound_payments"); + return ApiResource.requestCollection(url, params, OutboundPaymentCollection.class, options); + } + /** * Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID * from either the OutboundPayment creation request or OutboundPayment list. @@ -240,77 +321,6 @@ public static OutboundPayment retrieve( ApiResource.RequestMethod.GET, url, params, OutboundPayment.class, options); } - /** Returns a list of OutboundPayments sent from the specified FinancialAccount. */ - public static OutboundPaymentCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of OutboundPayments sent from the specified FinancialAccount. */ - public static OutboundPaymentCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/outbound_payments"); - return ApiResource.requestCollection(url, params, OutboundPaymentCollection.class, options); - } - - /** Returns a list of OutboundPayments sent from the specified FinancialAccount. */ - public static OutboundPaymentCollection list(OutboundPaymentListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of OutboundPayments sent from the specified FinancialAccount. */ - public static OutboundPaymentCollection list( - OutboundPaymentListParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/outbound_payments"); - return ApiResource.requestCollection(url, params, OutboundPaymentCollection.class, options); - } - - /** Cancel an OutboundPayment. */ - public OutboundPayment cancel() throws StripeException { - return cancel((Map) null, (RequestOptions) null); - } - - /** Cancel an OutboundPayment. */ - public OutboundPayment cancel(RequestOptions options) throws StripeException { - return cancel((Map) null, options); - } - - /** Cancel an OutboundPayment. */ - public OutboundPayment cancel(Map params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** Cancel an OutboundPayment. */ - public OutboundPayment cancel(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/treasury/outbound_payments/%s/cancel", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, OutboundPayment.class, options); - } - - /** Cancel an OutboundPayment. */ - public OutboundPayment cancel(OutboundPaymentCancelParams params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** Cancel an OutboundPayment. */ - public OutboundPayment cancel(OutboundPaymentCancelParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/treasury/outbound_payments/%s/cancel", ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, OutboundPayment.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/treasury/OutboundTransfer.java b/src/main/java/com/stripe/model/treasury/OutboundTransfer.java index b5ab1e2425c..0a63532d180 100644 --- a/src/main/java/com/stripe/model/treasury/OutboundTransfer.java +++ b/src/main/java/com/stripe/model/treasury/OutboundTransfer.java @@ -22,6 +22,17 @@ import lombok.Getter; import lombok.Setter; +/** + * Use OutboundTransfers to transfer funds from a FinancialAccount to a PaymentMethod + * belonging to the same entity. To send funds to a different party, use OutboundPayments instead. You can send + * funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + * + *

Simulate OutboundTransfer state changes with the {@code + * /v1/test_helpers/treasury/outbound_transfers} endpoints. These methods can only be called on test + * mode objects. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -149,6 +160,54 @@ public void setTransactionObject(Transaction expandableObject) { this.transaction = new ExpandableField(expandableObject.getId(), expandableObject); } + /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ + public OutboundTransfer cancel() throws StripeException { + return cancel((Map) null, (RequestOptions) null); + } + + /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ + public OutboundTransfer cancel(RequestOptions options) throws StripeException { + return cancel((Map) null, options); + } + + /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ + public OutboundTransfer cancel(Map params) throws StripeException { + return cancel(params, (RequestOptions) null); + } + + /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ + public OutboundTransfer cancel(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/treasury/outbound_transfers/%s/cancel", + ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, OutboundTransfer.class, options); + } + + /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ + public OutboundTransfer cancel(OutboundTransferCancelParams params) throws StripeException { + return cancel(params, (RequestOptions) null); + } + + /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ + public OutboundTransfer cancel(OutboundTransferCancelParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/treasury/outbound_transfers/%s/cancel", + ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, OutboundTransfer.class, options); + } + /** Creates an OutboundTransfer. */ public static OutboundTransfer create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -176,6 +235,31 @@ public static OutboundTransfer create(OutboundTransferCreateParams params, Reque ApiResource.RequestMethod.POST, url, params, OutboundTransfer.class, options); } + /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */ + public static OutboundTransferCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */ + public static OutboundTransferCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/outbound_transfers"); + return ApiResource.requestCollection(url, params, OutboundTransferCollection.class, options); + } + + /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */ + public static OutboundTransferCollection list(OutboundTransferListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */ + public static OutboundTransferCollection list( + OutboundTransferListParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/outbound_transfers"); + return ApiResource.requestCollection(url, params, OutboundTransferCollection.class, options); + } + /** * Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID * from either the OutboundTransfer creation request or OutboundTransfer list. @@ -227,79 +311,6 @@ public static OutboundTransfer retrieve( ApiResource.RequestMethod.GET, url, params, OutboundTransfer.class, options); } - /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */ - public static OutboundTransferCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */ - public static OutboundTransferCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/outbound_transfers"); - return ApiResource.requestCollection(url, params, OutboundTransferCollection.class, options); - } - - /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */ - public static OutboundTransferCollection list(OutboundTransferListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */ - public static OutboundTransferCollection list( - OutboundTransferListParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/outbound_transfers"); - return ApiResource.requestCollection(url, params, OutboundTransferCollection.class, options); - } - - /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ - public OutboundTransfer cancel() throws StripeException { - return cancel((Map) null, (RequestOptions) null); - } - - /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ - public OutboundTransfer cancel(RequestOptions options) throws StripeException { - return cancel((Map) null, options); - } - - /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ - public OutboundTransfer cancel(Map params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ - public OutboundTransfer cancel(Map params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/treasury/outbound_transfers/%s/cancel", - ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, OutboundTransfer.class, options); - } - - /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ - public OutboundTransfer cancel(OutboundTransferCancelParams params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */ - public OutboundTransfer cancel(OutboundTransferCancelParams params, RequestOptions options) - throws StripeException { - String url = - String.format( - "%s%s", - Stripe.getApiBase(), - String.format( - "/v1/treasury/outbound_transfers/%s/cancel", - ApiResource.urlEncodeId(this.getId()))); - return ApiResource.request( - ApiResource.RequestMethod.POST, url, params, OutboundTransfer.class, options); - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/treasury/ReceivedCredit.java b/src/main/java/com/stripe/model/treasury/ReceivedCredit.java index 7929c5f8a6d..c2f3b0bab4f 100644 --- a/src/main/java/com/stripe/model/treasury/ReceivedCredit.java +++ b/src/main/java/com/stripe/model/treasury/ReceivedCredit.java @@ -19,6 +19,11 @@ import lombok.Getter; import lombok.Setter; +/** + * ReceivedCredits represent funds sent to a FinancialAccount (for example, via ACH + * or wire). These money movements are not initiated from the FinancialAccount. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java index af0a9f49baf..ace13b07c21 100644 --- a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java +++ b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java @@ -18,6 +18,11 @@ import lombok.Getter; import lombok.Setter; +/** + * ReceivedDebits represent funds pulled from a FinancialAccount. These are not + * initiated from the FinancialAccount. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/treasury/Transaction.java b/src/main/java/com/stripe/model/treasury/Transaction.java index e7875887b51..b314108f7ed 100644 --- a/src/main/java/com/stripe/model/treasury/Transaction.java +++ b/src/main/java/com/stripe/model/treasury/Transaction.java @@ -15,6 +15,10 @@ import lombok.Getter; import lombok.Setter; +/** + * Transactions represent changes to a FinancialAccount's balance. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -102,6 +106,30 @@ public class Transaction extends ApiResource implements HasId { @SerializedName("status_transitions") StatusTransitions statusTransitions; + /** Retrieves a list of Transaction objects. */ + public static TransactionCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Retrieves a list of Transaction objects. */ + public static TransactionCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/transactions"); + return ApiResource.requestCollection(url, params, TransactionCollection.class, options); + } + + /** Retrieves a list of Transaction objects. */ + public static TransactionCollection list(TransactionListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Retrieves a list of Transaction objects. */ + public static TransactionCollection list(TransactionListParams params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/transactions"); + return ApiResource.requestCollection(url, params, TransactionCollection.class, options); + } + /** Retrieves the details of an existing Transaction. */ public static Transaction retrieve(String id) throws StripeException { return retrieve(id, (Map) null, (RequestOptions) null); @@ -136,30 +164,7 @@ public static Transaction retrieve( ApiResource.RequestMethod.GET, url, params, Transaction.class, options); } - /** Retrieves a list of Transaction objects. */ - public static TransactionCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Retrieves a list of Transaction objects. */ - public static TransactionCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/transactions"); - return ApiResource.requestCollection(url, params, TransactionCollection.class, options); - } - - /** Retrieves a list of Transaction objects. */ - public static TransactionCollection list(TransactionListParams params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Retrieves a list of Transaction objects. */ - public static TransactionCollection list(TransactionListParams params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/transactions"); - return ApiResource.requestCollection(url, params, TransactionCollection.class, options); - } - + /** Change to a FinancialAccount's balance. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/treasury/TransactionEntry.java b/src/main/java/com/stripe/model/treasury/TransactionEntry.java index 972aea792af..ccb320515dd 100644 --- a/src/main/java/com/stripe/model/treasury/TransactionEntry.java +++ b/src/main/java/com/stripe/model/treasury/TransactionEntry.java @@ -16,6 +16,10 @@ import lombok.Getter; import lombok.Setter; +/** + * TransactionEntries represent individual units of money movements within a single Transaction. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -120,6 +124,31 @@ public void setTransactionObject(Transaction expandableObject) { this.transaction = new ExpandableField(expandableObject.getId(), expandableObject); } + /** Retrieves a list of TransactionEntry objects. */ + public static TransactionEntryCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Retrieves a list of TransactionEntry objects. */ + public static TransactionEntryCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/transaction_entries"); + return ApiResource.requestCollection(url, params, TransactionEntryCollection.class, options); + } + + /** Retrieves a list of TransactionEntry objects. */ + public static TransactionEntryCollection list(TransactionEntryListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Retrieves a list of TransactionEntry objects. */ + public static TransactionEntryCollection list( + TransactionEntryListParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/transaction_entries"); + return ApiResource.requestCollection(url, params, TransactionEntryCollection.class, options); + } + /** Retrieves a TransactionEntry object. */ public static TransactionEntry retrieve(String id) throws StripeException { return retrieve(id, (Map) null, (RequestOptions) null); @@ -156,31 +185,7 @@ public static TransactionEntry retrieve( ApiResource.RequestMethod.GET, url, params, TransactionEntry.class, options); } - /** Retrieves a list of TransactionEntry objects. */ - public static TransactionEntryCollection list(Map params) throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Retrieves a list of TransactionEntry objects. */ - public static TransactionEntryCollection list(Map params, RequestOptions options) - throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/transaction_entries"); - return ApiResource.requestCollection(url, params, TransactionEntryCollection.class, options); - } - - /** Retrieves a list of TransactionEntry objects. */ - public static TransactionEntryCollection list(TransactionEntryListParams params) - throws StripeException { - return list(params, (RequestOptions) null); - } - - /** Retrieves a list of TransactionEntry objects. */ - public static TransactionEntryCollection list( - TransactionEntryListParams params, RequestOptions options) throws StripeException { - String url = String.format("%s%s", Stripe.getApiBase(), "/v1/treasury/transaction_entries"); - return ApiResource.requestCollection(url, params, TransactionEntryCollection.class, options); - } - + /** Change to a FinancialAccount's balance. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index 73374ef0960..40914e9584e 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -88,8 +88,9 @@ public class AccountCreateParams extends ApiRequestParams { * href="https://stripe.com/docs/api#account_create_bank_account">bank account creation. * <br><br>By default, providing an external account sets it as the new default * external account for its currency, and deletes the old default if one exists. To add additional - * external accounts without replacing the existing default for the currency, use the bank account - * or card creation API. + * external accounts without replacing the existing default for the currency, use the bank account or card creation APIs. */ @SerializedName("external_account") String externalAccount; @@ -353,7 +354,8 @@ public Builder addAllExpand(List elements) { * <br><br>By default, providing an external account sets it as the new default * external account for its currency, and deletes the old default if one exists. To add * additional external accounts without replacing the existing default for the currency, use the - * bank account or card creation API. + * bank account or card creation APIs. */ public Builder setExternalAccount(String externalAccount) { this.externalAccount = externalAccount; diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index ab85dd68f0f..69c811333af 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -76,8 +76,9 @@ public class AccountUpdateParams extends ApiRequestParams { * href="https://stripe.com/docs/api#account_create_bank_account">bank account creation. * <br><br>By default, providing an external account sets it as the new default * external account for its currency, and deletes the old default if one exists. To add additional - * external accounts without replacing the existing default for the currency, use the bank account - * or card creation API. + * external accounts without replacing the existing default for the currency, use the bank account or card creation APIs. */ @SerializedName("external_account") Object externalAccount; @@ -337,7 +338,8 @@ public Builder addAllExpand(List elements) { * <br><br>By default, providing an external account sets it as the new default * external account for its currency, and deletes the old default if one exists. To add * additional external accounts without replacing the existing default for the currency, use the - * bank account or card creation API. + * bank account or card creation APIs. */ public Builder setExternalAccount(String externalAccount) { this.externalAccount = externalAccount; @@ -354,7 +356,8 @@ public Builder setExternalAccount(String externalAccount) { * <br><br>By default, providing an external account sets it as the new default * external account for its currency, and deletes the old default if one exists. To add * additional external accounts without replacing the existing default for the currency, use the - * bank account or card creation API. + * bank account or card creation APIs. */ public Builder setExternalAccount(EmptyParam externalAccount) { this.externalAccount = externalAccount; diff --git a/src/main/java/com/stripe/param/CustomerCashBalanceTransactionCollectionListParams.java b/src/main/java/com/stripe/param/CustomerCashBalanceTransactionCollectionListParams.java new file mode 100644 index 00000000000..fa998092639 --- /dev/null +++ b/src/main/java/com/stripe/param/CustomerCashBalanceTransactionCollectionListParams.java @@ -0,0 +1,170 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +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.Getter; + +@Getter +public class CustomerCashBalanceTransactionCollectionListParams extends ApiRequestParams { + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + @SerializedName("ending_before") + String endingBefore; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + @SerializedName("limit") + Long limit; + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, ending with + * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to + * fetch the next page of the list. + */ + @SerializedName("starting_after") + String startingAfter; + + private CustomerCashBalanceTransactionCollectionListParams( + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.startingAfter = startingAfter; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String endingBefore; + + private List expand; + + private Map extraParams; + + private Long limit; + + private String startingAfter; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerCashBalanceTransactionCollectionListParams build() { + return new CustomerCashBalanceTransactionCollectionListParams( + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); + } + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + public Builder setEndingBefore(String endingBefore) { + this.endingBefore = endingBefore; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * CustomerCashBalanceTransactionCollectionListParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * CustomerCashBalanceTransactionCollectionListParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * CustomerCashBalanceTransactionCollectionListParams#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 CustomerCashBalanceTransactionCollectionListParams#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 limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your + * place in the list. For instance, if you make a list request and receive 100 objects, ending + * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in + * order to fetch the next page of the list. + */ + public Builder setStartingAfter(String startingAfter) { + this.startingAfter = startingAfter; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/CustomerCashBalanceTransactionCollectionRetrieveParams.java b/src/main/java/com/stripe/param/CustomerCashBalanceTransactionCollectionRetrieveParams.java new file mode 100644 index 00000000000..1a6ec9a2868 --- /dev/null +++ b/src/main/java/com/stripe/param/CustomerCashBalanceTransactionCollectionRetrieveParams.java @@ -0,0 +1,102 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +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.Getter; + +@Getter +public class CustomerCashBalanceTransactionCollectionRetrieveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 CustomerCashBalanceTransactionCollectionRetrieveParams( + List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerCashBalanceTransactionCollectionRetrieveParams build() { + return new CustomerCashBalanceTransactionCollectionRetrieveParams( + this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * CustomerCashBalanceTransactionCollectionRetrieveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * CustomerCashBalanceTransactionCollectionRetrieveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * CustomerCashBalanceTransactionCollectionRetrieveParams#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 CustomerCashBalanceTransactionCollectionRetrieveParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index e83ef8dd67b..d0142bd6677 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -1839,72 +1839,6 @@ public Builder setNumber(String number) { } } - @Getter - public static class Token { - /** - * 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; - - @SerializedName("token") - String token; - - private Token(Map extraParams, String token) { - this.extraParams = extraParams; - this.token = token; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Map extraParams; - - private String token; - - /** Finalize and obtain parameter instance from this builder. */ - public Token build() { - return new Token(this.extraParams, this.token); - } - - /** - * 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.Token#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.Token#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 Builder setToken(String token) { - this.token = token; - return this; - } - } - } - @Getter public static class CustomerBalance { /** @@ -3399,6 +3333,72 @@ public enum Country implements ApiRequestParams.EnumParam { } } + @Getter + public static class Token { + /** + * 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; + + @SerializedName("token") + String token; + + private Token(Map extraParams, String token) { + this.extraParams = extraParams; + this.token = token; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String token; + + /** Finalize and obtain parameter instance from this builder. */ + public Token build() { + return new Token(this.extraParams, this.token); + } + + /** + * 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.Token#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.Token#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 Builder setToken(String token) { + this.token = token; + return this; + } + } + } + @Getter public static class UsBankAccount { /** Account holder type: individual or company. */ diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index 03703ab0817..f40e868275e 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -4692,6 +4692,13 @@ public static class Card { @SerializedName("moto") Boolean moto; + /** + * Selected network to process this SetupIntent on. Depends on the available networks of the + * card attached to the SetupIntent. Can be only set confirm-time. + */ + @SerializedName("network") + Network network; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and extraParams, MandateOptions mandateOptions, Boolean moto, + Network network, RequestThreeDSecure requestThreeDSecure) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; this.moto = moto; + this.network = network; this.requestThreeDSecure = requestThreeDSecure; } @@ -4728,12 +4737,18 @@ public static class Builder { private Boolean moto; + private Network network; + private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ public Card build() { return new Card( - this.extraParams, this.mandateOptions, this.moto, this.requestThreeDSecure); + this.extraParams, + this.mandateOptions, + this.moto, + this.network, + this.requestThreeDSecure); } /** @@ -4780,6 +4795,15 @@ public Builder setMoto(Boolean moto) { return this; } + /** + * Selected network to process this SetupIntent on. Depends on the available networks of the + * card attached to the SetupIntent. Can be only set confirm-time. + */ + public Builder setNetwork(Network network) { + this.network = network; + return this; + } + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and extraParams, MandateOptions mandateOptions, Boolean moto, + Network network, RequestThreeDSecure requestThreeDSecure) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; this.moto = moto; + this.network = network; this.requestThreeDSecure = requestThreeDSecure; } @@ -5003,12 +5012,18 @@ public static class Builder { private Boolean moto; + private Network network; + private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ public Card build() { return new Card( - this.extraParams, this.mandateOptions, this.moto, this.requestThreeDSecure); + this.extraParams, + this.mandateOptions, + this.moto, + this.network, + this.requestThreeDSecure); } /** @@ -5055,6 +5070,15 @@ public Builder setMoto(Boolean moto) { return this; } + /** + * Selected network to process this SetupIntent on. Depends on the available networks of the + * card attached to the SetupIntent. Can be only set confirm-time. + */ + public Builder setNetwork(Network network) { + this.network = network; + return this; + } + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and extraParams, MandateOptions mandateOptions, Boolean moto, + Network network, RequestThreeDSecure requestThreeDSecure) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; this.moto = moto; + this.network = network; this.requestThreeDSecure = requestThreeDSecure; } @@ -4720,12 +4729,18 @@ public static class Builder { private Boolean moto; + private Network network; + private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ public Card build() { return new Card( - this.extraParams, this.mandateOptions, this.moto, this.requestThreeDSecure); + this.extraParams, + this.mandateOptions, + this.moto, + this.network, + this.requestThreeDSecure); } /** @@ -4772,6 +4787,15 @@ public Builder setMoto(Boolean moto) { return this; } + /** + * Selected network to process this SetupIntent on. Depends on the available networks of the + * card attached to the SetupIntent. Can be only set confirm-time. + */ + public Builder setNetwork(Network network) { + this.network = network; + return this; + } + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and extraParams, MandateOptions mandateOptions, + Network network, RequestThreeDSecure requestThreeDSecure) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; + this.network = network; this.requestThreeDSecure = requestThreeDSecure; } @@ -2869,11 +2878,14 @@ public static class Builder { private MandateOptions mandateOptions; + private Network network; + private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ public Card build() { - return new Card(this.extraParams, this.mandateOptions, this.requestThreeDSecure); + return new Card( + this.extraParams, this.mandateOptions, this.network, this.requestThreeDSecure); } /** @@ -2912,6 +2924,15 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { return this; } + /** + * Selected network to process this Subscription on. Depends on the available networks of + * the card attached to the Subscription. Can be only set confirm-time. + */ + public Builder setNetwork(Network network) { + this.network = network; + return this; + } + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and extraParams, MandateOptions mandateOptions, + Network network, RequestThreeDSecure requestThreeDSecure) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; + this.network = network; this.requestThreeDSecure = requestThreeDSecure; } @@ -3168,11 +3177,14 @@ public static class Builder { private MandateOptions mandateOptions; + private Network network; + private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ public Card build() { - return new Card(this.extraParams, this.mandateOptions, this.requestThreeDSecure); + return new Card( + this.extraParams, this.mandateOptions, this.network, this.requestThreeDSecure); } /** @@ -3211,6 +3223,15 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { return this; } + /** + * Selected network to process this Subscription on. Depends on the available networks of + * the card attached to the Subscription. Can be only set confirm-time. + */ + public Builder setNetwork(Network network) { + this.network = network; + return this; + } + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and Date: Tue, 23 Aug 2022 17:03:48 -0400 Subject: [PATCH 03/24] Bump version to 21.3.0 --- CHANGELOG.md | 17 +++++++++++++++++ README.md | 6 +++--- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49afeae44fc..cad062fc781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## 21.3.0 - 2022-08-23 +* [#1422](https://github.com/stripe/stripe-java/pull/1422) API Updates + * Add support for new resource `CustomerCashBalanceTransaction` + * Remove support for value `paypal` from enums `OrderCreateParams.payment.settings.payment_method_types[]` and `OrderUpdateParams.payment.settings.payment_method_types[]` + * Add support for `currency` on `PaymentLink` + * Add support for `network` on `SetupIntentConfirmParams.payment_method_options.card`, `SetupIntentCreateParams.payment_method_options.card`, `SetupIntentUpdateParams.payment_method_options.card`, `Subscription.payment_settings.payment_method_options.card`, `SubscriptionCreateParams.payment_settings.payment_method_options.card`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.card` + * Change `TreasuryOutboundTransferCreateParams.destination_payment_method` to be optional + * Add support for new value `customer_cash_balance_transaction.created` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]` + * Change the return type of `Customer.fundCashBalance` test helper from `CustomerBalanceTransaction` to `CustomerCashBalanceTransaction`. + * This would generally be considered a breaking change, but we've worked with all existing users to migrate and are comfortable releasing this as a minor as it is solely a test helper method. This was essentially broken prior to this change. +* [#1425](https://github.com/stripe/stripe-java/pull/1425) Add beta readme.md section +* [#1423](https://github.com/stripe/stripe-java/pull/1423) chore: Remove unused variable from SearchPagingIteratorTest. +* [#1421](https://github.com/stripe/stripe-java/pull/1421) Add a support section to the readme +* [#1420](https://github.com/stripe/stripe-java/pull/1420) Fix outdated test comment +* [#1418](https://github.com/stripe/stripe-java/pull/1418) Fix latest JAR hyperlink and related tests +* [#1419](https://github.com/stripe/stripe-java/pull/1419) Fix makefile indentation and improve regex + ## 21.2.0 - 2022-08-11 * [#1416](https://github.com/stripe/stripe-java/pull/1416) API Updates * Add support for `payment_method_collection` on `Checkout.Session`, `CheckoutSessionCreateParams`, `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink` diff --git a/README.md b/README.md index 98b54203a93..53ac85829b9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:21.2.0" +implementation "com.stripe:stripe-java:21.3.0" ``` ### Maven users @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 21.2.0 + 21.3.0 ``` @@ -36,7 +36,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.2.0/stripe-java-21.2.0.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.3.0/stripe-java-21.3.0.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index b295a689e74..54d3ad73646 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -21.2.0 +21.3.0 diff --git a/gradle.properties b/gradle.properties index 460726ddc95..f7d2a0c8933 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=21.2.0 +VERSION_NAME=21.3.0 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index 78d62b3e521..8530980b7c7 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -13,7 +13,7 @@ public abstract class Stripe { public static final String CONNECT_API_BASE = "https://connect.stripe.com"; public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; - public static final String VERSION = "21.2.0"; + public static final String VERSION = "21.3.0"; public static volatile String apiKey; public static volatile String clientId; From 82c1f690b0c41265537adfcf3e1df3a90d1fd545 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Wed, 24 Aug 2022 08:58:19 -0700 Subject: [PATCH 04/24] Update README.md to clarify that API version can only be change in beta (#1427) * Update README.md * Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 53ac85829b9..552b9d6ebe1 100644 --- a/README.md +++ b/README.md @@ -244,12 +244,16 @@ Stripe has features in the beta phase that can be accessed via the beta version We would love for you to try these and share feedback with us before these features reach the stable phase. To install a beta version of stripe-java follow steps [installation steps above](#installation) using the beta library version. -> Note: There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific version. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version. +> **Note** +> There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific version. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version. We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version. If your beta feature requires a `Stripe-Version` header to be sent, use the `Stripe.stripeVersion` field to set it: +> **Note** +> The `stripeVersion` can only be set in beta versions of the library. + ```java Stripe.stripeVersion += "; feature_beta=v3"; ``` From 0ea53fccb9129b27e3347bb68b99fc56775f9813 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Wed, 24 Aug 2022 11:13:56 -0700 Subject: [PATCH 05/24] Show test coverage in README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 552b9d6ebe1..7e67cedda37 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Maven Central](https://img.shields.io/maven-central/v/com.stripe/stripe-java)](https://mvnrepository.com/artifact/com.stripe/stripe-java) [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) +[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master) The official [Stripe][stripe] Java client library. From 3b6693e0f53cec69eb8c0a7b064885225af1e35e Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com> Date: Fri, 26 Aug 2022 13:10:11 -0400 Subject: [PATCH 06/24] Codegen for openapi v186 (#1430) --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Charge.java | 15 +-- src/main/java/com/stripe/model/Invoice.java | 28 ++--- .../java/com/stripe/model/PaymentMethod.java | 15 +-- src/main/java/com/stripe/model/Quote.java | 7 ++ .../stripe/model/SubscriptionSchedule.java | 14 +++ .../model/billingportal/Configuration.java | 25 ++++ .../java/com/stripe/model/issuing/Card.java | 23 ++++ .../param/PaymentIntentConfirmParams.java | 3 + .../param/PaymentIntentCreateParams.java | 3 + .../param/PaymentIntentUpdateParams.java | 3 + .../param/PaymentMethodCreateParams.java | 3 + .../com/stripe/param/QuoteCreateParams.java | 27 +++- .../com/stripe/param/QuoteUpdateParams.java | 36 +++++- .../param/SetupIntentConfirmParams.java | 3 + .../stripe/param/SetupIntentCreateParams.java | 3 + .../stripe/param/SetupIntentUpdateParams.java | 3 + .../SubscriptionScheduleCreateParams.java | 42 +++++++ .../SubscriptionScheduleUpdateParams.java | 60 +++++++++ .../ConfigurationCreateParams.java | 102 +++++++++++++++ .../ConfigurationUpdateParams.java | 106 ++++++++++++++++ .../param/issuing/CardCreateParams.java | 119 +++++++++++++++++- 22 files changed, 605 insertions(+), 37 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c13f8f95980..2386eb39673 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v184 \ No newline at end of file +v186 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 26bbc83cb1d..1fb902e10f8 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -1998,13 +1998,14 @@ public static class Eps extends StripeObject { * austrian_anadi_bank_ag}, {@code bank_austria}, {@code bankhaus_carl_spangler}, {@code * bankhaus_schelhammer_und_schattera_ag}, {@code bawag_psk_ag}, {@code bks_bank_ag}, {@code * brull_kallmus_bank_ag}, {@code btv_vier_lander_bank}, {@code capital_bank_grawe_gruppe_ag}, - * {@code dolomitenbank}, {@code easybank_ag}, {@code erste_bank_und_sparkassen}, {@code - * hypo_alpeadriabank_international_ag}, {@code hypo_noe_lb_fur_niederosterreich_u_wien}, - * {@code hypo_oberosterreich_salzburg_steiermark}, {@code hypo_tirol_bank_ag}, {@code - * hypo_vorarlberg_bank_ag}, {@code hypo_bank_burgenland_aktiengesellschaft}, {@code - * marchfelder_bank}, {@code oberbank_ag}, {@code raiffeisen_bankengruppe_osterreich}, {@code - * schoellerbank_ag}, {@code sparda_bank_wien}, {@code volksbank_gruppe}, {@code - * volkskreditbank_ag}, or {@code vr_bank_braunau}. + * {@code deutsche_bank_ag}, {@code dolomitenbank}, {@code easybank_ag}, {@code + * erste_bank_und_sparkassen}, {@code hypo_alpeadriabank_international_ag}, {@code + * hypo_noe_lb_fur_niederosterreich_u_wien}, {@code hypo_oberosterreich_salzburg_steiermark}, + * {@code hypo_tirol_bank_ag}, {@code hypo_vorarlberg_bank_ag}, {@code + * hypo_bank_burgenland_aktiengesellschaft}, {@code marchfelder_bank}, {@code oberbank_ag}, + * {@code raiffeisen_bankengruppe_osterreich}, {@code schoellerbank_ag}, {@code + * sparda_bank_wien}, {@code volksbank_gruppe}, {@code volkskreditbank_ag}, or {@code + * vr_bank_braunau}. */ @SerializedName("bank") String bank; diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index 247b7f769d6..758c436e5fa 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -822,10 +822,9 @@ public void setDiscountObjects(List objs) { } /** - * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in - * all pending invoice items on that customer, including prorations. 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) throws StripeException { @@ -833,10 +832,9 @@ public static Invoice create(Map params) throws StripeException } /** - * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in - * all pending invoice items on that customer, including prorations. 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) @@ -846,10 +844,9 @@ public static Invoice create(Map params, RequestOptions options) } /** - * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in - * all pending invoice items on that customer, including prorations. 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 { @@ -857,10 +854,9 @@ public static Invoice create(InvoiceCreateParams params) throws StripeException } /** - * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in - * all pending invoice items on that customer, including prorations. 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) diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 9d9b727a7bb..7ed1c2fcfd6 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -967,13 +967,14 @@ public static class Eps extends StripeObject { * austrian_anadi_bank_ag}, {@code bank_austria}, {@code bankhaus_carl_spangler}, {@code * bankhaus_schelhammer_und_schattera_ag}, {@code bawag_psk_ag}, {@code bks_bank_ag}, {@code * brull_kallmus_bank_ag}, {@code btv_vier_lander_bank}, {@code capital_bank_grawe_gruppe_ag}, - * {@code dolomitenbank}, {@code easybank_ag}, {@code erste_bank_und_sparkassen}, {@code - * hypo_alpeadriabank_international_ag}, {@code hypo_noe_lb_fur_niederosterreich_u_wien}, {@code - * hypo_oberosterreich_salzburg_steiermark}, {@code hypo_tirol_bank_ag}, {@code - * hypo_vorarlberg_bank_ag}, {@code hypo_bank_burgenland_aktiengesellschaft}, {@code - * marchfelder_bank}, {@code oberbank_ag}, {@code raiffeisen_bankengruppe_osterreich}, {@code - * schoellerbank_ag}, {@code sparda_bank_wien}, {@code volksbank_gruppe}, {@code - * volkskreditbank_ag}, or {@code vr_bank_braunau}. + * {@code deutsche_bank_ag}, {@code dolomitenbank}, {@code easybank_ag}, {@code + * erste_bank_und_sparkassen}, {@code hypo_alpeadriabank_international_ag}, {@code + * hypo_noe_lb_fur_niederosterreich_u_wien}, {@code hypo_oberosterreich_salzburg_steiermark}, + * {@code hypo_tirol_bank_ag}, {@code hypo_vorarlberg_bank_ag}, {@code + * hypo_bank_burgenland_aktiengesellschaft}, {@code marchfelder_bank}, {@code oberbank_ag}, + * {@code raiffeisen_bankengruppe_osterreich}, {@code schoellerbank_ag}, {@code + * sparda_bank_wien}, {@code volksbank_gruppe}, {@code volkskreditbank_ag}, or {@code + * vr_bank_braunau}. */ @SerializedName("bank") String bank; diff --git a/src/main/java/com/stripe/model/Quote.java b/src/main/java/com/stripe/model/Quote.java index 1bbe0cbbde9..4cd196521ac 100644 --- a/src/main/java/com/stripe/model/Quote.java +++ b/src/main/java/com/stripe/model/Quote.java @@ -996,6 +996,13 @@ public static class StatusTransitions extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class SubscriptionData extends StripeObject { + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** * When creating a new subscription, the date of which the subscription schedule will start * after the quote is accepted. This date is ignored if it is in the past when the quote is diff --git a/src/main/java/com/stripe/model/SubscriptionSchedule.java b/src/main/java/com/stripe/model/SubscriptionSchedule.java index ce83096ef68..57475c2f778 100644 --- a/src/main/java/com/stripe/model/SubscriptionSchedule.java +++ b/src/main/java/com/stripe/model/SubscriptionSchedule.java @@ -638,6 +638,13 @@ public static class DefaultSettings extends StripeObject { @Setter(lombok.AccessLevel.NONE) ExpandableField defaultPaymentMethod; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** The subscription schedule's default invoice settings. */ @SerializedName("invoice_settings") InvoiceSettings invoiceSettings; @@ -779,6 +786,13 @@ public static class Phase extends StripeObject { @SerializedName("default_tax_rates") List defaultTaxRates; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** The end of this phase of the subscription schedule. */ @SerializedName("end_date") Long endDate; diff --git a/src/main/java/com/stripe/model/billingportal/Configuration.java b/src/main/java/com/stripe/model/billingportal/Configuration.java index 147017f5d88..2dbae34999d 100644 --- a/src/main/java/com/stripe/model/billingportal/Configuration.java +++ b/src/main/java/com/stripe/model/billingportal/Configuration.java @@ -75,6 +75,9 @@ public class Configuration 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 @@ -407,4 +410,26 @@ public static class Product extends StripeObject { } } } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LoginPage extends StripeObject { + /** + * If {@code true}, a shareable {@code url} will be generated that will take your customers to a + * hosted login page for the customer portal. + * + *

If {@code false}, the previously generated {@code url}, if any, will be deactivated. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * A shareable URL to the hosted portal login page. Your customers will be able to log in with + * their email + * and receive a link to their customer portal. + */ + @SerializedName("url") + String url; + } } diff --git a/src/main/java/com/stripe/model/issuing/Card.java b/src/main/java/com/stripe/model/issuing/Card.java index 935b15f7579..c3106bb5674 100644 --- a/src/main/java/com/stripe/model/issuing/Card.java +++ b/src/main/java/com/stripe/model/issuing/Card.java @@ -368,6 +368,10 @@ public static class Shipping extends StripeObject { @SerializedName("carrier") String carrier; + /** Additional information that may be required for clearing customs. */ + @SerializedName("customs") + Customs customs; + /** A unix timestamp representing a best estimate of when the card will be delivered. */ @SerializedName("eta") Long eta; @@ -376,6 +380,13 @@ public static class Shipping extends StripeObject { @SerializedName("name") String name; + /** + * The phone number of the receiver of the bulk shipment. This phone number will be provided to + * the shipping company, who might use it to contact the receiver in case of delivery issues. + */ + @SerializedName("phone_number") + String phoneNumber; + /** * Shipment service, such as {@code standard} or {@code express}. * @@ -411,6 +422,18 @@ public static class Shipping extends StripeObject { */ @SerializedName("type") String type; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Customs extends StripeObject { + /** + * A registration number used for customs in Europe. See https://www.gov.uk/eori and + * https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en. + */ + @SerializedName("eori_number") + String eoriNumber; + } } @Getter diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index eb4c13d9942..0ccf791e932 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -2628,6 +2628,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("capital_bank_grawe_gruppe_ag") CAPITAL_BANK_GRAWE_GRUPPE_AG("capital_bank_grawe_gruppe_ag"), + @SerializedName("deutsche_bank_ag") + DEUTSCHE_BANK_AG("deutsche_bank_ag"), + @SerializedName("dolomitenbank") DOLOMITENBANK("dolomitenbank"), diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index e18a8ecc953..acfbd55c084 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -3077,6 +3077,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("capital_bank_grawe_gruppe_ag") CAPITAL_BANK_GRAWE_GRUPPE_AG("capital_bank_grawe_gruppe_ag"), + @SerializedName("deutsche_bank_ag") + DEUTSCHE_BANK_AG("deutsche_bank_ag"), + @SerializedName("dolomitenbank") DOLOMITENBANK("dolomitenbank"), diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index b7e24da60ef..5d6a6f463cb 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -2615,6 +2615,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("capital_bank_grawe_gruppe_ag") CAPITAL_BANK_GRAWE_GRUPPE_AG("capital_bank_grawe_gruppe_ag"), + @SerializedName("deutsche_bank_ag") + DEUTSCHE_BANK_AG("deutsche_bank_ag"), + @SerializedName("dolomitenbank") DOLOMITENBANK("dolomitenbank"), diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index d0142bd6677..cf222249b18 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -1993,6 +1993,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("capital_bank_grawe_gruppe_ag") CAPITAL_BANK_GRAWE_GRUPPE_AG("capital_bank_grawe_gruppe_ag"), + @SerializedName("deutsche_bank_ag") + DEUTSCHE_BANK_AG("deutsche_bank_ag"), + @SerializedName("dolomitenbank") DOLOMITENBANK("dolomitenbank"), diff --git a/src/main/java/com/stripe/param/QuoteCreateParams.java b/src/main/java/com/stripe/param/QuoteCreateParams.java index 72b18fb7aa7..8790bf4aece 100644 --- a/src/main/java/com/stripe/param/QuoteCreateParams.java +++ b/src/main/java/com/stripe/param/QuoteCreateParams.java @@ -1423,6 +1423,13 @@ public enum TaxBehavior implements ApiRequestParams.EnumParam { @Getter public static class SubscriptionData { + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** * When creating a new subscription, the date of which the subscription schedule will start * after the quote is accepted. When updating a subscription, the date of which the subscription @@ -1450,7 +1457,11 @@ public static class SubscriptionData { Object trialPeriodDays; private SubscriptionData( - Object effectiveDate, Map extraParams, Object trialPeriodDays) { + String description, + Object effectiveDate, + Map extraParams, + Object trialPeriodDays) { + this.description = description; this.effectiveDate = effectiveDate; this.extraParams = extraParams; this.trialPeriodDays = trialPeriodDays; @@ -1461,6 +1472,8 @@ public static Builder builder() { } public static class Builder { + private String description; + private Object effectiveDate; private Map extraParams; @@ -1469,7 +1482,17 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionData build() { - return new SubscriptionData(this.effectiveDate, this.extraParams, this.trialPeriodDays); + return new SubscriptionData( + this.description, this.effectiveDate, this.extraParams, this.trialPeriodDays); + } + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + return this; } /** diff --git a/src/main/java/com/stripe/param/QuoteUpdateParams.java b/src/main/java/com/stripe/param/QuoteUpdateParams.java index 52b437b12c4..a31fd065d26 100644 --- a/src/main/java/com/stripe/param/QuoteUpdateParams.java +++ b/src/main/java/com/stripe/param/QuoteUpdateParams.java @@ -1366,6 +1366,13 @@ public enum TaxBehavior implements ApiRequestParams.EnumParam { @Getter public static class SubscriptionData { + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + Object description; + /** * When creating a new subscription, the date of which the subscription schedule will start * after the quote is accepted. When updating a subscription, the date of which the subscription @@ -1393,7 +1400,11 @@ public static class SubscriptionData { Object trialPeriodDays; private SubscriptionData( - Object effectiveDate, Map extraParams, Object trialPeriodDays) { + Object description, + Object effectiveDate, + Map extraParams, + Object trialPeriodDays) { + this.description = description; this.effectiveDate = effectiveDate; this.extraParams = extraParams; this.trialPeriodDays = trialPeriodDays; @@ -1404,6 +1415,8 @@ public static Builder builder() { } public static class Builder { + private Object description; + private Object effectiveDate; private Map extraParams; @@ -1412,7 +1425,26 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionData build() { - return new SubscriptionData(this.effectiveDate, this.extraParams, this.trialPeriodDays); + return new SubscriptionData( + this.description, this.effectiveDate, this.extraParams, this.trialPeriodDays); + } + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; } /** diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index f40e868275e..c50ab79b204 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -2361,6 +2361,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("capital_bank_grawe_gruppe_ag") CAPITAL_BANK_GRAWE_GRUPPE_AG("capital_bank_grawe_gruppe_ag"), + @SerializedName("deutsche_bank_ag") + DEUTSCHE_BANK_AG("deutsche_bank_ag"), + @SerializedName("dolomitenbank") DOLOMITENBANK("dolomitenbank"), diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index 28f574b7f28..7d78bad926c 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -2636,6 +2636,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("capital_bank_grawe_gruppe_ag") CAPITAL_BANK_GRAWE_GRUPPE_AG("capital_bank_grawe_gruppe_ag"), + @SerializedName("deutsche_bank_ag") + DEUTSCHE_BANK_AG("deutsche_bank_ag"), + @SerializedName("dolomitenbank") DOLOMITENBANK("dolomitenbank"), diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index e1dc506001e..3e9e597802d 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -2301,6 +2301,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("capital_bank_grawe_gruppe_ag") CAPITAL_BANK_GRAWE_GRUPPE_AG("capital_bank_grawe_gruppe_ag"), + @SerializedName("deutsche_bank_ag") + DEUTSCHE_BANK_AG("deutsche_bank_ag"), + @SerializedName("dolomitenbank") DOLOMITENBANK("dolomitenbank"), diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java index d6edd0a7872..00268ffe650 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java @@ -371,6 +371,13 @@ public static class DefaultSettings { @SerializedName("default_payment_method") String defaultPaymentMethod; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** * 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 @@ -398,6 +405,7 @@ private DefaultSettings( Object billingThresholds, CollectionMethod collectionMethod, String defaultPaymentMethod, + String description, Map extraParams, InvoiceSettings invoiceSettings, Object transferData) { @@ -407,6 +415,7 @@ private DefaultSettings( this.billingThresholds = billingThresholds; this.collectionMethod = collectionMethod; this.defaultPaymentMethod = defaultPaymentMethod; + this.description = description; this.extraParams = extraParams; this.invoiceSettings = invoiceSettings; this.transferData = transferData; @@ -429,6 +438,8 @@ public static class Builder { private String defaultPaymentMethod; + private String description; + private Map extraParams; private InvoiceSettings invoiceSettings; @@ -444,6 +455,7 @@ public DefaultSettings build() { this.billingThresholds, this.collectionMethod, this.defaultPaymentMethod, + this.description, this.extraParams, this.invoiceSettings, this.transferData); @@ -519,6 +531,15 @@ public Builder setDefaultPaymentMethod(String defaultPaymentMethod) { return this; } + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + 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 @@ -1031,6 +1052,13 @@ public static class Phase { @SerializedName("default_tax_rates") Object defaultTaxRates; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** * The date at which this phase of the subscription schedule ends. If set, {@code iterations} * must not be set. @@ -1119,6 +1147,7 @@ private Phase( String currency, String defaultPaymentMethod, Object defaultTaxRates, + String description, Long endDate, Map extraParams, InvoiceSettings invoiceSettings, @@ -1139,6 +1168,7 @@ private Phase( this.currency = currency; this.defaultPaymentMethod = defaultPaymentMethod; this.defaultTaxRates = defaultTaxRates; + this.description = description; this.endDate = endDate; this.extraParams = extraParams; this.invoiceSettings = invoiceSettings; @@ -1176,6 +1206,8 @@ public static class Builder { private Object defaultTaxRates; + private String description; + private Long endDate; private Map extraParams; @@ -1209,6 +1241,7 @@ public Phase build() { this.currency, this.defaultPaymentMethod, this.defaultTaxRates, + this.description, this.endDate, this.extraParams, this.invoiceSettings, @@ -1387,6 +1420,15 @@ public Builder setDefaultTaxRates(List defaultTaxRates) { return this; } + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + /** * The date at which this phase of the subscription schedule ends. If set, {@code iterations} * must not be set. diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java index faa7a409122..8f598340f24 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java @@ -318,6 +318,13 @@ public static class DefaultSettings { @SerializedName("default_payment_method") Object defaultPaymentMethod; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + Object description; + /** * 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 @@ -345,6 +352,7 @@ private DefaultSettings( Object billingThresholds, CollectionMethod collectionMethod, Object defaultPaymentMethod, + Object description, Map extraParams, InvoiceSettings invoiceSettings, Object transferData) { @@ -354,6 +362,7 @@ private DefaultSettings( this.billingThresholds = billingThresholds; this.collectionMethod = collectionMethod; this.defaultPaymentMethod = defaultPaymentMethod; + this.description = description; this.extraParams = extraParams; this.invoiceSettings = invoiceSettings; this.transferData = transferData; @@ -376,6 +385,8 @@ public static class Builder { private Object defaultPaymentMethod; + private Object description; + private Map extraParams; private InvoiceSettings invoiceSettings; @@ -391,6 +402,7 @@ public DefaultSettings build() { this.billingThresholds, this.collectionMethod, this.defaultPaymentMethod, + this.description, this.extraParams, this.invoiceSettings, this.transferData); @@ -476,6 +488,24 @@ public Builder setDefaultPaymentMethod(EmptyParam defaultPaymentMethod) { return this; } + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + 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 @@ -994,6 +1024,13 @@ public static class Phase { @SerializedName("default_tax_rates") Object defaultTaxRates; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + Object description; + /** * The date at which this phase of the subscription schedule ends. If set, {@code iterations} * must not be set. @@ -1089,6 +1126,7 @@ private Phase( Object currency, Object defaultPaymentMethod, Object defaultTaxRates, + Object description, Object endDate, Map extraParams, InvoiceSettings invoiceSettings, @@ -1110,6 +1148,7 @@ private Phase( this.currency = currency; this.defaultPaymentMethod = defaultPaymentMethod; this.defaultTaxRates = defaultTaxRates; + this.description = description; this.endDate = endDate; this.extraParams = extraParams; this.invoiceSettings = invoiceSettings; @@ -1148,6 +1187,8 @@ public static class Builder { private Object defaultTaxRates; + private Object description; + private Object endDate; private Map extraParams; @@ -1183,6 +1224,7 @@ public Phase build() { this.currency, this.defaultPaymentMethod, this.defaultTaxRates, + this.description, this.endDate, this.extraParams, this.invoiceSettings, @@ -1388,6 +1430,24 @@ public Builder setDefaultTaxRates(List defaultTaxRates) { return this; } + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + /** * The date at which this phase of the subscription schedule ends. If set, {@code iterations} * must not be set. diff --git a/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java b/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java index 14620b3519f..10dc3fda731 100644 --- a/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java @@ -42,6 +42,14 @@ public class ConfigurationCreateParams extends ApiRequestParams { @SerializedName("features") Features features; + /** + * The hosted login page for this configuration. Learn more about the portal login page in our integration + * docs. + */ + @SerializedName("login_page") + LoginPage loginPage; + /** * 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 @@ -57,12 +65,14 @@ private ConfigurationCreateParams( List expand, Map extraParams, Features features, + LoginPage loginPage, Map metadata) { this.businessProfile = businessProfile; this.defaultReturnUrl = defaultReturnUrl; this.expand = expand; this.extraParams = extraParams; this.features = features; + this.loginPage = loginPage; this.metadata = metadata; } @@ -81,6 +91,8 @@ public static class Builder { private Features features; + private LoginPage loginPage; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ @@ -91,6 +103,7 @@ public ConfigurationCreateParams build() { this.expand, this.extraParams, this.features, + this.loginPage, this.metadata); } @@ -180,6 +193,17 @@ public Builder setFeatures(Features features) { return this; } + /** + * The hosted login page for this configuration. Learn more about the portal login page in our + * integration + * docs. + */ + public Builder setLoginPage(LoginPage loginPage) { + this.loginPage = loginPage; + 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 @@ -1519,4 +1543,82 @@ public enum ProrationBehavior implements ApiRequestParams.EnumParam { } } } + + @Getter + public static class LoginPage { + /** + * Set to {@code true} to generate a shareable URL {@code + * login_page.url} that will take your customers to a hosted login page for the customer + * portal. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * 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 LoginPage(Boolean enabled, Map extraParams) { + this.enabled = enabled; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public LoginPage build() { + return new LoginPage(this.enabled, this.extraParams); + } + + /** + * Set to {@code true} to generate a shareable URL {@code + * login_page.url} that will take your customers to a hosted login page for the customer + * portal. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + 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 + * ConfigurationCreateParams.LoginPage#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 ConfigurationCreateParams.LoginPage#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } } diff --git a/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java b/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java index 0509bf482b5..a947cb601f9 100644 --- a/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java @@ -46,6 +46,14 @@ public class ConfigurationUpdateParams extends ApiRequestParams { @SerializedName("features") Features features; + /** + * The hosted login page for this configuration. Learn more about the portal login page in our integration + * docs. + */ + @SerializedName("login_page") + LoginPage loginPage; + /** * 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 @@ -62,6 +70,7 @@ private ConfigurationUpdateParams( List expand, Map extraParams, Features features, + LoginPage loginPage, Object metadata) { this.active = active; this.businessProfile = businessProfile; @@ -69,6 +78,7 @@ private ConfigurationUpdateParams( this.expand = expand; this.extraParams = extraParams; this.features = features; + this.loginPage = loginPage; this.metadata = metadata; } @@ -89,6 +99,8 @@ public static class Builder { private Features features; + private LoginPage loginPage; + private Object metadata; /** Finalize and obtain parameter instance from this builder. */ @@ -100,6 +112,7 @@ public ConfigurationUpdateParams build() { this.expand, this.extraParams, this.features, + this.loginPage, this.metadata); } @@ -195,6 +208,17 @@ public Builder setFeatures(Features features) { return this; } + /** + * The hosted login page for this configuration. Learn more about the portal login page in our + * integration + * docs. + */ + public Builder setLoginPage(LoginPage loginPage) { + this.loginPage = loginPage; + 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 @@ -1582,4 +1606,86 @@ public enum ProrationBehavior implements ApiRequestParams.EnumParam { } } } + + @Getter + public static class LoginPage { + /** + * Set to {@code true} to generate a shareable URL {@code + * login_page.url} that will take your customers to a hosted login page for the customer + * portal. + * + *

Set to {@code false} to deactivate the {@code login_page.url}. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * 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 LoginPage(Boolean enabled, Map extraParams) { + this.enabled = enabled; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public LoginPage build() { + return new LoginPage(this.enabled, this.extraParams); + } + + /** + * Set to {@code true} to generate a shareable URL {@code + * login_page.url} that will take your customers to a hosted login page for the customer + * portal. + * + *

Set to {@code false} to deactivate the {@code login_page.url}. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + 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 + * ConfigurationUpdateParams.LoginPage#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 ConfigurationUpdateParams.LoginPage#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } } diff --git a/src/main/java/com/stripe/param/issuing/CardCreateParams.java b/src/main/java/com/stripe/param/issuing/CardCreateParams.java index f21c3768ae1..ff7f5e40a2f 100644 --- a/src/main/java/com/stripe/param/issuing/CardCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardCreateParams.java @@ -298,6 +298,10 @@ public static class Shipping { @SerializedName("address") Address address; + /** Customs information for the shipment. */ + @SerializedName("customs") + Customs customs; + /** * 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 @@ -311,6 +315,10 @@ public static class Shipping { @SerializedName("name") String name; + /** Phone number of the recipient of the shipment. */ + @SerializedName("phone_number") + String phoneNumber; + /** Shipment service. */ @SerializedName("service") Service service; @@ -320,10 +328,18 @@ public static class Shipping { Type type; private Shipping( - Address address, Map extraParams, String name, Service service, Type type) { + Address address, + Customs customs, + Map extraParams, + String name, + String phoneNumber, + Service service, + Type type) { this.address = address; + this.customs = customs; this.extraParams = extraParams; this.name = name; + this.phoneNumber = phoneNumber; this.service = service; this.type = type; } @@ -335,17 +351,28 @@ public static Builder builder() { public static class Builder { private Address address; + private Customs customs; + private Map extraParams; private String name; + private String phoneNumber; + private Service service; private Type type; /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { - return new Shipping(this.address, this.extraParams, this.name, this.service, this.type); + return new Shipping( + this.address, + this.customs, + this.extraParams, + this.name, + this.phoneNumber, + this.service, + this.type); } /** The address that the card is shipped to. */ @@ -354,6 +381,12 @@ public Builder setAddress(Address address) { return this; } + /** Customs information for the shipment. */ + public Builder setCustoms(Customs customs) { + this.customs = customs; + 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 @@ -386,6 +419,12 @@ public Builder setName(String name) { return this; } + /** Phone number of the recipient of the shipment. */ + public Builder setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + /** Shipment service. */ public Builder setService(Service service) { this.service = service; @@ -554,6 +593,82 @@ public Builder setState(String state) { } } + @Getter + public static class Customs { + /** + * The Economic Operators Registration and Identification (EORI) number to use for Customs. + * Required for bulk shipments to Europe. + */ + @SerializedName("eori_number") + String eoriNumber; + + /** + * 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 Customs(String eoriNumber, Map extraParams) { + this.eoriNumber = eoriNumber; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String eoriNumber; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Customs build() { + return new Customs(this.eoriNumber, this.extraParams); + } + + /** + * The Economic Operators Registration and Identification (EORI) number to use for Customs. + * Required for bulk shipments to Europe. + */ + public Builder setEoriNumber(String eoriNumber) { + this.eoriNumber = eoriNumber; + 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.Shipping.Customs#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.Shipping.Customs#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 Service implements ApiRequestParams.EnumParam { @SerializedName("express") EXPRESS("express"), From 09d9cfb28b234c7f1280f627782f5d069da43d6f Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy Date: Fri, 26 Aug 2022 13:23:53 -0400 Subject: [PATCH 07/24] Bump version to 21.4.0 --- CHANGELOG.md | 9 +++++++++ README.md | 6 +++--- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cad062fc781..f8c15a26b2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 21.4.0 - 2022-08-26 +* [#1430](https://github.com/stripe/stripe-java/pull/1430) API Updates + * Add support for `login_page` on `BillingPortal.Configuration`, `BillingPortalConfigurationCreateParams`, and `BillingPortalConfigurationUpdateParams` + * Add support for `customs` and `phone_number` on `Issuing.Card.shipping` and `IssuingCardCreateParams.shipping` + * Add support for new value `deutsche_bank_ag` on enums `PaymentIntentConfirmParams.payment_method_data.eps.bank`, `PaymentIntentCreateParams.payment_method_data.eps.bank`, `PaymentIntentUpdateParams.payment_method_data.eps.bank`, `PaymentMethodCreateParams.eps.bank`, `SetupIntentConfirmParams.payment_method_data.eps.bank`, `SetupIntentCreateParams.payment_method_data.eps.bank`, and `SetupIntentUpdateParams.payment_method_data.eps.bank` + * Add support for `description` on `Quote.subscription_data`, `QuoteCreateParams.subscription_data`, `QuoteUpdateParams.subscription_data`, `SubscriptionSchedule.default_settings`, `SubscriptionSchedule.phases[]`, `SubscriptionScheduleCreateParams.default_settings`, `SubscriptionScheduleCreateParams.phases[]`, `SubscriptionScheduleUpdateParams.default_settings`, and `SubscriptionScheduleUpdateParams.phases[]` +* [#1428](https://github.com/stripe/stripe-java/pull/1428) Show test coverage in README +* [#1427](https://github.com/stripe/stripe-java/pull/1427) Update README.md to clarify that API version can only be change in beta + ## 21.3.0 - 2022-08-23 * [#1422](https://github.com/stripe/stripe-java/pull/1422) API Updates * Add support for new resource `CustomerCashBalanceTransaction` diff --git a/README.md b/README.md index 7e67cedda37..e54a426e565 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:21.3.0" +implementation "com.stripe:stripe-java:21.4.0" ``` ### Maven users @@ -29,7 +29,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 21.3.0 + 21.4.0 ``` @@ -37,7 +37,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.3.0/stripe-java-21.3.0.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.4.0/stripe-java-21.4.0.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index 54d3ad73646..8bd85214a48 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -21.3.0 +21.4.0 diff --git a/gradle.properties b/gradle.properties index f7d2a0c8933..58d6e695dbe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=21.3.0 +VERSION_NAME=21.4.0 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index 8530980b7c7..7ae7f22f07c 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -13,7 +13,7 @@ public abstract class Stripe { public static final String CONNECT_API_BASE = "https://connect.stripe.com"; public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; - public static final String VERSION = "21.3.0"; + public static final String VERSION = "21.4.0"; public static volatile String apiKey; public static volatile String clientId; From 0e530c56e5784af41061a18ca7f6e2651ff6bd9d Mon Sep 17 00:00:00 2001 From: Annie Li Date: Fri, 26 Aug 2022 12:52:31 -0700 Subject: [PATCH 08/24] Update coveralls to only run for one java version --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 490cceec878..152824f3776 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,6 +99,7 @@ jobs: - name: Send code coverage report to coveralls.io run: ./gradlew jacocoTestReport coveralls + if: matrix.java-version == '18' env: CI_NAME: github-actions COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} From 3906d2c3aff4229ba6ba559e043a8175faf90556 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Mon, 29 Aug 2022 14:58:49 -0700 Subject: [PATCH 09/24] Update badge to static format, add command in Makefile to update version in shields.io link accordingly --- Makefile | 1 + README.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 315ccc3d064..83ff0c84c5b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ .PHONY: update-version codegen-format update-version: @echo "$(VERSION)" > VERSION + @perl -pi -e 's|badge/maven--central-v[.\d\-\w]+-blue|badge/maven--central-v$(VERSION)-blue|' README.md @perl -pi -e 's|https:\/\/search\.maven\.org\/remotecontent\?filepath=com\/stripe\/stripe-java\/[.\d\-\w]+\/stripe-java-[.\d\-\w]+.jar|https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/$(VERSION)/stripe-java-$(VERSION).jar|' README.md @perl -pi -e 's|implementation "com\.stripe:stripe-java:[.\d\-\w]+"|implementation "com.stripe:stripe-java:$(VERSION)"|' README.md @perl -pi -e 's|[.\d\-\w]+<\/version>|$(VERSION)|' README.md diff --git a/README.md b/README.md index e54a426e565..7c41d520b40 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stripe Java client library -[![Maven Central](https://img.shields.io/maven-central/v/com.stripe/stripe-java)](https://mvnrepository.com/artifact/com.stripe/stripe-java) +[![Maven Central](https://img.shields.io/badge/maven--central-v21.4.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master) @@ -253,7 +253,7 @@ We highly recommend keeping an eye on when the beta feature you are interested i If your beta feature requires a `Stripe-Version` header to be sent, use the `Stripe.stripeVersion` field to set it: > **Note** -> The `stripeVersion` can only be set in beta versions of the library. +> The `stripeVersion` can only be set in beta versions of the library. ```java Stripe.stripeVersion += "; feature_beta=v3"; From 8ea9505a0682b7f04a2777a79399c6c34f7d4835 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Mon, 29 Aug 2022 15:13:34 -0700 Subject: [PATCH 10/24] Update docuemntation test --- src/test/java/com/stripe/DocumentationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/stripe/DocumentationTest.java b/src/test/java/com/stripe/DocumentationTest.java index 1a47c78d1bd..ac0efba4c7d 100644 --- a/src/test/java/com/stripe/DocumentationTest.java +++ b/src/test/java/com/stripe/DocumentationTest.java @@ -90,7 +90,7 @@ public void testReadMeContainsStripeVersionThatMatches() throws IOException { try (final BufferedReader reader = new BufferedReader( new InputStreamReader(new FileInputStream(readmeFile), StandardCharsets.UTF_8))) { - final int expectedMentionsOfVersion = 3; + final int expectedMentionsOfVersion = 4; // Currently three places mention the Stripe version: the latest Maven JAR hyperlink, the // sample pom, and gradle files. final List mentioningLines = new ArrayList(); From 879731c286c530b3d8889dce0ef8451143f5313c Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Wed, 31 Aug 2022 08:35:50 -0700 Subject: [PATCH 11/24] Codegen for openapi v188 (#1433) --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Charge.java | 3 +- .../java/com/stripe/model/PaymentLink.java | 7 ++++ .../param/CustomerFundCashBalanceParams.java | 33 +++++++++++-------- .../param/PaymentIntentConfirmParams.java | 24 ++++++++++++++ .../param/PaymentIntentCreateParams.java | 24 ++++++++++++++ .../param/PaymentIntentUpdateParams.java | 24 ++++++++++++++ .../stripe/param/PaymentLinkCreateParams.java | 24 ++++++++++++-- .../param/checkout/SessionCreateParams.java | 6 ++-- 9 files changed, 126 insertions(+), 21 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 2386eb39673..169d5f25686 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v186 \ No newline at end of file +v188 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 1fb902e10f8..62e7ef26f9d 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -2351,7 +2351,8 @@ public static class Klarna extends StripeObject { * fi-FI}, {@code sv-FI}, {@code en-FI}, {@code en-GB}, {@code en-IE}, {@code it-IT}, {@code * en-IT}, {@code nl-NL}, {@code en-NL}, {@code nb-NO}, {@code en-NO}, {@code sv-SE}, {@code * en-SE}, {@code en-US}, {@code es-US}, {@code fr-FR}, {@code en-FR}, {@code en-AU}, {@code - * en-NZ}, {@code en-CA}, or {@code fr-CA} + * en-NZ}, {@code en-CA}, {@code fr-CA}, {@code pl-PL}, {@code en-PL}, {@code pt-PT}, {@code + * en-PT}, {@code de-CH}, {@code fr-CH}, {@code it-CH}, or {@code en-CH} */ @SerializedName("preferred_locale") String preferredLocale; diff --git a/src/main/java/com/stripe/model/PaymentLink.java b/src/main/java/com/stripe/model/PaymentLink.java index 50d86c74f38..29bdb848ed6 100644 --- a/src/main/java/com/stripe/model/PaymentLink.java +++ b/src/main/java/com/stripe/model/PaymentLink.java @@ -540,6 +540,13 @@ public void setShippingRateObject(ShippingRate expandableObject) { @Setter @EqualsAndHashCode(callSuper = false) public static class SubscriptionData extends StripeObject { + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** * Integer representing the number of trial period days before the customer is charged for the * first time. diff --git a/src/main/java/com/stripe/param/CustomerFundCashBalanceParams.java b/src/main/java/com/stripe/param/CustomerFundCashBalanceParams.java index 61b80e95f67..96f8f0e85f9 100644 --- a/src/main/java/com/stripe/param/CustomerFundCashBalanceParams.java +++ b/src/main/java/com/stripe/param/CustomerFundCashBalanceParams.java @@ -12,13 +12,9 @@ @Getter public class CustomerFundCashBalanceParams extends ApiRequestParams { /** - * Amount intended to be collected by this PaymentIntent. A positive integer representing how much - * to charge in the smallest currency - * unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The - * minimum amount is $0.50 US or equivalent in - * charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 - * for a USD charge of $999,999.99). + * Amount to be used for this test cash balance transaction. A positive integer representing how + * much to fund in the smallest currency + * unit (e.g., 100 cents to fund $1.00 or 100 to fund ¥100, a zero-decimal currency). */ @SerializedName("amount") Long amount; @@ -43,6 +39,12 @@ public class CustomerFundCashBalanceParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * A description of the test funding. This simulates free-text references supplied by customers + * when making bank transfers to their cash balance. You can use this to test how Stripe's reconciliation + * algorithm applies to different user inputs. + */ @SerializedName("reference") String reference; @@ -81,13 +83,10 @@ public CustomerFundCashBalanceParams build() { } /** - * Amount intended to be collected by this PaymentIntent. A positive integer representing how - * much to charge in the smallest - * currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal - * currency). The minimum amount is $0.50 US or equivalent in - * charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 - * for a USD charge of $999,999.99). + * Amount to be used for this test cash balance transaction. A positive integer representing how + * much to fund in the smallest + * currency unit (e.g., 100 cents to fund $1.00 or 100 to fund ¥100, a zero-decimal + * currency). */ public Builder setAmount(Long amount) { this.amount = amount; @@ -156,6 +155,12 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * A description of the test funding. This simulates free-text references supplied by customers + * when making bank transfers to their cash balance. You can use this to test how Stripe's reconciliation + * algorithm applies to different user inputs. + */ public Builder setReference(String reference) { this.reference = reference; return this; diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 0ccf791e932..23364d2c3fa 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -9343,6 +9343,9 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("de-AT") DE_AT("de-AT"), + @SerializedName("de-CH") + DE_CH("de-CH"), + @SerializedName("de-DE") DE_DE("de-DE"), @@ -9358,6 +9361,9 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("en-CA") EN_CA("en-CA"), + @SerializedName("en-CH") + EN_CH("en-CH"), + @SerializedName("en-DE") EN_DE("en-DE"), @@ -9391,6 +9397,12 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("en-NZ") EN_NZ("en-NZ"), + @SerializedName("en-PL") + EN_PL("en-PL"), + + @SerializedName("en-PT") + EN_PT("en-PT"), + @SerializedName("en-SE") EN_SE("en-SE"), @@ -9412,9 +9424,15 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("fr-CA") FR_CA("fr-CA"), + @SerializedName("fr-CH") + FR_CH("fr-CH"), + @SerializedName("fr-FR") FR_FR("fr-FR"), + @SerializedName("it-CH") + IT_CH("it-CH"), + @SerializedName("it-IT") IT_IT("it-IT"), @@ -9427,6 +9445,12 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("nl-NL") NL_NL("nl-NL"), + @SerializedName("pl-PL") + PL_PL("pl-PL"), + + @SerializedName("pt-PT") + PT_PT("pt-PT"), + @SerializedName("sv-FI") SV_FI("sv-FI"), diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index acfbd55c084..32e8067c1a1 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -9792,6 +9792,9 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("de-AT") DE_AT("de-AT"), + @SerializedName("de-CH") + DE_CH("de-CH"), + @SerializedName("de-DE") DE_DE("de-DE"), @@ -9807,6 +9810,9 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("en-CA") EN_CA("en-CA"), + @SerializedName("en-CH") + EN_CH("en-CH"), + @SerializedName("en-DE") EN_DE("en-DE"), @@ -9840,6 +9846,12 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("en-NZ") EN_NZ("en-NZ"), + @SerializedName("en-PL") + EN_PL("en-PL"), + + @SerializedName("en-PT") + EN_PT("en-PT"), + @SerializedName("en-SE") EN_SE("en-SE"), @@ -9861,9 +9873,15 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("fr-CA") FR_CA("fr-CA"), + @SerializedName("fr-CH") + FR_CH("fr-CH"), + @SerializedName("fr-FR") FR_FR("fr-FR"), + @SerializedName("it-CH") + IT_CH("it-CH"), + @SerializedName("it-IT") IT_IT("it-IT"), @@ -9876,6 +9894,12 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("nl-NL") NL_NL("nl-NL"), + @SerializedName("pl-PL") + PL_PL("pl-PL"), + + @SerializedName("pt-PT") + PT_PT("pt-PT"), + @SerializedName("sv-FI") SV_FI("sv-FI"), diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 5d6a6f463cb..91b6018c78f 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -9427,6 +9427,9 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("de-AT") DE_AT("de-AT"), + @SerializedName("de-CH") + DE_CH("de-CH"), + @SerializedName("de-DE") DE_DE("de-DE"), @@ -9442,6 +9445,9 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("en-CA") EN_CA("en-CA"), + @SerializedName("en-CH") + EN_CH("en-CH"), + @SerializedName("en-DE") EN_DE("en-DE"), @@ -9475,6 +9481,12 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("en-NZ") EN_NZ("en-NZ"), + @SerializedName("en-PL") + EN_PL("en-PL"), + + @SerializedName("en-PT") + EN_PT("en-PT"), + @SerializedName("en-SE") EN_SE("en-SE"), @@ -9496,9 +9508,15 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("fr-CA") FR_CA("fr-CA"), + @SerializedName("fr-CH") + FR_CH("fr-CH"), + @SerializedName("fr-FR") FR_FR("fr-FR"), + @SerializedName("it-CH") + IT_CH("it-CH"), + @SerializedName("it-IT") IT_IT("it-IT"), @@ -9511,6 +9529,12 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("nl-NL") NL_NL("nl-NL"), + @SerializedName("pl-PL") + PL_PL("pl-PL"), + + @SerializedName("pt-PT") + PT_PT("pt-PT"), + @SerializedName("sv-FI") SV_FI("sv-FI"), diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 5037151f82a..8e985c66b3b 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -2388,6 +2388,13 @@ public Builder setShippingRate(String shippingRate) { @Getter public static class SubscriptionData { + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** * 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 @@ -2404,7 +2411,9 @@ public static class SubscriptionData { @SerializedName("trial_period_days") Long trialPeriodDays; - private SubscriptionData(Map extraParams, Long trialPeriodDays) { + private SubscriptionData( + String description, Map extraParams, Long trialPeriodDays) { + this.description = description; this.extraParams = extraParams; this.trialPeriodDays = trialPeriodDays; } @@ -2414,13 +2423,24 @@ public static Builder builder() { } public static class Builder { + private String description; + private Map extraParams; private Long trialPeriodDays; /** Finalize and obtain parameter instance from this builder. */ public SubscriptionData build() { - return new SubscriptionData(this.extraParams, this.trialPeriodDays); + return new SubscriptionData(this.description, this.extraParams, this.trialPeriodDays); + } + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + return this; } /** diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index a102821f1d4..04945a8911d 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -152,7 +152,7 @@ public class SessionCreateParams extends ApiRequestParams { * consolidate line items if there are more than a few dozen. * *

For {@code subscription} mode, there is a maximum of 20 line items with recurring Prices and - * 20 line items with one-time Prices. Line items with one-time Prices in will be on the initial + * 20 line items with one-time Prices. Line items with one-time Prices will be on the initial * invoice only. */ @SerializedName("line_items") @@ -3333,7 +3333,7 @@ public static class PaymentMethodOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** contains details about the EPS payment method options. */ + /** contains details about the FPX payment method options. */ @SerializedName("fpx") Fpx fpx; @@ -3616,7 +3616,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** contains details about the EPS payment method options. */ + /** contains details about the FPX payment method options. */ public Builder setFpx(Fpx fpx) { this.fpx = fpx; return this; From 20c4e4f0ddde3d2a24087515e213816cfd7a26ff Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 31 Aug 2022 08:56:58 -0700 Subject: [PATCH 12/24] Bump version to 21.5.0 --- CHANGELOG.md | 27 +++++++++++++++++---------- README.md | 8 ++++---- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8c15a26b2e..993b70411e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 21.5.0 - 2022-08-31 +* [#1433](https://github.com/stripe/stripe-java/pull/1433) API Updates + * Add support for new values `de-CH`, `en-CH`, `en-PL`, `en-PT`, `fr-CH`, `it-CH`, `pl-PL`, and `pt-PT` on enums `OrderCreateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `OrderUpdateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale` + * Add support for `description` on `PaymentLink.subscription_data` and `PaymentLinkCreateParams.subscription_data` +* [#1432](https://github.com/stripe/stripe-java/pull/1432) Update README badge +* [#1431](https://github.com/stripe/stripe-java/pull/1431) Update coveralls to only run for one java version + ## 21.4.0 - 2022-08-26 * [#1430](https://github.com/stripe/stripe-java/pull/1430) API Updates * Add support for `login_page` on `BillingPortal.Configuration`, `BillingPortalConfigurationCreateParams`, and `BillingPortalConfigurationUpdateParams` @@ -11,14 +18,14 @@ ## 21.3.0 - 2022-08-23 * [#1422](https://github.com/stripe/stripe-java/pull/1422) API Updates - * Add support for new resource `CustomerCashBalanceTransaction` - * Remove support for value `paypal` from enums `OrderCreateParams.payment.settings.payment_method_types[]` and `OrderUpdateParams.payment.settings.payment_method_types[]` - * Add support for `currency` on `PaymentLink` - * Add support for `network` on `SetupIntentConfirmParams.payment_method_options.card`, `SetupIntentCreateParams.payment_method_options.card`, `SetupIntentUpdateParams.payment_method_options.card`, `Subscription.payment_settings.payment_method_options.card`, `SubscriptionCreateParams.payment_settings.payment_method_options.card`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.card` - * Change `TreasuryOutboundTransferCreateParams.destination_payment_method` to be optional - * Add support for new value `customer_cash_balance_transaction.created` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]` - * Change the return type of `Customer.fundCashBalance` test helper from `CustomerBalanceTransaction` to `CustomerCashBalanceTransaction`. - * This would generally be considered a breaking change, but we've worked with all existing users to migrate and are comfortable releasing this as a minor as it is solely a test helper method. This was essentially broken prior to this change. + * Add support for new resource `CustomerCashBalanceTransaction` + * Remove support for value `paypal` from enums `OrderCreateParams.payment.settings.payment_method_types[]` and `OrderUpdateParams.payment.settings.payment_method_types[]` + * Add support for `currency` on `PaymentLink` + * Add support for `network` on `SetupIntentConfirmParams.payment_method_options.card`, `SetupIntentCreateParams.payment_method_options.card`, `SetupIntentUpdateParams.payment_method_options.card`, `Subscription.payment_settings.payment_method_options.card`, `SubscriptionCreateParams.payment_settings.payment_method_options.card`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.card` + * Change `TreasuryOutboundTransferCreateParams.destination_payment_method` to be optional + * Add support for new value `customer_cash_balance_transaction.created` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]` + * Change the return type of `Customer.fundCashBalance` test helper from `CustomerBalanceTransaction` to `CustomerCashBalanceTransaction`. + * This would generally be considered a breaking change, but we've worked with all existing users to migrate and are comfortable releasing this as a minor as it is solely a test helper method. This was essentially broken prior to this change. * [#1425](https://github.com/stripe/stripe-java/pull/1425) Add beta readme.md section * [#1423](https://github.com/stripe/stripe-java/pull/1423) chore: Remove unused variable from SearchPagingIteratorTest. * [#1421](https://github.com/stripe/stripe-java/pull/1421) Add a support section to the readme @@ -28,8 +35,8 @@ ## 21.2.0 - 2022-08-11 * [#1416](https://github.com/stripe/stripe-java/pull/1416) API Updates - * Add support for `payment_method_collection` on `Checkout.Session`, `CheckoutSessionCreateParams`, `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink` - + * Add support for `payment_method_collection` on `Checkout.Session`, `CheckoutSessionCreateParams`, `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink` + * [#1414](https://github.com/stripe/stripe-java/pull/1414) Stop publishing javadoc for beta Java SDKs ## 21.1.0 - 2022-08-09 diff --git a/README.md b/README.md index 7c41d520b40..1bc3006ec46 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stripe Java client library -[![Maven Central](https://img.shields.io/badge/maven--central-v21.4.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) +[![Maven Central](https://img.shields.io/badge/maven--central-v21.5.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master) @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:21.4.0" +implementation "com.stripe:stripe-java:21.5.0" ``` ### Maven users @@ -29,7 +29,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 21.4.0 + 21.5.0 ``` @@ -37,7 +37,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.4.0/stripe-java-21.4.0.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.5.0/stripe-java-21.5.0.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index 8bd85214a48..24c71f3db6c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -21.4.0 +21.5.0 diff --git a/gradle.properties b/gradle.properties index 58d6e695dbe..3ea1c231c45 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=21.4.0 +VERSION_NAME=21.5.0 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index 7ae7f22f07c..65a44a7edc9 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -13,7 +13,7 @@ public abstract class Stripe { public static final String CONNECT_API_BASE = "https://connect.stripe.com"; public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; - public static final String VERSION = "21.4.0"; + public static final String VERSION = "21.5.0"; public static volatile String apiKey; public static volatile String clientId; From fe521b263d2ced42d1dabb849bcc2847830ba7da Mon Sep 17 00:00:00 2001 From: yejia-stripe <90646909+yejia-stripe@users.noreply.github.com> Date: Tue, 6 Sep 2022 16:59:12 -0400 Subject: [PATCH 13/24] Codegen for openapi v189 (#1434) --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/LineItem.java | 2 +- src/main/java/com/stripe/param/FileLinkCreateParams.java | 6 ++++-- .../java/com/stripe/param/checkout/SessionCreateParams.java | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 169d5f25686..ffd0a4e351c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v188 \ No newline at end of file +v189 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/LineItem.java b/src/main/java/com/stripe/model/LineItem.java index a184ef57847..6cfe05c2617 100644 --- a/src/main/java/com/stripe/model/LineItem.java +++ b/src/main/java/com/stripe/model/LineItem.java @@ -118,7 +118,7 @@ public static class Discount extends StripeObject { * Discounts to Subscriptions. */ @SerializedName("discount") - Discount discount; + com.stripe.model.Discount discount; } @Getter diff --git a/src/main/java/com/stripe/param/FileLinkCreateParams.java b/src/main/java/com/stripe/param/FileLinkCreateParams.java index 219750527ff..07fc3c87e59 100644 --- a/src/main/java/com/stripe/param/FileLinkCreateParams.java +++ b/src/main/java/com/stripe/param/FileLinkCreateParams.java @@ -33,7 +33,8 @@ public class FileLinkCreateParams extends ApiRequestParams { * The ID of the file. The file's {@code purpose} must be one of the following: {@code * business_icon}, {@code business_logo}, {@code customer_signature}, {@code dispute_evidence}, * {@code finance_report_run}, {@code identity_document_downloadable}, {@code pci_document}, - * {@code selfie}, {@code sigma_scheduled_query}, or {@code tax_document_user_upload}. + * {@code selfie}, {@code sigma_scheduled_query}, {@code tax_document_user_upload}, or {@code + * terminal_reader_splashscreen}. */ @SerializedName("file") String file; @@ -143,7 +144,8 @@ public Builder putAllExtraParam(Map map) { * The ID of the file. The file's {@code purpose} must be one of the following: {@code * business_icon}, {@code business_logo}, {@code customer_signature}, {@code dispute_evidence}, * {@code finance_report_run}, {@code identity_document_downloadable}, {@code pci_document}, - * {@code selfie}, {@code sigma_scheduled_query}, or {@code tax_document_user_upload}. + * {@code selfie}, {@code sigma_scheduled_query}, {@code tax_document_user_upload}, or {@code + * terminal_reader_splashscreen}. */ public Builder setFile(String file) { this.file = file; diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 04945a8911d..ab5720c0bb7 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -1857,7 +1857,7 @@ public static class AdjustableQuantity { /** * The maximum quantity the customer can purchase for the Checkout Session. By default this - * value is 99. You can specify a value up to 999. + * value is 99. You can specify a value up to 999999. */ @SerializedName("maximum") Long maximum; @@ -1934,7 +1934,7 @@ public Builder putAllExtraParam(Map map) { /** * The maximum quantity the customer can purchase for the Checkout Session. By default this - * value is 99. You can specify a value up to 999. + * value is 99. You can specify a value up to 999999. */ public Builder setMaximum(Long maximum) { this.maximum = maximum; From 24fd743cf99a9dd9138faf3b717a9ab366140d02 Mon Sep 17 00:00:00 2001 From: Yejia Chen Date: Tue, 6 Sep 2022 17:06:43 -0400 Subject: [PATCH 14/24] Bump version to 21.6.0 --- CHANGELOG.md | 6 ++++++ README.md | 8 ++++---- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 993b70411e3..e2b560880c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 21.6.0 - 2022-09-06 +* [#1434](https://github.com/stripe/stripe-java/pull/1434) API Updates + * Add support for new value `terminal_reader_splashscreen` on enum `FileListParams.purpose` + * Fix `LineItem.Discount.discount` to reference the correct `Discount` class (`com.stripe.model.Discount`) + + ## 21.5.0 - 2022-08-31 * [#1433](https://github.com/stripe/stripe-java/pull/1433) API Updates * Add support for new values `de-CH`, `en-CH`, `en-PL`, `en-PT`, `fr-CH`, `it-CH`, `pl-PL`, and `pt-PT` on enums `OrderCreateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `OrderUpdateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale` diff --git a/README.md b/README.md index 1bc3006ec46..b7e864e099f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stripe Java client library -[![Maven Central](https://img.shields.io/badge/maven--central-v21.5.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) +[![Maven Central](https://img.shields.io/badge/maven--central-v21.6.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master) @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:21.5.0" +implementation "com.stripe:stripe-java:21.6.0" ``` ### Maven users @@ -29,7 +29,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 21.5.0 + 21.6.0 ``` @@ -37,7 +37,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.5.0/stripe-java-21.5.0.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.6.0/stripe-java-21.6.0.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index 24c71f3db6c..986c3cc7613 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -21.5.0 +21.6.0 diff --git a/gradle.properties b/gradle.properties index 3ea1c231c45..97032c2a5b9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=21.5.0 +VERSION_NAME=21.6.0 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index 65a44a7edc9..a61bb890b03 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -13,7 +13,7 @@ public abstract class Stripe { public static final String CONNECT_API_BASE = "https://connect.stripe.com"; public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; - public static final String VERSION = "21.5.0"; + public static final String VERSION = "21.6.0"; public static volatile String apiKey; public static volatile String clientId; From abfacb70a9b42a864315e991681f00d8c245d873 Mon Sep 17 00:00:00 2001 From: yejia-stripe <90646909+yejia-stripe@users.noreply.github.com> Date: Fri, 9 Sep 2022 09:57:20 -0400 Subject: [PATCH 15/24] Codegen for openapi v190 (#1435) --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Invoice.java | 2 +- src/main/java/com/stripe/model/issuing/Card.java | 8 ++++++++ .../stripe/param/issuing/CardCreateParams.java | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ffd0a4e351c..3bdc7ecadb4 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v189 \ No newline at end of file +v190 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index 758c436e5fa..8e11adb222f 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -522,7 +522,7 @@ public class Invoice extends ApiResource implements HasId, MetadataStore totalDiscountAmounts; + List totalDiscountAmounts; /** * The integer amount in %s representing the total amount of the invoice including all discounts diff --git a/src/main/java/com/stripe/model/issuing/Card.java b/src/main/java/com/stripe/model/issuing/Card.java index c3106bb5674..3c09a3ba65b 100644 --- a/src/main/java/com/stripe/model/issuing/Card.java +++ b/src/main/java/com/stripe/model/issuing/Card.java @@ -387,6 +387,14 @@ public static class Shipping extends StripeObject { @SerializedName("phone_number") String phoneNumber; + /** + * Whether a signature is required for card delivery. This feature is only supported for US + * users. Standard shipping service does not support signature on delivery. The default value + * for standard shipping service is false and for express and priority services is true. + */ + @SerializedName("require_signature") + Boolean requireSignature; + /** * Shipment service, such as {@code standard} or {@code express}. * diff --git a/src/main/java/com/stripe/param/issuing/CardCreateParams.java b/src/main/java/com/stripe/param/issuing/CardCreateParams.java index ff7f5e40a2f..d9a7b434b96 100644 --- a/src/main/java/com/stripe/param/issuing/CardCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardCreateParams.java @@ -319,6 +319,10 @@ public static class Shipping { @SerializedName("phone_number") String phoneNumber; + /** Whether a signature is required for card delivery. */ + @SerializedName("require_signature") + Boolean requireSignature; + /** Shipment service. */ @SerializedName("service") Service service; @@ -333,6 +337,7 @@ private Shipping( Map extraParams, String name, String phoneNumber, + Boolean requireSignature, Service service, Type type) { this.address = address; @@ -340,6 +345,7 @@ private Shipping( this.extraParams = extraParams; this.name = name; this.phoneNumber = phoneNumber; + this.requireSignature = requireSignature; this.service = service; this.type = type; } @@ -359,6 +365,8 @@ public static class Builder { private String phoneNumber; + private Boolean requireSignature; + private Service service; private Type type; @@ -371,6 +379,7 @@ public Shipping build() { this.extraParams, this.name, this.phoneNumber, + this.requireSignature, this.service, this.type); } @@ -425,6 +434,12 @@ public Builder setPhoneNumber(String phoneNumber) { return this; } + /** Whether a signature is required for card delivery. */ + public Builder setRequireSignature(Boolean requireSignature) { + this.requireSignature = requireSignature; + return this; + } + /** Shipment service. */ public Builder setService(Service service) { this.service = service; From ad1d85c8a199f365c9a2e42eb9ba3821992e1b37 Mon Sep 17 00:00:00 2001 From: Yejia Chen Date: Fri, 9 Sep 2022 10:05:37 -0400 Subject: [PATCH 16/24] Bump version to 21.7.0 --- CHANGELOG.md | 4 ++++ README.md | 8 ++++---- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2b560880c6..281729307d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 21.7.0 - 2022-09-09 +* [#1435](https://github.com/stripe/stripe-java/pull/1435) API Updates + * Add support for `require_signature` on `Issuing.Card.shipping` and `IssuingCardCreateParams.shipping` + ## 21.6.0 - 2022-09-06 * [#1434](https://github.com/stripe/stripe-java/pull/1434) API Updates * Add support for new value `terminal_reader_splashscreen` on enum `FileListParams.purpose` diff --git a/README.md b/README.md index b7e864e099f..8c0adf4a053 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stripe Java client library -[![Maven Central](https://img.shields.io/badge/maven--central-v21.6.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) +[![Maven Central](https://img.shields.io/badge/maven--central-v21.7.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master) @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:21.6.0" +implementation "com.stripe:stripe-java:21.7.0" ``` ### Maven users @@ -29,7 +29,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 21.6.0 + 21.7.0 ``` @@ -37,7 +37,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.6.0/stripe-java-21.6.0.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.7.0/stripe-java-21.7.0.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index 986c3cc7613..ff1c240384f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -21.6.0 +21.7.0 diff --git a/gradle.properties b/gradle.properties index 97032c2a5b9..9eab6f293fe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=21.6.0 +VERSION_NAME=21.7.0 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index a61bb890b03..e2536120da6 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -13,7 +13,7 @@ public abstract class Stripe { public static final String CONNECT_API_BASE = "https://connect.stripe.com"; public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; - public static final String VERSION = "21.6.0"; + public static final String VERSION = "21.7.0"; public static volatile String apiKey; public static volatile String clientId; From 5cc3d547795265de442b4178f74e9b160f43b0f4 Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik <99290280+kamil-stripe@users.noreply.github.com> Date: Thu, 15 Sep 2022 12:10:48 -0700 Subject: [PATCH 17/24] Codegen for openapi v192 (#1444) --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Charge.java | 12 + src/main/java/com/stripe/model/Invoice.java | 65 ++++++ .../java/com/stripe/model/PaymentIntent.java | 50 +++++ .../java/com/stripe/model/PaymentMethod.java | 12 +- .../com/stripe/model/checkout/Session.java | 13 ++ .../stripe/model/treasury/CreditReversal.java | 4 + .../stripe/model/treasury/DebitReversal.java | 4 + .../CustomerListPaymentMethodsParams.java | 3 + .../com/stripe/param/InvoiceCreateParams.java | 122 +++++++++++ .../param/PaymentIntentConfirmParams.java | 206 ++++++++++++++++++ .../param/PaymentIntentCreateParams.java | 206 ++++++++++++++++++ .../param/PaymentIntentUpdateParams.java | 206 ++++++++++++++++++ .../stripe/param/PaymentLinkCreateParams.java | 3 + .../stripe/param/PaymentLinkUpdateParams.java | 3 + .../param/PaymentMethodCreateParams.java | 79 +++++++ .../stripe/param/PaymentMethodListParams.java | 3 + .../param/SetupIntentConfirmParams.java | 81 +++++++ .../stripe/param/SetupIntentCreateParams.java | 81 +++++++ .../stripe/param/SetupIntentUpdateParams.java | 81 +++++++ .../param/checkout/SessionCreateParams.java | 99 ++++++++- 21 files changed, 1330 insertions(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3bdc7ecadb4..9ea0390f9e6 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v190 \ No newline at end of file +v192 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 62e7ef26f9d..1f2d4ac1f99 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -1168,6 +1168,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("paynow") Paynow paynow; + @SerializedName("pix") + Pix pix; + @SerializedName("promptpay") Promptpay promptpay; @@ -2435,6 +2438,15 @@ public static class Paynow extends StripeObject { String reference; } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Pix extends StripeObject { + /** Unique transaction id generated by BCB. */ + @SerializedName("bank_transaction_id") + String bankTransactionId; + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index 8e11adb222f..268b474b90f 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -316,6 +316,14 @@ public class Invoice extends ApiResource implements HasId, MetadataStorerevision documentation for more + * details. + */ + @SerializedName("from_invoice") + FromInvoice fromInvoice; + /** * The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the * invoice has not been finalized yet, this will be null. @@ -342,6 +350,12 @@ public class Invoice extends ApiResource implements HasId, MetadataStore latestRevision; + /** * The individual line items that make up the invoice. {@code lines} is sorted as follows: invoice * items in reverse chronological order, followed by the subscription, if any. @@ -644,6 +658,24 @@ public void setDefaultSourceObject(PaymentSource expandableObject) { new ExpandableField(expandableObject.getId(), expandableObject); } + /** Get ID of expandable {@code latestRevision} object. */ + public String getLatestRevision() { + return (this.latestRevision != null) ? this.latestRevision.getId() : null; + } + + public void setLatestRevision(String id) { + this.latestRevision = ApiResource.setExpandableFieldId(id, this.latestRevision); + } + + /** Get expanded {@code latestRevision}. */ + public Invoice getLatestRevisionObject() { + return (this.latestRevision != null) ? this.latestRevision.getExpanded() : null; + } + + public void setLatestRevisionObject(Invoice expandableObject) { + this.latestRevision = new ExpandableField(expandableObject.getId(), expandableObject); + } + /** Get ID of expandable {@code onBehalfOf} object. */ public String getOnBehalfOf() { return (this.onBehalfOf != null) ? this.onBehalfOf.getId() : null; @@ -1674,6 +1706,39 @@ public void setDiscountObject(Discount expandableObject) { } } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FromInvoice extends StripeObject { + /** The relation between this invoice and the cloned invoice. */ + @SerializedName("action") + String action; + + /** The invoice that was cloned. */ + @SerializedName("invoice") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField invoice; + + /** Get ID of expandable {@code invoice} object. */ + public String getInvoice() { + return (this.invoice != null) ? this.invoice.getId() : null; + } + + public void setInvoice(String id) { + this.invoice = ApiResource.setExpandableFieldId(id, this.invoice); + } + + /** Get expanded {@code invoice}. */ + public Invoice getInvoiceObject() { + return (this.invoice != null) ? this.invoice.getExpanded() : null; + } + + public void setInvoiceObject(Invoice expandableObject) { + this.invoice = new ExpandableField(expandableObject.getId(), expandableObject); + } + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 493694520c3..478ca9bffc1 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -1455,6 +1455,9 @@ public static class NextAction extends StripeObject { @SerializedName("paynow_display_qr_code") PaynowDisplayQrCode paynowDisplayQrCode; + @SerializedName("pix_display_qr_code") + PixDisplayQrCode pixDisplayQrCode; + @SerializedName("promptpay_display_qr_code") PromptpayDisplayQrCode promptpayDisplayQrCode; @@ -1509,6 +1512,37 @@ public static class PaynowDisplayQrCode extends StripeObject { String imageUrlSvg; } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PixDisplayQrCode extends StripeObject { + /** + * The raw data string used to generate QR code, it should be used together with QR code + * library. + */ + @SerializedName("data") + String data; + + /** The date (unix timestamp) when the PIX expires. */ + @SerializedName("expires_at") + Long expiresAt; + + /** + * The URL to the hosted pix instructions page, which allows customers to view the pix QR + * code. + */ + @SerializedName("hosted_instructions_url") + String hostedInstructionsUrl; + + /** ​​The image_url_png string used to render png QR code. */ + @SerializedName("image_url_png") + String imageUrlPng; + + /** ​​The image_url_svg string used to render svg QR code. */ + @SerializedName("image_url_svg") + String imageUrlSvg; + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -2088,6 +2122,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("paynow") Paynow paynow; + @SerializedName("pix") + Pix pix; + @SerializedName("promptpay") Promptpay promptpay; @@ -3054,6 +3091,19 @@ public static class Paynow extends StripeObject { String setupFutureUsage; } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Pix extends StripeObject { + /** The number of seconds (between 10 and 1209600) after which Pix payment will expire. */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + + /** The timestamp at which the Pix expires. */ + @SerializedName("expires_at") + Long expiresAt; + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 7ed1c2fcfd6..13387f45523 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -147,6 +147,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore

Custom * Domains, the URL will use your subdomain. Otherwise, it’ll use {@code checkout.stripe.com.} + * This value is only present when the session is active. */ @SerializedName("url") String url; @@ -840,6 +841,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("paynow") Paynow paynow; + @SerializedName("pix") + Pix pix; + @SerializedName("sepa_debit") SepaDebit sepaDebit; @@ -1519,6 +1523,15 @@ public static class Paynow extends StripeObject { String setupFutureUsage; } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Pix extends StripeObject { + /** The number of seconds after which Pix payment will expire. */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/treasury/CreditReversal.java b/src/main/java/com/stripe/model/treasury/CreditReversal.java index c690e942cab..23886a33758 100644 --- a/src/main/java/com/stripe/model/treasury/CreditReversal.java +++ b/src/main/java/com/stripe/model/treasury/CreditReversal.java @@ -30,6 +30,10 @@ public class CreditReversal extends ApiResource implements HasId { @SerializedName("amount") Long amount; + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + /** * Three-letter ISO currency code, * in lowercase. Must be a supported currency. diff --git a/src/main/java/com/stripe/model/treasury/DebitReversal.java b/src/main/java/com/stripe/model/treasury/DebitReversal.java index 7e586a93efa..d239ed14231 100644 --- a/src/main/java/com/stripe/model/treasury/DebitReversal.java +++ b/src/main/java/com/stripe/model/treasury/DebitReversal.java @@ -30,6 +30,10 @@ public class DebitReversal extends ApiResource implements HasId { @SerializedName("amount") Long amount; + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + /** * Three-letter ISO currency code, * in lowercase. Must be a supported currency. diff --git a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java index 57fc92376a7..ea6e3802f2b 100644 --- a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java +++ b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java @@ -256,6 +256,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), diff --git a/src/main/java/com/stripe/param/InvoiceCreateParams.java b/src/main/java/com/stripe/param/InvoiceCreateParams.java index bd6cf0f05b5..9d3f2ff4427 100644 --- a/src/main/java/com/stripe/param/InvoiceCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreateParams.java @@ -128,6 +128,14 @@ public class InvoiceCreateParams extends ApiRequestParams { @SerializedName("footer") String footer; + /** + * Revise an existing invoice. The new invoice will be created in {@code status=draft}. See the revision documentation for more + * details. + */ + @SerializedName("from_invoice") + FromInvoice fromInvoice; + /** * 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 @@ -210,6 +218,7 @@ private InvoiceCreateParams( List expand, Map extraParams, String footer, + FromInvoice fromInvoice, Object metadata, String onBehalfOf, PaymentSettings paymentSettings, @@ -236,6 +245,7 @@ private InvoiceCreateParams( this.expand = expand; this.extraParams = extraParams; this.footer = footer; + this.fromInvoice = fromInvoice; this.metadata = metadata; this.onBehalfOf = onBehalfOf; this.paymentSettings = paymentSettings; @@ -287,6 +297,8 @@ public static class Builder { private String footer; + private FromInvoice fromInvoice; + private Object metadata; private String onBehalfOf; @@ -324,6 +336,7 @@ public InvoiceCreateParams build() { this.expand, this.extraParams, this.footer, + this.fromInvoice, this.metadata, this.onBehalfOf, this.paymentSettings, @@ -650,6 +663,16 @@ public Builder setFooter(String footer) { return this; } + /** + * Revise an existing invoice. The new invoice will be created in {@code status=draft}. See the + * revision documentation for + * more details. + */ + public Builder setFromInvoice(FromInvoice fromInvoice) { + this.fromInvoice = fromInvoice; + 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 @@ -1016,6 +1039,105 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class FromInvoice { + /** + * The relation between the new invoice and the original invoice. Currently, only 'revision' is + * permitted + */ + @SerializedName("action") + Action action; + + /** + * 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 {@code id} of the invoice that will be cloned. */ + @SerializedName("invoice") + String invoice; + + private FromInvoice(Action action, Map extraParams, String invoice) { + this.action = action; + this.extraParams = extraParams; + this.invoice = invoice; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Action action; + + private Map extraParams; + + private String invoice; + + /** Finalize and obtain parameter instance from this builder. */ + public FromInvoice build() { + return new FromInvoice(this.action, this.extraParams, this.invoice); + } + + /** + * The relation between the new invoice and the original invoice. Currently, only 'revision' + * is permitted + */ + public Builder setAction(Action action) { + this.action = action; + 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 + * InvoiceCreateParams.FromInvoice#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 InvoiceCreateParams.FromInvoice#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 {@code id} of the invoice that will be cloned. */ + public Builder setInvoice(String invoice) { + this.invoice = invoice; + return this; + } + } + + public enum Action implements ApiRequestParams.EnumParam { + @SerializedName("revision") + REVISION("revision"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Action(String value) { + this.value = value; + } + } + } + @Getter public static class PaymentSettings { /** diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 23364d2c3fa..3a4726e628b 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -1008,6 +1008,13 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + @SerializedName("pix") + Pix pix; + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -1084,6 +1091,7 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -1116,6 +1124,7 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; this.sepaDebit = sepaDebit; @@ -1180,6 +1189,8 @@ public static class Builder { private Paynow paynow; + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -1222,6 +1233,7 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -1492,6 +1504,15 @@ public Builder setPaynow(Paynow paynow) { return this; } + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + public Builder setPix(Pix pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. @@ -3699,6 +3720,63 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Pix { + /** + * 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 Pix(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Pix build() { + return new Pix(this.extraParams); + } + + /** + * 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.Pix#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.Pix#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 public static class Promptpay { /** @@ -4286,6 +4364,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), @@ -4486,6 +4567,13 @@ public static class PaymentMethodOptions { @SerializedName("paynow") Object paynow; + /** + * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix payment + * method options. + */ + @SerializedName("pix") + Object pix; + /** * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. @@ -4547,6 +4635,7 @@ private PaymentMethodOptions( Object oxxo, Object p24, Object paynow, + Object pix, Object promptpay, Object sepaDebit, Object sofort, @@ -4577,6 +4666,7 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.pix = pix; this.promptpay = promptpay; this.sepaDebit = sepaDebit; this.sofort = sofort; @@ -4639,6 +4729,8 @@ public static class Builder { private Object paynow; + private Object pix; + private Object promptpay; private Object sepaDebit; @@ -4677,6 +4769,7 @@ public PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.pix, this.promptpay, this.sepaDebit, this.sofort, @@ -5137,6 +5230,24 @@ public Builder setPaynow(EmptyParam paynow) { return this; } + /** + * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix + * payment method options. + */ + public Builder setPix(Pix pix) { + this.pix = pix; + return this; + } + + /** + * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix + * payment method options. + */ + public Builder setPix(EmptyParam pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. @@ -10328,6 +10439,101 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + public static class Pix { + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + + /** + * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + * Defaults to 1 day in the future. + */ + @SerializedName("expires_at") + Long expiresAt; + + /** + * 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 Pix(Long expiresAfterSeconds, Long expiresAt, Map extraParams) { + this.expiresAfterSeconds = expiresAfterSeconds; + this.expiresAt = expiresAt; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long expiresAfterSeconds; + + private Long expiresAt; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Pix build() { + return new Pix(this.expiresAfterSeconds, this.expiresAt, this.extraParams); + } + + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + public Builder setExpiresAfterSeconds(Long expiresAfterSeconds) { + this.expiresAfterSeconds = expiresAfterSeconds; + return this; + } + + /** + * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + * Defaults to 1 day in the future. + */ + public Builder setExpiresAt(Long expiresAt) { + this.expiresAt = expiresAt; + 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.Pix#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.Pix#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 public static class Promptpay { /** diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 32e8067c1a1..f3dbba2257e 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -1459,6 +1459,13 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + @SerializedName("pix") + Pix pix; + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -1535,6 +1542,7 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -1567,6 +1575,7 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; this.sepaDebit = sepaDebit; @@ -1631,6 +1640,8 @@ public static class Builder { private Paynow paynow; + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -1673,6 +1684,7 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -1943,6 +1955,15 @@ public Builder setPaynow(Paynow paynow) { return this; } + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + public Builder setPix(Pix pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. @@ -4148,6 +4169,63 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Pix { + /** + * 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 Pix(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Pix build() { + return new Pix(this.extraParams); + } + + /** + * 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.Pix#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.Pix#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 public static class Promptpay { /** @@ -4735,6 +4813,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), @@ -4935,6 +5016,13 @@ public static class PaymentMethodOptions { @SerializedName("paynow") Object paynow; + /** + * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix payment + * method options. + */ + @SerializedName("pix") + Object pix; + /** * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. @@ -4996,6 +5084,7 @@ private PaymentMethodOptions( Object oxxo, Object p24, Object paynow, + Object pix, Object promptpay, Object sepaDebit, Object sofort, @@ -5026,6 +5115,7 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.pix = pix; this.promptpay = promptpay; this.sepaDebit = sepaDebit; this.sofort = sofort; @@ -5088,6 +5178,8 @@ public static class Builder { private Object paynow; + private Object pix; + private Object promptpay; private Object sepaDebit; @@ -5126,6 +5218,7 @@ public PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.pix, this.promptpay, this.sepaDebit, this.sofort, @@ -5586,6 +5679,24 @@ public Builder setPaynow(EmptyParam paynow) { return this; } + /** + * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix + * payment method options. + */ + public Builder setPix(Pix pix) { + this.pix = pix; + return this; + } + + /** + * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix + * payment method options. + */ + public Builder setPix(EmptyParam pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. @@ -10777,6 +10888,101 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + public static class Pix { + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + + /** + * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + * Defaults to 1 day in the future. + */ + @SerializedName("expires_at") + Long expiresAt; + + /** + * 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 Pix(Long expiresAfterSeconds, Long expiresAt, Map extraParams) { + this.expiresAfterSeconds = expiresAfterSeconds; + this.expiresAt = expiresAt; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long expiresAfterSeconds; + + private Long expiresAt; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Pix build() { + return new Pix(this.expiresAfterSeconds, this.expiresAt, this.extraParams); + } + + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + public Builder setExpiresAfterSeconds(Long expiresAfterSeconds) { + this.expiresAfterSeconds = expiresAfterSeconds; + return this; + } + + /** + * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + * Defaults to 1 day in the future. + */ + public Builder setExpiresAt(Long expiresAt) { + this.expiresAt = expiresAt; + 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.Pix#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.Pix#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 public static class Promptpay { /** diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 91b6018c78f..679c49f2842 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -895,6 +895,13 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + @SerializedName("pix") + Pix pix; + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -971,6 +978,7 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -1003,6 +1011,7 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; this.sepaDebit = sepaDebit; @@ -1067,6 +1076,8 @@ public static class Builder { private Paynow paynow; + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -1109,6 +1120,7 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -1379,6 +1391,15 @@ public Builder setPaynow(Paynow paynow) { return this; } + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + public Builder setPix(Pix pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. @@ -3686,6 +3707,63 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Pix { + /** + * 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 Pix(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Pix build() { + return new Pix(this.extraParams); + } + + /** + * 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.Pix#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.Pix#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 public static class Promptpay { /** @@ -4307,6 +4385,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), @@ -4507,6 +4588,13 @@ public static class PaymentMethodOptions { @SerializedName("paynow") Object paynow; + /** + * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix payment + * method options. + */ + @SerializedName("pix") + Object pix; + /** * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. @@ -4568,6 +4656,7 @@ private PaymentMethodOptions( Object oxxo, Object p24, Object paynow, + Object pix, Object promptpay, Object sepaDebit, Object sofort, @@ -4598,6 +4687,7 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.pix = pix; this.promptpay = promptpay; this.sepaDebit = sepaDebit; this.sofort = sofort; @@ -4660,6 +4750,8 @@ public static class Builder { private Object paynow; + private Object pix; + private Object promptpay; private Object sepaDebit; @@ -4698,6 +4790,7 @@ public PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.pix, this.promptpay, this.sepaDebit, this.sofort, @@ -5158,6 +5251,24 @@ public Builder setPaynow(EmptyParam paynow) { return this; } + /** + * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix + * payment method options. + */ + public Builder setPix(Pix pix) { + this.pix = pix; + return this; + } + + /** + * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix + * payment method options. + */ + public Builder setPix(EmptyParam pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. @@ -10437,6 +10548,101 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + public static class Pix { + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + + /** + * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + * Defaults to 1 day in the future. + */ + @SerializedName("expires_at") + Long expiresAt; + + /** + * 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 Pix(Long expiresAfterSeconds, Long expiresAt, Map extraParams) { + this.expiresAfterSeconds = expiresAfterSeconds; + this.expiresAt = expiresAt; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long expiresAfterSeconds; + + private Long expiresAt; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Pix build() { + return new Pix(this.expiresAfterSeconds, this.expiresAt, this.extraParams); + } + + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + public Builder setExpiresAfterSeconds(Long expiresAfterSeconds) { + this.expiresAfterSeconds = expiresAfterSeconds; + return this; + } + + /** + * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + * Defaults to 1 day in the future. + */ + public Builder setExpiresAt(Long expiresAt) { + this.expiresAt = expiresAt; + 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.Pix#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.Pix#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 public static class Promptpay { /** diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 8e985c66b3b..3d4abfdf3ce 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -2743,6 +2743,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index 4162ad518a7..650fc8d5373 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -1900,6 +1900,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index cf222249b18..02240cc4094 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -214,6 +214,13 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + @SerializedName("pix") + Pix pix; + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -293,6 +300,7 @@ private PaymentMethodCreateParams( P24 p24, String paymentMethod, Paynow paynow, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -329,6 +337,7 @@ private PaymentMethodCreateParams( this.p24 = p24; this.paymentMethod = paymentMethod; this.paynow = paynow; + this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; this.sepaDebit = sepaDebit; @@ -401,6 +410,8 @@ public static class Builder { private Paynow paynow; + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -447,6 +458,7 @@ public PaymentMethodCreateParams build() { this.p24, this.paymentMethod, this.paynow, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -779,6 +791,15 @@ public Builder setPaynow(Paynow paynow) { return this; } + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + public Builder setPix(Pix pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -3042,6 +3063,61 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Pix { + /** + * 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 Pix(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Pix build() { + return new Pix(this.extraParams); + } + + /** + * 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.Pix#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.Pix#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 public static class Promptpay { /** @@ -3687,6 +3763,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), diff --git a/src/main/java/com/stripe/param/PaymentMethodListParams.java b/src/main/java/com/stripe/param/PaymentMethodListParams.java index c5e2238bbfe..ea09fb6cc59 100644 --- a/src/main/java/com/stripe/param/PaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodListParams.java @@ -271,6 +271,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index c50ab79b204..8fb539605de 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -743,6 +743,13 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + @SerializedName("pix") + Pix pix; + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -819,6 +826,7 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -851,6 +859,7 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; this.sepaDebit = sepaDebit; @@ -915,6 +924,8 @@ public static class Builder { private Paynow paynow; + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -957,6 +968,7 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -1227,6 +1239,15 @@ public Builder setPaynow(Paynow paynow) { return this; } + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + public Builder setPix(Pix pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. @@ -3432,6 +3453,63 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Pix { + /** + * 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 Pix(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Pix build() { + return new Pix(this.extraParams); + } + + /** + * 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.Pix#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.Pix#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 public static class Promptpay { /** @@ -4019,6 +4097,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index 7d78bad926c..c73a2bdeef8 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -1019,6 +1019,13 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + @SerializedName("pix") + Pix pix; + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -1095,6 +1102,7 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -1127,6 +1135,7 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; this.sepaDebit = sepaDebit; @@ -1191,6 +1200,8 @@ public static class Builder { private Paynow paynow; + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -1233,6 +1244,7 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -1502,6 +1514,15 @@ public Builder setPaynow(Paynow paynow) { return this; } + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + public Builder setPix(Pix pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. @@ -3707,6 +3728,63 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Pix { + /** + * 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 Pix(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Pix build() { + return new Pix(this.extraParams); + } + + /** + * 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.Pix#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.Pix#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 public static class Promptpay { /** @@ -4294,6 +4372,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index 3e9e597802d..6e5e0fe4d5f 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -582,6 +582,13 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + @SerializedName("pix") + Pix pix; + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -658,6 +665,7 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -690,6 +698,7 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; this.sepaDebit = sepaDebit; @@ -754,6 +763,8 @@ public static class Builder { private Paynow paynow; + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -796,6 +807,7 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -1065,6 +1077,15 @@ public Builder setPaynow(Paynow paynow) { return this; } + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + public Builder setPix(Pix pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. @@ -3372,6 +3393,63 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Pix { + /** + * 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 Pix(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Pix build() { + return new Pix(this.extraParams); + } + + /** + * 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.Pix#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.Pix#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 public static class Promptpay { /** @@ -3993,6 +4071,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index ab5720c0bb7..21da3e568b0 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -210,8 +210,9 @@ public class SessionCreateParams extends ApiRequestParams { /** * A list of the types of payment methods (e.g., {@code card}) this Checkout Session can accept. * - *

Do not include this attribute if you prefer to manage your payment methods from the Stripe Dashboard. + *

In {@code payment} and {@code subscription} mode, you can omit this attribute to manage your + * payment methods from the Stripe + * Dashboard. It is required in {@code setup} mode. * *

Read more about the supported payment methods and their requirements in our payment method details @@ -3369,6 +3370,10 @@ public static class PaymentMethodOptions { @SerializedName("paynow") Paynow paynow; + /** contains details about the Pix payment method options. */ + @SerializedName("pix") + Pix pix; + /** contains details about the Sepa Debit payment method options. */ @SerializedName("sepa_debit") SepaDebit sepaDebit; @@ -3407,6 +3412,7 @@ private PaymentMethodOptions( Oxxo oxxo, P24 p24, Paynow paynow, + Pix pix, SepaDebit sepaDebit, Sofort sofort, UsBankAccount usBankAccount, @@ -3432,6 +3438,7 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.pix = pix; this.sepaDebit = sepaDebit; this.sofort = sofort; this.usBankAccount = usBankAccount; @@ -3485,6 +3492,8 @@ public static class Builder { private Paynow paynow; + private Pix pix; + private SepaDebit sepaDebit; private Sofort sofort; @@ -3517,6 +3526,7 @@ public PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.pix, this.sepaDebit, this.sofort, this.usBankAccount, @@ -3670,6 +3680,12 @@ public Builder setPaynow(Paynow paynow) { return this; } + /** contains details about the Pix payment method options. */ + public Builder setPix(Pix pix) { + this.pix = pix; + return this; + } + /** contains details about the Sepa Debit payment method options. */ public Builder setSepaDebit(SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; @@ -7011,6 +7027,82 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + public static class Pix { + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + + /** + * 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 Pix(Long expiresAfterSeconds, Map extraParams) { + this.expiresAfterSeconds = expiresAfterSeconds; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long expiresAfterSeconds; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Pix build() { + return new Pix(this.expiresAfterSeconds, this.extraParams); + } + + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + public Builder setExpiresAfterSeconds(Long expiresAfterSeconds) { + this.expiresAfterSeconds = expiresAfterSeconds; + 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.Pix#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.Pix#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 public static class SepaDebit { /** @@ -10477,6 +10569,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), From 1676563f161515eab18bf69ff8ca354dbbfdf8e4 Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Thu, 15 Sep 2022 12:42:39 -0700 Subject: [PATCH 18/24] Bump version to 21.8.0 --- CHANGELOG.md | 13 +++++++++++++ README.md | 8 ++++---- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 281729307d6..6f8f80acbb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 21.8.0 - 2022-09-15 +* [#1444](https://github.com/stripe/stripe-java/pull/1444) API Updates + * Add support for `pix` on `Charge.payment_method_details`, `Checkout.Session.payment_method_options`, `CheckoutSessionCreateParams.payment_method_options`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data` + * Add support for new value `pix` on enum `CheckoutSessionCreateParams.payment_method_types[]` + * Add support for new value `pix` on enums `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type` + * Add support for `from_invoice` on `InvoiceCreateParams` and `Invoice` + * Add support for `latest_revision` on `Invoice` + * Add support for new value `pix` on enums `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type` + * Add support for `pix_display_qr_code` on `PaymentIntent.next_action` + * Add support for new value `pix` on enums `PaymentLinkCreateParams.payment_method_types[]` and `PaymentLinkUpdateParams.payment_method_types[]` + * Add support for new value `pix` on enum `PaymentMethodCreateParams.type` + * Add support for `created` on `Treasury.CreditReversal` and `Treasury.DebitReversal` + ## 21.7.0 - 2022-09-09 * [#1435](https://github.com/stripe/stripe-java/pull/1435) API Updates * Add support for `require_signature` on `Issuing.Card.shipping` and `IssuingCardCreateParams.shipping` diff --git a/README.md b/README.md index 8c0adf4a053..de5bd487070 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stripe Java client library -[![Maven Central](https://img.shields.io/badge/maven--central-v21.7.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) +[![Maven Central](https://img.shields.io/badge/maven--central-v21.8.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master) @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:21.7.0" +implementation "com.stripe:stripe-java:21.8.0" ``` ### Maven users @@ -29,7 +29,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 21.7.0 + 21.8.0 ``` @@ -37,7 +37,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.7.0/stripe-java-21.7.0.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.8.0/stripe-java-21.8.0.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index ff1c240384f..af52b1c5ccb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -21.7.0 +21.8.0 diff --git a/gradle.properties b/gradle.properties index 9eab6f293fe..17a31f2082c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=21.7.0 +VERSION_NAME=21.8.0 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index e2536120da6..6f27914b652 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -13,7 +13,7 @@ public abstract class Stripe { public static final String CONNECT_API_BASE = "https://connect.stripe.com"; public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; - public static final String VERSION = "21.7.0"; + public static final String VERSION = "21.8.0"; public static volatile String apiKey; public static volatile String clientId; From 84f3166b26ba84422f49a58892cbac831e3b6778 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Wed, 21 Sep 2022 14:49:01 -0700 Subject: [PATCH 19/24] React to EventDataClassLookup generation changes (#1446) --- src/main/java/com/stripe/model/EventDataClassLookup.java | 6 +----- src/main/java/com/stripe/model/EventDataDeserializer.java | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index f13a7d8fb91..f0f96060ef0 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -9,7 +9,7 @@ * string of the model. */ final class EventDataClassLookup { - private static final Map> classLookup = new HashMap<>(); + public static final Map> classLookup = new HashMap<>(); static { classLookup.put("account", Account.class); @@ -143,8 +143,4 @@ final class EventDataClassLookup { classLookup.put("treasury.transaction", com.stripe.model.treasury.Transaction.class); classLookup.put("treasury.transaction_entry", com.stripe.model.treasury.TransactionEntry.class); } - - public static Class findClass(String objectType) { - return classLookup.get(objectType); - } } diff --git a/src/main/java/com/stripe/model/EventDataDeserializer.java b/src/main/java/com/stripe/model/EventDataDeserializer.java index ff23e44c5bd..5eece2f19c7 100644 --- a/src/main/java/com/stripe/model/EventDataDeserializer.java +++ b/src/main/java/com/stripe/model/EventDataDeserializer.java @@ -53,7 +53,7 @@ public EventData deserialize(JsonElement json, Type typeOfT, JsonDeserialization */ static StripeObject deserializeStripeObject(JsonObject eventDataObjectJson) { String type = eventDataObjectJson.getAsJsonObject().get("object").getAsString(); - Class cl = EventDataClassLookup.findClass(type); + Class cl = EventDataClassLookup.classLookup.get(type); return ApiResource.GSON.fromJson( eventDataObjectJson, cl != null ? cl : StripeRawJsonObject.class); } From 3278f6701b78355c2d3fe5b43ec92791470f9009 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Thu, 22 Sep 2022 10:51:00 -0700 Subject: [PATCH 20/24] Codegen for openapi v196 (#1445) --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Invoice.java | 52 + .../java/com/stripe/model/PaymentIntent.java | 4 +- .../java/com/stripe/model/PaymentLink.java | 10 + .../com/stripe/model/checkout/Session.java | 18 + .../com/stripe/param/AccountCreateParams.java | 529 +-- .../stripe/param/AccountLinkCreateParams.java | 4 +- .../com/stripe/param/AccountListParams.java | 7 +- .../stripe/param/AccountPersonsParams.java | 6 +- .../com/stripe/param/AccountUpdateParams.java | 527 +-- .../param/ApplicationFeeListParams.java | 7 +- .../param/BalanceTransactionListParams.java | 14 +- .../stripe/param/CashBalanceUpdateParams.java | 9 +- .../com/stripe/param/ChargeCaptureParams.java | 6 +- .../com/stripe/param/ChargeCreateParams.java | 30 +- .../com/stripe/param/ChargeListParams.java | 6 +- .../com/stripe/param/ChargeUpdateParams.java | 27 +- .../com/stripe/param/CouponCreateParams.java | 22 +- .../com/stripe/param/CouponListParams.java | 6 +- .../com/stripe/param/CouponUpdateParams.java | 14 +- .../stripe/param/CreditNoteCreateParams.java | 18 +- .../stripe/param/CreditNotePreviewParams.java | 18 +- ...stomerCreateFundingInstructionsParams.java | 35 +- .../stripe/param/CustomerCreateParams.java | 104 +- .../com/stripe/param/CustomerListParams.java | 7 +- .../CustomerListPaymentMethodsParams.java | 2 +- .../stripe/param/CustomerUpdateParams.java | 88 +- .../com/stripe/param/DisputeListParams.java | 7 +- .../com/stripe/param/DisputeUpdateParams.java | 6 +- .../com/stripe/param/EventListParams.java | 6 +- .../param/ExternalAccountUpdateParams.java | 12 +- .../com/stripe/param/FileLinkListParams.java | 7 +- .../stripe/param/FileLinkUpdateParams.java | 2 +- .../com/stripe/param/InvoiceCreateParams.java | 255 +- .../stripe/param/InvoiceItemCreateParams.java | 24 +- .../stripe/param/InvoiceItemListParams.java | 7 +- .../stripe/param/InvoiceItemUpdateParams.java | 24 +- .../com/stripe/param/InvoiceListParams.java | 18 +- .../param/InvoiceUpcomingLinesParams.java | 3439 +++++++++++++++++ .../stripe/param/InvoiceUpcomingParams.java | 163 +- .../com/stripe/param/InvoiceUpdateParams.java | 245 +- .../param/PaymentIntentCancelParams.java | 3 +- .../param/PaymentIntentCaptureParams.java | 6 +- .../param/PaymentIntentConfirmParams.java | 997 +++-- .../param/PaymentIntentCreateParams.java | 993 +++-- ...entIntentIncrementAuthorizationParams.java | 29 +- .../stripe/param/PaymentIntentListParams.java | 7 +- .../param/PaymentIntentUpdateParams.java | 948 +++-- .../stripe/param/PaymentLinkCreateParams.java | 199 +- .../stripe/param/PaymentLinkUpdateParams.java | 88 +- .../param/PaymentMethodCreateParams.java | 230 +- .../stripe/param/PaymentMethodListParams.java | 2 +- .../param/PaymentMethodUpdateParams.java | 70 +- .../com/stripe/param/PayoutCreateParams.java | 4 +- .../com/stripe/param/PayoutListParams.java | 13 +- .../param/PersonCollectionCreateParams.java | 87 +- .../param/PersonCollectionListParams.java | 6 +- .../com/stripe/param/PersonUpdateParams.java | 85 +- .../com/stripe/param/PlanCreateParams.java | 40 +- .../java/com/stripe/param/PlanListParams.java | 6 +- .../com/stripe/param/PriceCreateParams.java | 93 +- .../com/stripe/param/PriceListParams.java | 18 +- .../com/stripe/param/PriceUpdateParams.java | 44 +- .../com/stripe/param/ProductCreateParams.java | 70 +- .../com/stripe/param/ProductListParams.java | 9 +- .../com/stripe/param/ProductUpdateParams.java | 6 +- .../param/PromotionCodeCreateParams.java | 23 +- .../stripe/param/PromotionCodeListParams.java | 7 +- .../param/PromotionCodeUpdateParams.java | 24 +- .../com/stripe/param/QuoteCreateParams.java | 78 +- .../com/stripe/param/QuoteListParams.java | 2 +- .../com/stripe/param/QuoteUpdateParams.java | 72 +- .../com/stripe/param/RefundCreateParams.java | 4 +- .../com/stripe/param/RefundListParams.java | 6 +- .../com/stripe/param/ReviewListParams.java | 6 +- .../stripe/param/SetupAttemptListParams.java | 7 +- .../stripe/param/SetupIntentCancelParams.java | 3 +- .../param/SetupIntentConfirmParams.java | 478 ++- .../stripe/param/SetupIntentCreateParams.java | 492 ++- .../stripe/param/SetupIntentListParams.java | 7 +- .../stripe/param/SetupIntentUpdateParams.java | 453 ++- .../param/ShippingRateCreateParams.java | 56 +- .../stripe/param/ShippingRateListParams.java | 7 +- .../param/ShippingRateUpdateParams.java | 29 +- .../com/stripe/param/SkuCreateParams.java | 28 +- .../com/stripe/param/SkuUpdateParams.java | 28 +- .../com/stripe/param/SourceCreateParams.java | 104 +- .../com/stripe/param/SourceUpdateParams.java | 85 +- .../param/SubscriptionCreateParams.java | 295 +- .../param/SubscriptionItemCreateParams.java | 32 +- .../param/SubscriptionItemDeleteParams.java | 3 +- .../param/SubscriptionItemUpdateParams.java | 32 +- .../stripe/param/SubscriptionListParams.java | 26 +- .../SubscriptionScheduleCreateParams.java | 172 +- .../param/SubscriptionScheduleListParams.java | 28 +- .../SubscriptionScheduleUpdateParams.java | 179 +- .../param/SubscriptionUpdateParams.java | 307 +- .../param/TaxIdCollectionCreateParams.java | 2 +- .../com/stripe/param/TaxRateCreateParams.java | 2 +- .../com/stripe/param/TaxRateListParams.java | 7 +- .../com/stripe/param/TaxRateUpdateParams.java | 2 +- .../com/stripe/param/TokenCreateParams.java | 255 +- .../com/stripe/param/TopupListParams.java | 14 +- .../stripe/param/TransferCreateParams.java | 2 +- .../com/stripe/param/TransferListParams.java | 7 +- ...eRecordCreateOnSubscriptionItemParams.java | 4 +- .../param/WebhookEndpointCreateParams.java | 12 +- .../param/WebhookEndpointUpdateParams.java | 10 +- .../stripe/param/apps/SecretCreateParams.java | 8 +- .../param/apps/SecretDeleteWhereParams.java | 8 +- .../stripe/param/apps/SecretFindParams.java | 8 +- .../stripe/param/apps/SecretListParams.java | 8 +- .../ConfigurationCreateParams.java | 129 +- .../ConfigurationUpdateParams.java | 129 +- .../billingportal/SessionCreateParams.java | 2 +- .../param/checkout/SessionCreateParams.java | 943 ++--- .../param/checkout/SessionListParams.java | 6 +- .../AccountListParams.java | 6 +- .../AccountRefreshParams.java | 17 +- .../SessionCreateParams.java | 25 +- .../VerificationReportListParams.java | 9 +- .../VerificationSessionCreateParams.java | 26 +- .../VerificationSessionListParams.java | 9 +- .../VerificationSessionUpdateParams.java | 26 +- .../issuing/AuthorizationListParams.java | 9 +- .../param/issuing/CardCreateParams.java | 87 +- .../stripe/param/issuing/CardListParams.java | 10 +- .../param/issuing/CardUpdateParams.java | 69 +- .../param/issuing/CardholderCreateParams.java | 112 +- .../param/issuing/CardholderListParams.java | 11 +- .../param/issuing/CardholderUpdateParams.java | 110 +- .../param/issuing/DisputeCreateParams.java | 126 +- .../param/issuing/DisputeListParams.java | 9 +- .../param/issuing/DisputeUpdateParams.java | 125 +- .../param/issuing/TransactionListParams.java | 9 +- .../param/radar/ValueListCreateParams.java | 2 +- .../param/radar/ValueListItemListParams.java | 7 +- .../param/radar/ValueListListParams.java | 7 +- .../reporting/ReportRunCreateParams.java | 11 +- .../param/reporting/ReportRunListParams.java | 7 +- .../terminal/ConfigurationCreateParams.java | 102 +- .../terminal/ConfigurationUpdateParams.java | 102 +- .../param/terminal/LocationCreateParams.java | 6 +- .../param/terminal/LocationUpdateParams.java | 6 +- .../param/terminal/ReaderListParams.java | 4 +- .../ReaderPresentPaymentMethodParams.java | 8 +- .../ReaderProcessPaymentIntentParams.java | 7 +- .../ReaderSetReaderDisplayParams.java | 24 +- .../treasury/CreditReversalListParams.java | 2 +- .../treasury/DebitReversalListParams.java | 4 +- .../FinancialAccountCreateParams.java | 119 +- .../treasury/FinancialAccountListParams.java | 7 +- .../FinancialAccountUpdateFeaturesParams.java | 99 +- .../FinancialAccountUpdateParams.java | 119 +- .../treasury/InboundTransferFailParams.java | 8 +- .../treasury/InboundTransferListParams.java | 2 +- .../treasury/OutboundPaymentCreateParams.java | 67 +- .../treasury/OutboundPaymentListParams.java | 2 +- ...undPaymentReturnOutboundPaymentParams.java | 10 +- .../OutboundTransferCreateParams.java | 21 +- .../treasury/OutboundTransferListParams.java | 2 +- ...dTransferReturnOutboundTransferParams.java | 11 +- .../treasury/ReceivedCreditCreateParams.java | 18 +- .../treasury/ReceivedCreditListParams.java | 11 +- .../treasury/ReceivedDebitCreateParams.java | 18 +- .../treasury/ReceivedDebitListParams.java | 2 +- .../treasury/TransactionEntryListParams.java | 16 +- .../param/treasury/TransactionListParams.java | 24 +- 168 files changed, 10918 insertions(+), 5203 deletions(-) create mode 100644 src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 9ea0390f9e6..72833e6d4c3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v192 \ No newline at end of file +v196 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index 268b474b90f..4706ce90425 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -15,6 +15,7 @@ import com.stripe.param.InvoiceRetrieveParams; import com.stripe.param.InvoiceSearchParams; import com.stripe.param.InvoiceSendInvoiceParams; +import com.stripe.param.InvoiceUpcomingLinesParams; import com.stripe.param.InvoiceUpcomingParams; import com.stripe.param.InvoiceUpdateParams; import com.stripe.param.InvoiceVoidInvoiceParams; @@ -1481,6 +1482,57 @@ public static Invoice upcoming(InvoiceUpcomingParams params, RequestOptions opti return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options); } + /** + * When retrieving an upcoming invoice, you’ll get a lines property containing + * the total count of line items and the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + */ + public static InvoiceLineItemCollection upcomingLines() throws StripeException { + return upcomingLines((Map) null, (RequestOptions) null); + } + + /** + * When retrieving an upcoming invoice, you’ll get a lines property containing + * the total count of line items and the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + */ + public static InvoiceLineItemCollection upcomingLines(Map params) + throws StripeException { + return upcomingLines(params, (RequestOptions) null); + } + + /** + * When retrieving an upcoming invoice, you’ll get a lines property containing + * the total count of line items and the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + */ + public static InvoiceLineItemCollection upcomingLines( + Map params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/upcoming/lines"); + return ApiResource.requestCollection(url, params, InvoiceLineItemCollection.class, options); + } + + /** + * When retrieving an upcoming invoice, you’ll get a lines property containing + * the total count of line items and the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + */ + public static InvoiceLineItemCollection upcomingLines(InvoiceUpcomingLinesParams params) + throws StripeException { + return upcomingLines(params, (RequestOptions) null); + } + + /** + * When retrieving an upcoming invoice, you’ll get a lines property containing + * the total count of line items and the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + */ + public static InvoiceLineItemCollection upcomingLines( + InvoiceUpcomingLinesParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/upcoming/lines"); + return ApiResource.requestCollection(url, params, InvoiceLineItemCollection.class, options); + } + /** * Draft invoices are fully editable. Once an invoice is finalized, monetary diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 478ca9bffc1..ecf2cf7d334 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -1534,11 +1534,11 @@ public static class PixDisplayQrCode extends StripeObject { @SerializedName("hosted_instructions_url") String hostedInstructionsUrl; - /** ​​The image_url_png string used to render png QR code. */ + /** The image_url_png string used to render png QR code. */ @SerializedName("image_url_png") String imageUrlPng; - /** ​​The image_url_svg string used to render svg QR code. */ + /** The image_url_svg string used to render svg QR code. */ @SerializedName("image_url_svg") String imageUrlSvg; } diff --git a/src/main/java/com/stripe/model/PaymentLink.java b/src/main/java/com/stripe/model/PaymentLink.java index 29bdb848ed6..2fa2e8f5213 100644 --- a/src/main/java/com/stripe/model/PaymentLink.java +++ b/src/main/java/com/stripe/model/PaymentLink.java @@ -456,6 +456,16 @@ public static class ConsentCollection extends StripeObject { */ @SerializedName("promotions") String promotions; + + /** + * If set to {@code required}, it requires cutomers to accept the terms of service before being + * able to pay. If set to {@code none}, customers won't be shown a checkbox to accept the terms + * of service. + * + *

One of {@code none}, or {@code required}. + */ + @SerializedName("terms_of_service") + String termsOfService; } @Getter diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index 9caadc86398..151ca6c4cc5 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -691,6 +691,15 @@ public static class Consent extends StripeObject { */ @SerializedName("promotions") String promotions; + + /** + * If {@code accepted}, the customer in this Checkout Session has agreed to the merchant's terms + * of service. + * + *

Equal to {@code accepted}. + */ + @SerializedName("terms_of_service") + String termsOfService; } @Getter @@ -707,6 +716,15 @@ public static class ConsentCollection extends StripeObject { */ @SerializedName("promotions") String promotions; + + /** + * If set to {@code required}, it requires customers to accept the terms of service before being + * able to pay. + * + *

One of {@code none}, or {@code required}. + */ + @SerializedName("terms_of_service") + String termsOfService; } @Getter diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index 40914e9584e..398b84d5c0a 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -247,13 +246,13 @@ public Builder setAccountToken(String accountToken) { } /** Business information about the account. */ - public Builder setBusinessProfile(BusinessProfile businessProfile) { + public Builder setBusinessProfile(AccountCreateParams.BusinessProfile businessProfile) { this.businessProfile = businessProfile; return this; } /** The business type. */ - public Builder setBusinessType(BusinessType businessType) { + public Builder setBusinessType(AccountCreateParams.BusinessType businessType) { this.businessType = businessType; return this; } @@ -264,7 +263,7 @@ public Builder setBusinessType(BusinessType businessType) { * provided its specific requirements and Stripe has verified them. An account may have some of * its requested capabilities be active and some be inactive. */ - public Builder setCapabilities(Capabilities capabilities) { + public Builder setCapabilities(AccountCreateParams.Capabilities capabilities) { this.capabilities = capabilities; return this; } @@ -273,7 +272,7 @@ public Builder setCapabilities(Capabilities capabilities) { * Information about the company or business. This field is available for any {@code * business_type}. */ - public Builder setCompany(Company company) { + public Builder setCompany(AccountCreateParams.Company company) { this.company = company; return this; } @@ -304,7 +303,7 @@ public Builder setDefaultCurrency(String defaultCurrency) { } /** Documents that may be submitted to satisfy various informational requests. */ - public Builder setDocuments(Documents documents) { + public Builder setDocuments(AccountCreateParams.Documents documents) { this.documents = documents; return this; } @@ -392,7 +391,7 @@ public Builder putAllExtraParam(Map map) { * Information about the person represented by the account. This field is null unless {@code * business_type} is set to {@code individual}. */ - public Builder setIndividual(Individual individual) { + public Builder setIndividual(AccountCreateParams.Individual individual) { this.individual = individual; return this; } @@ -448,7 +447,7 @@ public Builder setMetadata(Map metadata) { } /** Options for customizing how the account functions within Stripe. */ - public Builder setSettings(Settings settings) { + public Builder setSettings(AccountCreateParams.Settings settings) { this.settings = settings; return this; } @@ -458,7 +457,7 @@ public Builder setSettings(Settings settings) { * href="https://stripe.com/docs/connect/updating-accounts#tos-acceptance">Stripe Services * Agreement. */ - public Builder setTosAcceptance(TosAcceptance tosAcceptance) { + public Builder setTosAcceptance(AccountCreateParams.TosAcceptance tosAcceptance) { this.tosAcceptance = tosAcceptance; return this; } @@ -467,7 +466,7 @@ public Builder setTosAcceptance(TosAcceptance tosAcceptance) { * The type of Stripe account to create. May be one of {@code custom}, {@code express} or {@code * standard}. */ - public Builder setType(Type type) { + public Builder setType(AccountCreateParams.Type type) { this.type = type; return this; } @@ -568,8 +567,8 @@ public static class Builder { private String url; /** Finalize and obtain parameter instance from this builder. */ - public BusinessProfile build() { - return new BusinessProfile( + public AccountCreateParams.BusinessProfile build() { + return new AccountCreateParams.BusinessProfile( this.extraParams, this.mcc, this.name, @@ -633,7 +632,8 @@ public Builder setProductDescription(String productDescription) { } /** A publicly available mailing address for sending support issues to. */ - public Builder setSupportAddress(SupportAddress supportAddress) { + public Builder setSupportAddress( + AccountCreateParams.BusinessProfile.SupportAddress supportAddress) { this.supportAddress = supportAddress; return this; } @@ -744,8 +744,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public SupportAddress build() { - return new SupportAddress( + public AccountCreateParams.BusinessProfile.SupportAddress build() { + return new AccountCreateParams.BusinessProfile.SupportAddress( this.city, this.country, this.extraParams, @@ -1113,8 +1113,8 @@ public static class Builder { private UsBankAccountAchPayments usBankAccountAchPayments; /** Finalize and obtain parameter instance from this builder. */ - public Capabilities build() { - return new Capabilities( + public AccountCreateParams.Capabilities build() { + return new AccountCreateParams.Capabilities( this.acssDebitPayments, this.affirmPayments, this.afterpayClearpayPayments, @@ -1152,80 +1152,88 @@ public Capabilities build() { } /** The acss_debit_payments capability. */ - public Builder setAcssDebitPayments(AcssDebitPayments acssDebitPayments) { + public Builder setAcssDebitPayments( + AccountCreateParams.Capabilities.AcssDebitPayments acssDebitPayments) { this.acssDebitPayments = acssDebitPayments; return this; } /** The affirm_payments capability. */ - public Builder setAffirmPayments(AffirmPayments affirmPayments) { + public Builder setAffirmPayments( + AccountCreateParams.Capabilities.AffirmPayments affirmPayments) { this.affirmPayments = affirmPayments; return this; } /** The afterpay_clearpay_payments capability. */ public Builder setAfterpayClearpayPayments( - AfterpayClearpayPayments afterpayClearpayPayments) { + AccountCreateParams.Capabilities.AfterpayClearpayPayments afterpayClearpayPayments) { this.afterpayClearpayPayments = afterpayClearpayPayments; return this; } /** The au_becs_debit_payments capability. */ - public Builder setAuBecsDebitPayments(AuBecsDebitPayments auBecsDebitPayments) { + public Builder setAuBecsDebitPayments( + AccountCreateParams.Capabilities.AuBecsDebitPayments auBecsDebitPayments) { this.auBecsDebitPayments = auBecsDebitPayments; return this; } /** The bacs_debit_payments capability. */ - public Builder setBacsDebitPayments(BacsDebitPayments bacsDebitPayments) { + public Builder setBacsDebitPayments( + AccountCreateParams.Capabilities.BacsDebitPayments bacsDebitPayments) { this.bacsDebitPayments = bacsDebitPayments; return this; } /** The bancontact_payments capability. */ - public Builder setBancontactPayments(BancontactPayments bancontactPayments) { + public Builder setBancontactPayments( + AccountCreateParams.Capabilities.BancontactPayments bancontactPayments) { this.bancontactPayments = bancontactPayments; return this; } /** The bank_transfer_payments capability. */ - public Builder setBankTransferPayments(BankTransferPayments bankTransferPayments) { + public Builder setBankTransferPayments( + AccountCreateParams.Capabilities.BankTransferPayments bankTransferPayments) { this.bankTransferPayments = bankTransferPayments; return this; } /** The blik_payments capability. */ - public Builder setBlikPayments(BlikPayments blikPayments) { + public Builder setBlikPayments(AccountCreateParams.Capabilities.BlikPayments blikPayments) { this.blikPayments = blikPayments; return this; } /** The boleto_payments capability. */ - public Builder setBoletoPayments(BoletoPayments boletoPayments) { + public Builder setBoletoPayments( + AccountCreateParams.Capabilities.BoletoPayments boletoPayments) { this.boletoPayments = boletoPayments; return this; } /** The card_issuing capability. */ - public Builder setCardIssuing(CardIssuing cardIssuing) { + public Builder setCardIssuing(AccountCreateParams.Capabilities.CardIssuing cardIssuing) { this.cardIssuing = cardIssuing; return this; } /** The card_payments capability. */ - public Builder setCardPayments(CardPayments cardPayments) { + public Builder setCardPayments(AccountCreateParams.Capabilities.CardPayments cardPayments) { this.cardPayments = cardPayments; return this; } /** The cartes_bancaires_payments capability. */ - public Builder setCartesBancairesPayments(CartesBancairesPayments cartesBancairesPayments) { + public Builder setCartesBancairesPayments( + AccountCreateParams.Capabilities.CartesBancairesPayments cartesBancairesPayments) { this.cartesBancairesPayments = cartesBancairesPayments; return this; } /** The eps_payments capability. */ - public Builder setEpsPayments(EpsPayments epsPayments) { + public Builder setEpsPayments(AccountCreateParams.Capabilities.EpsPayments epsPayments) { this.epsPayments = epsPayments; return this; } @@ -1257,122 +1265,134 @@ public Builder putAllExtraParam(Map map) { } /** The fpx_payments capability. */ - public Builder setFpxPayments(FpxPayments fpxPayments) { + public Builder setFpxPayments(AccountCreateParams.Capabilities.FpxPayments fpxPayments) { this.fpxPayments = fpxPayments; return this; } /** The giropay_payments capability. */ - public Builder setGiropayPayments(GiropayPayments giropayPayments) { + public Builder setGiropayPayments( + AccountCreateParams.Capabilities.GiropayPayments giropayPayments) { this.giropayPayments = giropayPayments; return this; } /** The grabpay_payments capability. */ - public Builder setGrabpayPayments(GrabpayPayments grabpayPayments) { + public Builder setGrabpayPayments( + AccountCreateParams.Capabilities.GrabpayPayments grabpayPayments) { this.grabpayPayments = grabpayPayments; return this; } /** The ideal_payments capability. */ - public Builder setIdealPayments(IdealPayments idealPayments) { + public Builder setIdealPayments( + AccountCreateParams.Capabilities.IdealPayments idealPayments) { this.idealPayments = idealPayments; return this; } /** The jcb_payments capability. */ - public Builder setJcbPayments(JcbPayments jcbPayments) { + public Builder setJcbPayments(AccountCreateParams.Capabilities.JcbPayments jcbPayments) { this.jcbPayments = jcbPayments; return this; } /** The klarna_payments capability. */ - public Builder setKlarnaPayments(KlarnaPayments klarnaPayments) { + public Builder setKlarnaPayments( + AccountCreateParams.Capabilities.KlarnaPayments klarnaPayments) { this.klarnaPayments = klarnaPayments; return this; } /** The konbini_payments capability. */ - public Builder setKonbiniPayments(KonbiniPayments konbiniPayments) { + public Builder setKonbiniPayments( + AccountCreateParams.Capabilities.KonbiniPayments konbiniPayments) { this.konbiniPayments = konbiniPayments; return this; } /** The legacy_payments capability. */ - public Builder setLegacyPayments(LegacyPayments legacyPayments) { + public Builder setLegacyPayments( + AccountCreateParams.Capabilities.LegacyPayments legacyPayments) { this.legacyPayments = legacyPayments; return this; } /** The link_payments capability. */ - public Builder setLinkPayments(LinkPayments linkPayments) { + public Builder setLinkPayments(AccountCreateParams.Capabilities.LinkPayments linkPayments) { this.linkPayments = linkPayments; return this; } /** The oxxo_payments capability. */ - public Builder setOxxoPayments(OxxoPayments oxxoPayments) { + public Builder setOxxoPayments(AccountCreateParams.Capabilities.OxxoPayments oxxoPayments) { this.oxxoPayments = oxxoPayments; return this; } /** The p24_payments capability. */ - public Builder setP24Payments(P24Payments p24Payments) { + public Builder setP24Payments(AccountCreateParams.Capabilities.P24Payments p24Payments) { this.p24Payments = p24Payments; return this; } /** The paynow_payments capability. */ - public Builder setPaynowPayments(PaynowPayments paynowPayments) { + public Builder setPaynowPayments( + AccountCreateParams.Capabilities.PaynowPayments paynowPayments) { this.paynowPayments = paynowPayments; return this; } /** The promptpay_payments capability. */ - public Builder setPromptpayPayments(PromptpayPayments promptpayPayments) { + public Builder setPromptpayPayments( + AccountCreateParams.Capabilities.PromptpayPayments promptpayPayments) { this.promptpayPayments = promptpayPayments; return this; } /** The sepa_debit_payments capability. */ - public Builder setSepaDebitPayments(SepaDebitPayments sepaDebitPayments) { + public Builder setSepaDebitPayments( + AccountCreateParams.Capabilities.SepaDebitPayments sepaDebitPayments) { this.sepaDebitPayments = sepaDebitPayments; return this; } /** The sofort_payments capability. */ - public Builder setSofortPayments(SofortPayments sofortPayments) { + public Builder setSofortPayments( + AccountCreateParams.Capabilities.SofortPayments sofortPayments) { this.sofortPayments = sofortPayments; return this; } /** The tax_reporting_us_1099_k capability. */ - public Builder setTaxReportingUs1099K(TaxReportingUs1099K taxReportingUs1099K) { + public Builder setTaxReportingUs1099K( + AccountCreateParams.Capabilities.TaxReportingUs1099K taxReportingUs1099K) { this.taxReportingUs1099K = taxReportingUs1099K; return this; } /** The tax_reporting_us_1099_misc capability. */ - public Builder setTaxReportingUs1099Misc(TaxReportingUs1099Misc taxReportingUs1099Misc) { + public Builder setTaxReportingUs1099Misc( + AccountCreateParams.Capabilities.TaxReportingUs1099Misc taxReportingUs1099Misc) { this.taxReportingUs1099Misc = taxReportingUs1099Misc; return this; } /** The transfers capability. */ - public Builder setTransfers(Transfers transfers) { + public Builder setTransfers(AccountCreateParams.Capabilities.Transfers transfers) { this.transfers = transfers; return this; } /** The treasury capability. */ - public Builder setTreasury(Treasury treasury) { + public Builder setTreasury(AccountCreateParams.Capabilities.Treasury treasury) { this.treasury = treasury; return this; } /** The us_bank_account_ach_payments capability. */ public Builder setUsBankAccountAchPayments( - UsBankAccountAchPayments usBankAccountAchPayments) { + AccountCreateParams.Capabilities.UsBankAccountAchPayments usBankAccountAchPayments) { this.usBankAccountAchPayments = usBankAccountAchPayments; return this; } @@ -1412,8 +1432,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebitPayments build() { - return new AcssDebitPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.AcssDebitPayments build() { + return new AccountCreateParams.Capabilities.AcssDebitPayments( + this.extraParams, this.requested); } /** @@ -1490,8 +1511,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public AffirmPayments build() { - return new AffirmPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.AffirmPayments build() { + return new AccountCreateParams.Capabilities.AffirmPayments( + this.extraParams, this.requested); } /** @@ -1568,8 +1590,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpayPayments build() { - return new AfterpayClearpayPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.AfterpayClearpayPayments build() { + return new AccountCreateParams.Capabilities.AfterpayClearpayPayments( + this.extraParams, this.requested); } /** @@ -1646,8 +1669,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebitPayments build() { - return new AuBecsDebitPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.AuBecsDebitPayments build() { + return new AccountCreateParams.Capabilities.AuBecsDebitPayments( + this.extraParams, this.requested); } /** @@ -1724,8 +1748,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebitPayments build() { - return new BacsDebitPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.BacsDebitPayments build() { + return new AccountCreateParams.Capabilities.BacsDebitPayments( + this.extraParams, this.requested); } /** @@ -1802,8 +1827,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public BancontactPayments build() { - return new BancontactPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.BancontactPayments build() { + return new AccountCreateParams.Capabilities.BancontactPayments( + this.extraParams, this.requested); } /** @@ -1880,8 +1906,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public BankTransferPayments build() { - return new BankTransferPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.BankTransferPayments build() { + return new AccountCreateParams.Capabilities.BankTransferPayments( + this.extraParams, this.requested); } /** @@ -1958,8 +1985,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public BlikPayments build() { - return new BlikPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.BlikPayments build() { + return new AccountCreateParams.Capabilities.BlikPayments( + this.extraParams, this.requested); } /** @@ -2036,8 +2064,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public BoletoPayments build() { - return new BoletoPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.BoletoPayments build() { + return new AccountCreateParams.Capabilities.BoletoPayments( + this.extraParams, this.requested); } /** @@ -2114,8 +2143,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public CardIssuing build() { - return new CardIssuing(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.CardIssuing build() { + return new AccountCreateParams.Capabilities.CardIssuing(this.extraParams, this.requested); } /** @@ -2192,8 +2221,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public CardPayments build() { - return new CardPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.CardPayments build() { + return new AccountCreateParams.Capabilities.CardPayments( + this.extraParams, this.requested); } /** @@ -2270,8 +2300,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public CartesBancairesPayments build() { - return new CartesBancairesPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.CartesBancairesPayments build() { + return new AccountCreateParams.Capabilities.CartesBancairesPayments( + this.extraParams, this.requested); } /** @@ -2348,8 +2379,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public EpsPayments build() { - return new EpsPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.EpsPayments build() { + return new AccountCreateParams.Capabilities.EpsPayments(this.extraParams, this.requested); } /** @@ -2426,8 +2457,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public FpxPayments build() { - return new FpxPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.FpxPayments build() { + return new AccountCreateParams.Capabilities.FpxPayments(this.extraParams, this.requested); } /** @@ -2504,8 +2535,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public GiropayPayments build() { - return new GiropayPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.GiropayPayments build() { + return new AccountCreateParams.Capabilities.GiropayPayments( + this.extraParams, this.requested); } /** @@ -2582,8 +2614,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public GrabpayPayments build() { - return new GrabpayPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.GrabpayPayments build() { + return new AccountCreateParams.Capabilities.GrabpayPayments( + this.extraParams, this.requested); } /** @@ -2660,8 +2693,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public IdealPayments build() { - return new IdealPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.IdealPayments build() { + return new AccountCreateParams.Capabilities.IdealPayments( + this.extraParams, this.requested); } /** @@ -2738,8 +2772,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public JcbPayments build() { - return new JcbPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.JcbPayments build() { + return new AccountCreateParams.Capabilities.JcbPayments(this.extraParams, this.requested); } /** @@ -2816,8 +2850,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public KlarnaPayments build() { - return new KlarnaPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.KlarnaPayments build() { + return new AccountCreateParams.Capabilities.KlarnaPayments( + this.extraParams, this.requested); } /** @@ -2894,8 +2929,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public KonbiniPayments build() { - return new KonbiniPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.KonbiniPayments build() { + return new AccountCreateParams.Capabilities.KonbiniPayments( + this.extraParams, this.requested); } /** @@ -2972,8 +3008,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public LegacyPayments build() { - return new LegacyPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.LegacyPayments build() { + return new AccountCreateParams.Capabilities.LegacyPayments( + this.extraParams, this.requested); } /** @@ -3050,8 +3087,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public LinkPayments build() { - return new LinkPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.LinkPayments build() { + return new AccountCreateParams.Capabilities.LinkPayments( + this.extraParams, this.requested); } /** @@ -3128,8 +3166,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public OxxoPayments build() { - return new OxxoPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.OxxoPayments build() { + return new AccountCreateParams.Capabilities.OxxoPayments( + this.extraParams, this.requested); } /** @@ -3206,8 +3245,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public P24Payments build() { - return new P24Payments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.P24Payments build() { + return new AccountCreateParams.Capabilities.P24Payments(this.extraParams, this.requested); } /** @@ -3284,8 +3323,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public PaynowPayments build() { - return new PaynowPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.PaynowPayments build() { + return new AccountCreateParams.Capabilities.PaynowPayments( + this.extraParams, this.requested); } /** @@ -3362,8 +3402,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public PromptpayPayments build() { - return new PromptpayPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.PromptpayPayments build() { + return new AccountCreateParams.Capabilities.PromptpayPayments( + this.extraParams, this.requested); } /** @@ -3440,8 +3481,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebitPayments build() { - return new SepaDebitPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.SepaDebitPayments build() { + return new AccountCreateParams.Capabilities.SepaDebitPayments( + this.extraParams, this.requested); } /** @@ -3518,8 +3560,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public SofortPayments build() { - return new SofortPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.SofortPayments build() { + return new AccountCreateParams.Capabilities.SofortPayments( + this.extraParams, this.requested); } /** @@ -3596,8 +3639,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public TaxReportingUs1099K build() { - return new TaxReportingUs1099K(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.TaxReportingUs1099K build() { + return new AccountCreateParams.Capabilities.TaxReportingUs1099K( + this.extraParams, this.requested); } /** @@ -3674,8 +3718,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public TaxReportingUs1099Misc build() { - return new TaxReportingUs1099Misc(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.TaxReportingUs1099Misc build() { + return new AccountCreateParams.Capabilities.TaxReportingUs1099Misc( + this.extraParams, this.requested); } /** @@ -3752,8 +3797,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Transfers build() { - return new Transfers(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.Transfers build() { + return new AccountCreateParams.Capabilities.Transfers(this.extraParams, this.requested); } /** @@ -3830,8 +3875,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Treasury build() { - return new Treasury(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.Treasury build() { + return new AccountCreateParams.Capabilities.Treasury(this.extraParams, this.requested); } /** @@ -3908,8 +3953,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccountAchPayments build() { - return new UsBankAccountAchPayments(this.extraParams, this.requested); + public AccountCreateParams.Capabilities.UsBankAccountAchPayments build() { + return new AccountCreateParams.Capabilities.UsBankAccountAchPayments( + this.extraParams, this.requested); } /** @@ -4040,7 +4086,7 @@ public static class Company { * structure for more details. */ @SerializedName("structure") - EnumParam structure; + ApiRequestParams.EnumParam structure; /** * The business ID number of the company, as appropriate for the company’s country. (Examples @@ -4078,7 +4124,7 @@ private Company( OwnershipDeclaration ownershipDeclaration, String phone, String registrationNumber, - EnumParam structure, + ApiRequestParams.EnumParam structure, String taxId, String taxIdRegistrar, String vatId, @@ -4134,7 +4180,7 @@ public static class Builder { private String registrationNumber; - private EnumParam structure; + private ApiRequestParams.EnumParam structure; private String taxId; @@ -4145,8 +4191,8 @@ public static class Builder { private Verification verification; /** Finalize and obtain parameter instance from this builder. */ - public Company build() { - return new Company( + public AccountCreateParams.Company build() { + return new AccountCreateParams.Company( this.address, this.addressKana, this.addressKanji, @@ -4168,19 +4214,19 @@ public Company build() { } /** The company's primary address. */ - public Builder setAddress(Address address) { + public Builder setAddress(AccountCreateParams.Company.Address address) { this.address = address; return this; } /** The Kana variation of the company's primary address (Japan only). */ - public Builder setAddressKana(AddressKana addressKana) { + public Builder setAddressKana(AccountCreateParams.Company.AddressKana addressKana) { this.addressKana = addressKana; return this; } /** The Kanji variation of the company's primary address (Japan only). */ - public Builder setAddressKanji(AddressKanji addressKanji) { + public Builder setAddressKanji(AccountCreateParams.Company.AddressKanji addressKanji) { this.addressKanji = addressKanji; return this; } @@ -4266,7 +4312,8 @@ public Builder setOwnersProvided(Boolean ownersProvided) { * This hash is used to attest that the beneficial owner information provided to Stripe is * both current and correct. */ - public Builder setOwnershipDeclaration(OwnershipDeclaration ownershipDeclaration) { + public Builder setOwnershipDeclaration( + AccountCreateParams.Company.OwnershipDeclaration ownershipDeclaration) { this.ownershipDeclaration = ownershipDeclaration; return this; } @@ -4293,7 +4340,7 @@ public Builder setRegistrationNumber(String registrationNumber) { * href="https://stripe.com/docs/connect/identity-verification#business-structure">Business * structure for more details. */ - public Builder setStructure(Structure structure) { + public Builder setStructure(AccountCreateParams.Company.Structure structure) { this.structure = structure; return this; } @@ -4333,7 +4380,7 @@ public Builder setVatId(String vatId) { } /** Information on the verification state of the company. */ - public Builder setVerification(Verification verification) { + public Builder setVerification(AccountCreateParams.Company.Verification verification) { this.verification = verification; return this; } @@ -4414,8 +4461,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public AccountCreateParams.Company.Address build() { + return new AccountCreateParams.Company.Address( this.city, this.country, this.extraParams, @@ -4577,8 +4624,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKana build() { - return new AddressKana( + public AccountCreateParams.Company.AddressKana build() { + return new AccountCreateParams.Company.AddressKana( this.city, this.country, this.extraParams, @@ -4747,8 +4794,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKanji build() { - return new AddressKanji( + public AccountCreateParams.Company.AddressKanji build() { + return new AccountCreateParams.Company.AddressKanji( this.city, this.country, this.extraParams, @@ -4879,8 +4926,9 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public OwnershipDeclaration build() { - return new OwnershipDeclaration(this.date, this.extraParams, this.ip, this.userAgent); + public AccountCreateParams.Company.OwnershipDeclaration build() { + return new AccountCreateParams.Company.OwnershipDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); } /** The Unix timestamp marking when the beneficial owner attestation was made. */ @@ -4961,12 +5009,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Verification build() { - return new Verification(this.document, this.extraParams); + public AccountCreateParams.Company.Verification build() { + return new AccountCreateParams.Company.Verification(this.document, this.extraParams); } /** A document verifying the business. */ - public Builder setDocument(Document document) { + public Builder setDocument(AccountCreateParams.Company.Verification.Document document) { this.document = document; return this; } @@ -5050,8 +5098,9 @@ public static class Builder { private String front; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document(this.back, this.extraParams, this.front); + public AccountCreateParams.Company.Verification.Document build() { + return new AccountCreateParams.Company.Verification.Document( + this.back, this.extraParams, this.front); } /** @@ -5274,8 +5323,8 @@ public static class Builder { private ProofOfRegistration proofOfRegistration; /** Finalize and obtain parameter instance from this builder. */ - public Documents build() { - return new Documents( + public AccountCreateParams.Documents build() { + return new AccountCreateParams.Documents( this.bankAccountOwnershipVerification, this.companyLicense, this.companyMemorandumOfAssociation, @@ -5294,20 +5343,23 @@ public Documents build() { * number, either a statement or a voided check. */ public Builder setBankAccountOwnershipVerification( - BankAccountOwnershipVerification bankAccountOwnershipVerification) { + AccountCreateParams.Documents.BankAccountOwnershipVerification + bankAccountOwnershipVerification) { this.bankAccountOwnershipVerification = bankAccountOwnershipVerification; return this; } /** One or more documents that demonstrate proof of a company's license to operate. */ - public Builder setCompanyLicense(CompanyLicense companyLicense) { + public Builder setCompanyLicense( + AccountCreateParams.Documents.CompanyLicense companyLicense) { this.companyLicense = companyLicense; return this; } /** One or more documents showing the company's Memorandum of Association. */ public Builder setCompanyMemorandumOfAssociation( - CompanyMemorandumOfAssociation companyMemorandumOfAssociation) { + AccountCreateParams.Documents.CompanyMemorandumOfAssociation + companyMemorandumOfAssociation) { this.companyMemorandumOfAssociation = companyMemorandumOfAssociation; return this; } @@ -5317,7 +5369,7 @@ public Builder setCompanyMemorandumOfAssociation( * the company's establishment. */ public Builder setCompanyMinisterialDecree( - CompanyMinisterialDecree companyMinisterialDecree) { + AccountCreateParams.Documents.CompanyMinisterialDecree companyMinisterialDecree) { this.companyMinisterialDecree = companyMinisterialDecree; return this; } @@ -5327,14 +5379,15 @@ public Builder setCompanyMinisterialDecree( * appropriate local authorities. */ public Builder setCompanyRegistrationVerification( - CompanyRegistrationVerification companyRegistrationVerification) { + AccountCreateParams.Documents.CompanyRegistrationVerification + companyRegistrationVerification) { this.companyRegistrationVerification = companyRegistrationVerification; return this; } /** One or more documents that demonstrate proof of a company's tax ID. */ public Builder setCompanyTaxIdVerification( - CompanyTaxIdVerification companyTaxIdVerification) { + AccountCreateParams.Documents.CompanyTaxIdVerification companyTaxIdVerification) { this.companyTaxIdVerification = companyTaxIdVerification; return this; } @@ -5369,7 +5422,8 @@ public Builder putAllExtraParam(Map map) { * One or more documents showing the company’s proof of registration with the national * business registry. */ - public Builder setProofOfRegistration(ProofOfRegistration proofOfRegistration) { + public Builder setProofOfRegistration( + AccountCreateParams.Documents.ProofOfRegistration proofOfRegistration) { this.proofOfRegistration = proofOfRegistration; return this; } @@ -5410,8 +5464,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public BankAccountOwnershipVerification build() { - return new BankAccountOwnershipVerification(this.extraParams, this.files); + public AccountCreateParams.Documents.BankAccountOwnershipVerification build() { + return new AccountCreateParams.Documents.BankAccountOwnershipVerification( + this.extraParams, this.files); } /** @@ -5508,8 +5563,8 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyLicense build() { - return new CompanyLicense(this.extraParams, this.files); + public AccountCreateParams.Documents.CompanyLicense build() { + return new AccountCreateParams.Documents.CompanyLicense(this.extraParams, this.files); } /** @@ -5602,8 +5657,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyMemorandumOfAssociation build() { - return new CompanyMemorandumOfAssociation(this.extraParams, this.files); + public AccountCreateParams.Documents.CompanyMemorandumOfAssociation build() { + return new AccountCreateParams.Documents.CompanyMemorandumOfAssociation( + this.extraParams, this.files); } /** @@ -5698,8 +5754,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyMinisterialDecree build() { - return new CompanyMinisterialDecree(this.extraParams, this.files); + public AccountCreateParams.Documents.CompanyMinisterialDecree build() { + return new AccountCreateParams.Documents.CompanyMinisterialDecree( + this.extraParams, this.files); } /** @@ -5794,8 +5851,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyRegistrationVerification build() { - return new CompanyRegistrationVerification(this.extraParams, this.files); + public AccountCreateParams.Documents.CompanyRegistrationVerification build() { + return new AccountCreateParams.Documents.CompanyRegistrationVerification( + this.extraParams, this.files); } /** @@ -5892,8 +5950,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyTaxIdVerification build() { - return new CompanyTaxIdVerification(this.extraParams, this.files); + public AccountCreateParams.Documents.CompanyTaxIdVerification build() { + return new AccountCreateParams.Documents.CompanyTaxIdVerification( + this.extraParams, this.files); } /** @@ -5988,8 +6047,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public ProofOfRegistration build() { - return new ProofOfRegistration(this.extraParams, this.files); + public AccountCreateParams.Documents.ProofOfRegistration build() { + return new AccountCreateParams.Documents.ProofOfRegistration( + this.extraParams, this.files); } /** @@ -6274,8 +6334,8 @@ public static class Builder { private Verification verification; /** Finalize and obtain parameter instance from this builder. */ - public Individual build() { - return new Individual( + public AccountCreateParams.Individual build() { + return new AccountCreateParams.Individual( this.address, this.addressKana, this.addressKanji, @@ -6302,25 +6362,25 @@ public Individual build() { } /** The individual's primary address. */ - public Builder setAddress(Address address) { + public Builder setAddress(AccountCreateParams.Individual.Address address) { this.address = address; return this; } /** The Kana variation of the the individual's primary address (Japan only). */ - public Builder setAddressKana(AddressKana addressKana) { + public Builder setAddressKana(AccountCreateParams.Individual.AddressKana addressKana) { this.addressKana = addressKana; return this; } /** The Kanji variation of the the individual's primary address (Japan only). */ - public Builder setAddressKanji(AddressKanji addressKanji) { + public Builder setAddressKanji(AccountCreateParams.Individual.AddressKanji addressKanji) { this.addressKanji = addressKanji; return this; } /** The individual's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(AccountCreateParams.Individual.Dob dob) { this.dob = dob; return this; } @@ -6540,13 +6600,15 @@ public Builder setPhone(String phone) { * related persons, declares that they hold or have held an important public job or function, * in any jurisdiction. */ - public Builder setPoliticalExposure(PoliticalExposure politicalExposure) { + public Builder setPoliticalExposure( + AccountCreateParams.Individual.PoliticalExposure politicalExposure) { this.politicalExposure = politicalExposure; return this; } /** The individual's registered address. */ - public Builder setRegisteredAddress(RegisteredAddress registeredAddress) { + public Builder setRegisteredAddress( + AccountCreateParams.Individual.RegisteredAddress registeredAddress) { this.registeredAddress = registeredAddress; return this; } @@ -6558,7 +6620,7 @@ public Builder setSsnLast4(String ssnLast4) { } /** The individual's verification document information. */ - public Builder setVerification(Verification verification) { + public Builder setVerification(AccountCreateParams.Individual.Verification verification) { this.verification = verification; return this; } @@ -6639,8 +6701,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public AccountCreateParams.Individual.Address build() { + return new AccountCreateParams.Individual.Address( this.city, this.country, this.extraParams, @@ -6802,8 +6864,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKana build() { - return new AddressKana( + public AccountCreateParams.Individual.AddressKana build() { + return new AccountCreateParams.Individual.AddressKana( this.city, this.country, this.extraParams, @@ -6972,8 +7034,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKanji build() { - return new AddressKanji( + public AccountCreateParams.Individual.AddressKanji build() { + return new AccountCreateParams.Individual.AddressKanji( this.city, this.country, this.extraParams, @@ -7103,8 +7165,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public AccountCreateParams.Individual.Dob build() { + return new AccountCreateParams.Individual.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -7230,8 +7293,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public RegisteredAddress build() { - return new RegisteredAddress( + public AccountCreateParams.Individual.RegisteredAddress build() { + return new AccountCreateParams.Individual.RegisteredAddress( this.city, this.country, this.extraParams, @@ -7353,21 +7416,23 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Verification build() { - return new Verification(this.additionalDocument, this.document, this.extraParams); + public AccountCreateParams.Individual.Verification build() { + return new AccountCreateParams.Individual.Verification( + this.additionalDocument, this.document, this.extraParams); } /** * A document showing address, either a passport, local ID card, or utility bill from a * well-known utility company. */ - public Builder setAdditionalDocument(AdditionalDocument additionalDocument) { + public Builder setAdditionalDocument( + AccountCreateParams.Individual.Verification.AdditionalDocument additionalDocument) { this.additionalDocument = additionalDocument; return this; } /** An identifying document, either a passport or local ID card. */ - public Builder setDocument(Document document) { + public Builder setDocument(AccountCreateParams.Individual.Verification.Document document) { this.document = document; return this; } @@ -7449,8 +7514,9 @@ public static class Builder { private String front; /** Finalize and obtain parameter instance from this builder. */ - public AdditionalDocument build() { - return new AdditionalDocument(this.back, this.extraParams, this.front); + public AccountCreateParams.Individual.Verification.AdditionalDocument build() { + return new AccountCreateParams.Individual.Verification.AdditionalDocument( + this.back, this.extraParams, this.front); } /** @@ -7555,8 +7621,9 @@ public static class Builder { private String front; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document(this.back, this.extraParams, this.front); + public AccountCreateParams.Individual.Verification.Document build() { + return new AccountCreateParams.Individual.Verification.Document( + this.back, this.extraParams, this.front); } /** @@ -7703,8 +7770,8 @@ public static class Builder { private Treasury treasury; /** Finalize and obtain parameter instance from this builder. */ - public Settings build() { - return new Settings( + public AccountCreateParams.Settings build() { + return new AccountCreateParams.Settings( this.branding, this.cardIssuing, this.cardPayments, @@ -7718,19 +7785,19 @@ public Settings build() { * Settings used to apply the account's branding to email receipts, invoices, Checkout, and * other products. */ - public Builder setBranding(Branding branding) { + public Builder setBranding(AccountCreateParams.Settings.Branding branding) { this.branding = branding; return this; } /** Settings specific to the account's use of the Card Issuing product. */ - public Builder setCardIssuing(CardIssuing cardIssuing) { + public Builder setCardIssuing(AccountCreateParams.Settings.CardIssuing cardIssuing) { this.cardIssuing = cardIssuing; return this; } /** Settings specific to card charging on the account. */ - public Builder setCardPayments(CardPayments cardPayments) { + public Builder setCardPayments(AccountCreateParams.Settings.CardPayments cardPayments) { this.cardPayments = cardPayments; return this; } @@ -7762,19 +7829,19 @@ public Builder putAllExtraParam(Map map) { } /** Settings that apply across payment methods for charging on the account. */ - public Builder setPayments(Payments payments) { + public Builder setPayments(AccountCreateParams.Settings.Payments payments) { this.payments = payments; return this; } /** Settings specific to the account's payouts. */ - public Builder setPayouts(Payouts payouts) { + public Builder setPayouts(AccountCreateParams.Settings.Payouts payouts) { this.payouts = payouts; return this; } /** Settings specific to the account's Treasury FinancialAccounts. */ - public Builder setTreasury(Treasury treasury) { + public Builder setTreasury(AccountCreateParams.Settings.Treasury treasury) { this.treasury = treasury; return this; } @@ -7843,8 +7910,8 @@ public static class Builder { private String secondaryColor; /** Finalize and obtain parameter instance from this builder. */ - public Branding build() { - return new Branding( + public AccountCreateParams.Settings.Branding build() { + return new AccountCreateParams.Settings.Branding( this.extraParams, this.icon, this.logo, this.primaryColor, this.secondaryColor); } @@ -7943,8 +8010,8 @@ public static class Builder { private TosAcceptance tosAcceptance; /** Finalize and obtain parameter instance from this builder. */ - public CardIssuing build() { - return new CardIssuing(this.extraParams, this.tosAcceptance); + public AccountCreateParams.Settings.CardIssuing build() { + return new AccountCreateParams.Settings.CardIssuing(this.extraParams, this.tosAcceptance); } /** @@ -7980,7 +8047,8 @@ public Builder putAllExtraParam(Map map) { * href="https://stripe.com/docs/issuing/connect/tos_acceptance">Stripe Issuing Terms and * Disclosures. */ - public Builder setTosAcceptance(TosAcceptance tosAcceptance) { + public Builder setTosAcceptance( + AccountCreateParams.Settings.CardIssuing.TosAcceptance tosAcceptance) { this.tosAcceptance = tosAcceptance; return this; } @@ -8038,8 +8106,9 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public TosAcceptance build() { - return new TosAcceptance(this.date, this.extraParams, this.ip, this.userAgent); + public AccountCreateParams.Settings.CardIssuing.TosAcceptance build() { + return new AccountCreateParams.Settings.CardIssuing.TosAcceptance( + this.date, this.extraParams, this.ip, this.userAgent); } /** @@ -8175,8 +8244,8 @@ public static class Builder { private Object statementDescriptorPrefixKanji; /** Finalize and obtain parameter instance from this builder. */ - public CardPayments build() { - return new CardPayments( + public AccountCreateParams.Settings.CardPayments build() { + return new AccountCreateParams.Settings.CardPayments( this.declineOn, this.extraParams, this.statementDescriptorPrefix, @@ -8188,7 +8257,7 @@ public CardPayments build() { * Automatically declines certain charge types regardless of whether the card issuer * accepted or declined the charge. */ - public Builder setDeclineOn(DeclineOn declineOn) { + public Builder setDeclineOn(AccountCreateParams.Settings.CardPayments.DeclineOn declineOn) { this.declineOn = declineOn; return this; } @@ -8327,8 +8396,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public DeclineOn build() { - return new DeclineOn(this.avsFailure, this.cvcFailure, this.extraParams); + public AccountCreateParams.Settings.CardPayments.DeclineOn build() { + return new AccountCreateParams.Settings.CardPayments.DeclineOn( + this.avsFailure, this.cvcFailure, this.extraParams); } /** @@ -8438,8 +8508,8 @@ public static class Builder { private String statementDescriptorKanji; /** Finalize and obtain parameter instance from this builder. */ - public Payments build() { - return new Payments( + public AccountCreateParams.Settings.Payments build() { + return new AccountCreateParams.Settings.Payments( this.extraParams, this.statementDescriptor, this.statementDescriptorKana, @@ -8564,8 +8634,8 @@ public static class Builder { private String statementDescriptor; /** Finalize and obtain parameter instance from this builder. */ - public Payouts build() { - return new Payouts( + public AccountCreateParams.Settings.Payouts build() { + return new AccountCreateParams.Settings.Payouts( this.debitNegativeBalances, this.extraParams, this.schedule, @@ -8617,7 +8687,7 @@ public Builder putAllExtraParam(Map map) { * href="https://stripe.com/docs/connect/bank-transfers#payout-information">Setting Bank and * Debit Card Payouts documentation. */ - public Builder setSchedule(Schedule schedule) { + public Builder setSchedule(AccountCreateParams.Settings.Payouts.Schedule schedule) { this.schedule = schedule; return this; } @@ -8706,8 +8776,8 @@ public static class Builder { private WeeklyAnchor weeklyAnchor; /** Finalize and obtain parameter instance from this builder. */ - public Schedule build() { - return new Schedule( + public AccountCreateParams.Settings.Payouts.Schedule build() { + return new AccountCreateParams.Settings.Payouts.Schedule( this.delayDays, this.extraParams, this.interval, @@ -8721,7 +8791,8 @@ public Schedule build() { * Default is {@code minimum}. The {@code delay_days} parameter does not apply when the * {@code interval} is {@code manual}. */ - public Builder setDelayDays(DelayDays delayDays) { + public Builder setDelayDays( + AccountCreateParams.Settings.Payouts.Schedule.DelayDays delayDays) { this.delayDays = delayDays; return this; } @@ -8769,7 +8840,8 @@ public Builder putAllExtraParam(Map map) { * How frequently available funds are paid out. One of: {@code daily}, {@code manual}, * {@code weekly}, or {@code monthly}. Default is {@code daily}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + AccountCreateParams.Settings.Payouts.Schedule.Interval interval) { this.interval = interval; return this; } @@ -8790,7 +8862,8 @@ public Builder setMonthlyAnchor(Long monthlyAnchor) { * {@code tuesday}, etc. (required and applicable only if {@code interval} is {@code * weekly}.) */ - public Builder setWeeklyAnchor(WeeklyAnchor weeklyAnchor) { + public Builder setWeeklyAnchor( + AccountCreateParams.Settings.Payouts.Schedule.WeeklyAnchor weeklyAnchor) { this.weeklyAnchor = weeklyAnchor; return this; } @@ -8891,8 +8964,8 @@ public static class Builder { private TosAcceptance tosAcceptance; /** Finalize and obtain parameter instance from this builder. */ - public Treasury build() { - return new Treasury(this.extraParams, this.tosAcceptance); + public AccountCreateParams.Settings.Treasury build() { + return new AccountCreateParams.Settings.Treasury(this.extraParams, this.tosAcceptance); } /** @@ -8924,7 +8997,8 @@ public Builder putAllExtraParam(Map map) { } /** Details on the account's acceptance of the Stripe Treasury Services Agreement. */ - public Builder setTosAcceptance(TosAcceptance tosAcceptance) { + public Builder setTosAcceptance( + AccountCreateParams.Settings.Treasury.TosAcceptance tosAcceptance) { this.tosAcceptance = tosAcceptance; return this; } @@ -8982,8 +9056,9 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public TosAcceptance build() { - return new TosAcceptance(this.date, this.extraParams, this.ip, this.userAgent); + public AccountCreateParams.Settings.Treasury.TosAcceptance build() { + return new AccountCreateParams.Settings.Treasury.TosAcceptance( + this.date, this.extraParams, this.ip, this.userAgent); } /** @@ -9105,8 +9180,8 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public TosAcceptance build() { - return new TosAcceptance( + public AccountCreateParams.TosAcceptance build() { + return new AccountCreateParams.TosAcceptance( this.date, this.extraParams, this.ip, this.serviceAgreement, this.userAgent); } diff --git a/src/main/java/com/stripe/param/AccountLinkCreateParams.java b/src/main/java/com/stripe/param/AccountLinkCreateParams.java index 75d477d14e3..6ef3064fcac 100644 --- a/src/main/java/com/stripe/param/AccountLinkCreateParams.java +++ b/src/main/java/com/stripe/param/AccountLinkCreateParams.java @@ -115,7 +115,7 @@ public Builder setAccount(String account) { * Which information the platform needs to collect from the user. One of {@code currently_due} * or {@code eventually_due}. Default is {@code currently_due}. */ - public Builder setCollect(Collect collect) { + public Builder setCollect(AccountLinkCreateParams.Collect collect) { this.collect = collect; return this; } @@ -195,7 +195,7 @@ public Builder setReturnUrl(String returnUrl) { * The type of account link the user is requesting. Possible values are {@code * account_onboarding} or {@code account_update}. */ - public Builder setType(Type type) { + public Builder setType(AccountLinkCreateParams.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/AccountListParams.java b/src/main/java/com/stripe/param/AccountListParams.java index 7f97438e60b..ff9c361ad10 100644 --- a/src/main/java/com/stripe/param/AccountListParams.java +++ b/src/main/java/com/stripe/param/AccountListParams.java @@ -95,7 +95,7 @@ public AccountListParams build() { this.startingAfter); } - public Builder setCreated(Created created) { + public Builder setCreated(AccountListParams.Created created) { this.created = created; return this; } @@ -240,8 +240,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public AccountListParams.Created build() { + return new AccountListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/AccountPersonsParams.java b/src/main/java/com/stripe/param/AccountPersonsParams.java index a7cfdd8c32a..efec8597369 100644 --- a/src/main/java/com/stripe/param/AccountPersonsParams.java +++ b/src/main/java/com/stripe/param/AccountPersonsParams.java @@ -175,7 +175,7 @@ public Builder setLimit(Long limit) { * Filters on the list of people returned based on the person's relationship to the account's * company. */ - public Builder setRelationship(Relationship relationship) { + public Builder setRelationship(AccountPersonsParams.Relationship relationship) { this.relationship = relationship; return this; } @@ -260,8 +260,8 @@ public static class Builder { private Boolean representative; /** Finalize and obtain parameter instance from this builder. */ - public Relationship build() { - return new Relationship( + public AccountPersonsParams.Relationship build() { + return new AccountPersonsParams.Relationship( this.director, this.executive, this.extraParams, this.owner, this.representative); } diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index 69c811333af..42453035ef2 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -227,13 +226,13 @@ public Builder setAccountToken(EmptyParam accountToken) { } /** Business information about the account. */ - public Builder setBusinessProfile(BusinessProfile businessProfile) { + public Builder setBusinessProfile(AccountUpdateParams.BusinessProfile businessProfile) { this.businessProfile = businessProfile; return this; } /** The business type. */ - public Builder setBusinessType(BusinessType businessType) { + public Builder setBusinessType(AccountUpdateParams.BusinessType businessType) { this.businessType = businessType; return this; } @@ -244,7 +243,7 @@ public Builder setBusinessType(BusinessType businessType) { * provided its specific requirements and Stripe has verified them. An account may have some of * its requested capabilities be active and some be inactive. */ - public Builder setCapabilities(Capabilities capabilities) { + public Builder setCapabilities(AccountUpdateParams.Capabilities capabilities) { this.capabilities = capabilities; return this; } @@ -253,7 +252,7 @@ public Builder setCapabilities(Capabilities capabilities) { * Information about the company or business. This field is available for any {@code * business_type}. */ - public Builder setCompany(Company company) { + public Builder setCompany(AccountUpdateParams.Company company) { this.company = company; return this; } @@ -279,7 +278,7 @@ public Builder setDefaultCurrency(EmptyParam defaultCurrency) { } /** Documents that may be submitted to satisfy various informational requests. */ - public Builder setDocuments(Documents documents) { + public Builder setDocuments(AccountUpdateParams.Documents documents) { this.documents = documents; return this; } @@ -394,7 +393,7 @@ public Builder putAllExtraParam(Map map) { * Information about the person represented by the account. This field is null unless {@code * business_type} is set to {@code individual}. */ - public Builder setIndividual(Individual individual) { + public Builder setIndividual(AccountUpdateParams.Individual individual) { this.individual = individual; return this; } @@ -450,7 +449,7 @@ public Builder setMetadata(Map metadata) { } /** Options for customizing how the account functions within Stripe. */ - public Builder setSettings(Settings settings) { + public Builder setSettings(AccountUpdateParams.Settings settings) { this.settings = settings; return this; } @@ -460,7 +459,7 @@ public Builder setSettings(Settings settings) { * href="https://stripe.com/docs/connect/updating-accounts#tos-acceptance">Stripe Services * Agreement. */ - public Builder setTosAcceptance(TosAcceptance tosAcceptance) { + public Builder setTosAcceptance(AccountUpdateParams.TosAcceptance tosAcceptance) { this.tosAcceptance = tosAcceptance; return this; } @@ -561,8 +560,8 @@ public static class Builder { private Object url; /** Finalize and obtain parameter instance from this builder. */ - public BusinessProfile build() { - return new BusinessProfile( + public AccountUpdateParams.BusinessProfile build() { + return new AccountUpdateParams.BusinessProfile( this.extraParams, this.mcc, this.name, @@ -651,7 +650,8 @@ public Builder setProductDescription(EmptyParam productDescription) { } /** A publicly available mailing address for sending support issues to. */ - public Builder setSupportAddress(SupportAddress supportAddress) { + public Builder setSupportAddress( + AccountUpdateParams.BusinessProfile.SupportAddress supportAddress) { this.supportAddress = supportAddress; return this; } @@ -780,8 +780,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public SupportAddress build() { - return new SupportAddress( + public AccountUpdateParams.BusinessProfile.SupportAddress build() { + return new AccountUpdateParams.BusinessProfile.SupportAddress( this.city, this.country, this.extraParams, @@ -1188,8 +1188,8 @@ public static class Builder { private UsBankAccountAchPayments usBankAccountAchPayments; /** Finalize and obtain parameter instance from this builder. */ - public Capabilities build() { - return new Capabilities( + public AccountUpdateParams.Capabilities build() { + return new AccountUpdateParams.Capabilities( this.acssDebitPayments, this.affirmPayments, this.afterpayClearpayPayments, @@ -1227,80 +1227,88 @@ public Capabilities build() { } /** The acss_debit_payments capability. */ - public Builder setAcssDebitPayments(AcssDebitPayments acssDebitPayments) { + public Builder setAcssDebitPayments( + AccountUpdateParams.Capabilities.AcssDebitPayments acssDebitPayments) { this.acssDebitPayments = acssDebitPayments; return this; } /** The affirm_payments capability. */ - public Builder setAffirmPayments(AffirmPayments affirmPayments) { + public Builder setAffirmPayments( + AccountUpdateParams.Capabilities.AffirmPayments affirmPayments) { this.affirmPayments = affirmPayments; return this; } /** The afterpay_clearpay_payments capability. */ public Builder setAfterpayClearpayPayments( - AfterpayClearpayPayments afterpayClearpayPayments) { + AccountUpdateParams.Capabilities.AfterpayClearpayPayments afterpayClearpayPayments) { this.afterpayClearpayPayments = afterpayClearpayPayments; return this; } /** The au_becs_debit_payments capability. */ - public Builder setAuBecsDebitPayments(AuBecsDebitPayments auBecsDebitPayments) { + public Builder setAuBecsDebitPayments( + AccountUpdateParams.Capabilities.AuBecsDebitPayments auBecsDebitPayments) { this.auBecsDebitPayments = auBecsDebitPayments; return this; } /** The bacs_debit_payments capability. */ - public Builder setBacsDebitPayments(BacsDebitPayments bacsDebitPayments) { + public Builder setBacsDebitPayments( + AccountUpdateParams.Capabilities.BacsDebitPayments bacsDebitPayments) { this.bacsDebitPayments = bacsDebitPayments; return this; } /** The bancontact_payments capability. */ - public Builder setBancontactPayments(BancontactPayments bancontactPayments) { + public Builder setBancontactPayments( + AccountUpdateParams.Capabilities.BancontactPayments bancontactPayments) { this.bancontactPayments = bancontactPayments; return this; } /** The bank_transfer_payments capability. */ - public Builder setBankTransferPayments(BankTransferPayments bankTransferPayments) { + public Builder setBankTransferPayments( + AccountUpdateParams.Capabilities.BankTransferPayments bankTransferPayments) { this.bankTransferPayments = bankTransferPayments; return this; } /** The blik_payments capability. */ - public Builder setBlikPayments(BlikPayments blikPayments) { + public Builder setBlikPayments(AccountUpdateParams.Capabilities.BlikPayments blikPayments) { this.blikPayments = blikPayments; return this; } /** The boleto_payments capability. */ - public Builder setBoletoPayments(BoletoPayments boletoPayments) { + public Builder setBoletoPayments( + AccountUpdateParams.Capabilities.BoletoPayments boletoPayments) { this.boletoPayments = boletoPayments; return this; } /** The card_issuing capability. */ - public Builder setCardIssuing(CardIssuing cardIssuing) { + public Builder setCardIssuing(AccountUpdateParams.Capabilities.CardIssuing cardIssuing) { this.cardIssuing = cardIssuing; return this; } /** The card_payments capability. */ - public Builder setCardPayments(CardPayments cardPayments) { + public Builder setCardPayments(AccountUpdateParams.Capabilities.CardPayments cardPayments) { this.cardPayments = cardPayments; return this; } /** The cartes_bancaires_payments capability. */ - public Builder setCartesBancairesPayments(CartesBancairesPayments cartesBancairesPayments) { + public Builder setCartesBancairesPayments( + AccountUpdateParams.Capabilities.CartesBancairesPayments cartesBancairesPayments) { this.cartesBancairesPayments = cartesBancairesPayments; return this; } /** The eps_payments capability. */ - public Builder setEpsPayments(EpsPayments epsPayments) { + public Builder setEpsPayments(AccountUpdateParams.Capabilities.EpsPayments epsPayments) { this.epsPayments = epsPayments; return this; } @@ -1332,122 +1340,134 @@ public Builder putAllExtraParam(Map map) { } /** The fpx_payments capability. */ - public Builder setFpxPayments(FpxPayments fpxPayments) { + public Builder setFpxPayments(AccountUpdateParams.Capabilities.FpxPayments fpxPayments) { this.fpxPayments = fpxPayments; return this; } /** The giropay_payments capability. */ - public Builder setGiropayPayments(GiropayPayments giropayPayments) { + public Builder setGiropayPayments( + AccountUpdateParams.Capabilities.GiropayPayments giropayPayments) { this.giropayPayments = giropayPayments; return this; } /** The grabpay_payments capability. */ - public Builder setGrabpayPayments(GrabpayPayments grabpayPayments) { + public Builder setGrabpayPayments( + AccountUpdateParams.Capabilities.GrabpayPayments grabpayPayments) { this.grabpayPayments = grabpayPayments; return this; } /** The ideal_payments capability. */ - public Builder setIdealPayments(IdealPayments idealPayments) { + public Builder setIdealPayments( + AccountUpdateParams.Capabilities.IdealPayments idealPayments) { this.idealPayments = idealPayments; return this; } /** The jcb_payments capability. */ - public Builder setJcbPayments(JcbPayments jcbPayments) { + public Builder setJcbPayments(AccountUpdateParams.Capabilities.JcbPayments jcbPayments) { this.jcbPayments = jcbPayments; return this; } /** The klarna_payments capability. */ - public Builder setKlarnaPayments(KlarnaPayments klarnaPayments) { + public Builder setKlarnaPayments( + AccountUpdateParams.Capabilities.KlarnaPayments klarnaPayments) { this.klarnaPayments = klarnaPayments; return this; } /** The konbini_payments capability. */ - public Builder setKonbiniPayments(KonbiniPayments konbiniPayments) { + public Builder setKonbiniPayments( + AccountUpdateParams.Capabilities.KonbiniPayments konbiniPayments) { this.konbiniPayments = konbiniPayments; return this; } /** The legacy_payments capability. */ - public Builder setLegacyPayments(LegacyPayments legacyPayments) { + public Builder setLegacyPayments( + AccountUpdateParams.Capabilities.LegacyPayments legacyPayments) { this.legacyPayments = legacyPayments; return this; } /** The link_payments capability. */ - public Builder setLinkPayments(LinkPayments linkPayments) { + public Builder setLinkPayments(AccountUpdateParams.Capabilities.LinkPayments linkPayments) { this.linkPayments = linkPayments; return this; } /** The oxxo_payments capability. */ - public Builder setOxxoPayments(OxxoPayments oxxoPayments) { + public Builder setOxxoPayments(AccountUpdateParams.Capabilities.OxxoPayments oxxoPayments) { this.oxxoPayments = oxxoPayments; return this; } /** The p24_payments capability. */ - public Builder setP24Payments(P24Payments p24Payments) { + public Builder setP24Payments(AccountUpdateParams.Capabilities.P24Payments p24Payments) { this.p24Payments = p24Payments; return this; } /** The paynow_payments capability. */ - public Builder setPaynowPayments(PaynowPayments paynowPayments) { + public Builder setPaynowPayments( + AccountUpdateParams.Capabilities.PaynowPayments paynowPayments) { this.paynowPayments = paynowPayments; return this; } /** The promptpay_payments capability. */ - public Builder setPromptpayPayments(PromptpayPayments promptpayPayments) { + public Builder setPromptpayPayments( + AccountUpdateParams.Capabilities.PromptpayPayments promptpayPayments) { this.promptpayPayments = promptpayPayments; return this; } /** The sepa_debit_payments capability. */ - public Builder setSepaDebitPayments(SepaDebitPayments sepaDebitPayments) { + public Builder setSepaDebitPayments( + AccountUpdateParams.Capabilities.SepaDebitPayments sepaDebitPayments) { this.sepaDebitPayments = sepaDebitPayments; return this; } /** The sofort_payments capability. */ - public Builder setSofortPayments(SofortPayments sofortPayments) { + public Builder setSofortPayments( + AccountUpdateParams.Capabilities.SofortPayments sofortPayments) { this.sofortPayments = sofortPayments; return this; } /** The tax_reporting_us_1099_k capability. */ - public Builder setTaxReportingUs1099K(TaxReportingUs1099K taxReportingUs1099K) { + public Builder setTaxReportingUs1099K( + AccountUpdateParams.Capabilities.TaxReportingUs1099K taxReportingUs1099K) { this.taxReportingUs1099K = taxReportingUs1099K; return this; } /** The tax_reporting_us_1099_misc capability. */ - public Builder setTaxReportingUs1099Misc(TaxReportingUs1099Misc taxReportingUs1099Misc) { + public Builder setTaxReportingUs1099Misc( + AccountUpdateParams.Capabilities.TaxReportingUs1099Misc taxReportingUs1099Misc) { this.taxReportingUs1099Misc = taxReportingUs1099Misc; return this; } /** The transfers capability. */ - public Builder setTransfers(Transfers transfers) { + public Builder setTransfers(AccountUpdateParams.Capabilities.Transfers transfers) { this.transfers = transfers; return this; } /** The treasury capability. */ - public Builder setTreasury(Treasury treasury) { + public Builder setTreasury(AccountUpdateParams.Capabilities.Treasury treasury) { this.treasury = treasury; return this; } /** The us_bank_account_ach_payments capability. */ public Builder setUsBankAccountAchPayments( - UsBankAccountAchPayments usBankAccountAchPayments) { + AccountUpdateParams.Capabilities.UsBankAccountAchPayments usBankAccountAchPayments) { this.usBankAccountAchPayments = usBankAccountAchPayments; return this; } @@ -1487,8 +1507,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebitPayments build() { - return new AcssDebitPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.AcssDebitPayments build() { + return new AccountUpdateParams.Capabilities.AcssDebitPayments( + this.extraParams, this.requested); } /** @@ -1565,8 +1586,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public AffirmPayments build() { - return new AffirmPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.AffirmPayments build() { + return new AccountUpdateParams.Capabilities.AffirmPayments( + this.extraParams, this.requested); } /** @@ -1643,8 +1665,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpayPayments build() { - return new AfterpayClearpayPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.AfterpayClearpayPayments build() { + return new AccountUpdateParams.Capabilities.AfterpayClearpayPayments( + this.extraParams, this.requested); } /** @@ -1721,8 +1744,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebitPayments build() { - return new AuBecsDebitPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.AuBecsDebitPayments build() { + return new AccountUpdateParams.Capabilities.AuBecsDebitPayments( + this.extraParams, this.requested); } /** @@ -1799,8 +1823,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebitPayments build() { - return new BacsDebitPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.BacsDebitPayments build() { + return new AccountUpdateParams.Capabilities.BacsDebitPayments( + this.extraParams, this.requested); } /** @@ -1877,8 +1902,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public BancontactPayments build() { - return new BancontactPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.BancontactPayments build() { + return new AccountUpdateParams.Capabilities.BancontactPayments( + this.extraParams, this.requested); } /** @@ -1955,8 +1981,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public BankTransferPayments build() { - return new BankTransferPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.BankTransferPayments build() { + return new AccountUpdateParams.Capabilities.BankTransferPayments( + this.extraParams, this.requested); } /** @@ -2033,8 +2060,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public BlikPayments build() { - return new BlikPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.BlikPayments build() { + return new AccountUpdateParams.Capabilities.BlikPayments( + this.extraParams, this.requested); } /** @@ -2111,8 +2139,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public BoletoPayments build() { - return new BoletoPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.BoletoPayments build() { + return new AccountUpdateParams.Capabilities.BoletoPayments( + this.extraParams, this.requested); } /** @@ -2189,8 +2218,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public CardIssuing build() { - return new CardIssuing(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.CardIssuing build() { + return new AccountUpdateParams.Capabilities.CardIssuing(this.extraParams, this.requested); } /** @@ -2267,8 +2296,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public CardPayments build() { - return new CardPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.CardPayments build() { + return new AccountUpdateParams.Capabilities.CardPayments( + this.extraParams, this.requested); } /** @@ -2345,8 +2375,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public CartesBancairesPayments build() { - return new CartesBancairesPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.CartesBancairesPayments build() { + return new AccountUpdateParams.Capabilities.CartesBancairesPayments( + this.extraParams, this.requested); } /** @@ -2423,8 +2454,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public EpsPayments build() { - return new EpsPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.EpsPayments build() { + return new AccountUpdateParams.Capabilities.EpsPayments(this.extraParams, this.requested); } /** @@ -2501,8 +2532,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public FpxPayments build() { - return new FpxPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.FpxPayments build() { + return new AccountUpdateParams.Capabilities.FpxPayments(this.extraParams, this.requested); } /** @@ -2579,8 +2610,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public GiropayPayments build() { - return new GiropayPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.GiropayPayments build() { + return new AccountUpdateParams.Capabilities.GiropayPayments( + this.extraParams, this.requested); } /** @@ -2657,8 +2689,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public GrabpayPayments build() { - return new GrabpayPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.GrabpayPayments build() { + return new AccountUpdateParams.Capabilities.GrabpayPayments( + this.extraParams, this.requested); } /** @@ -2735,8 +2768,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public IdealPayments build() { - return new IdealPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.IdealPayments build() { + return new AccountUpdateParams.Capabilities.IdealPayments( + this.extraParams, this.requested); } /** @@ -2813,8 +2847,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public JcbPayments build() { - return new JcbPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.JcbPayments build() { + return new AccountUpdateParams.Capabilities.JcbPayments(this.extraParams, this.requested); } /** @@ -2891,8 +2925,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public KlarnaPayments build() { - return new KlarnaPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.KlarnaPayments build() { + return new AccountUpdateParams.Capabilities.KlarnaPayments( + this.extraParams, this.requested); } /** @@ -2969,8 +3004,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public KonbiniPayments build() { - return new KonbiniPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.KonbiniPayments build() { + return new AccountUpdateParams.Capabilities.KonbiniPayments( + this.extraParams, this.requested); } /** @@ -3047,8 +3083,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public LegacyPayments build() { - return new LegacyPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.LegacyPayments build() { + return new AccountUpdateParams.Capabilities.LegacyPayments( + this.extraParams, this.requested); } /** @@ -3125,8 +3162,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public LinkPayments build() { - return new LinkPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.LinkPayments build() { + return new AccountUpdateParams.Capabilities.LinkPayments( + this.extraParams, this.requested); } /** @@ -3203,8 +3241,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public OxxoPayments build() { - return new OxxoPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.OxxoPayments build() { + return new AccountUpdateParams.Capabilities.OxxoPayments( + this.extraParams, this.requested); } /** @@ -3281,8 +3320,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public P24Payments build() { - return new P24Payments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.P24Payments build() { + return new AccountUpdateParams.Capabilities.P24Payments(this.extraParams, this.requested); } /** @@ -3359,8 +3398,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public PaynowPayments build() { - return new PaynowPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.PaynowPayments build() { + return new AccountUpdateParams.Capabilities.PaynowPayments( + this.extraParams, this.requested); } /** @@ -3437,8 +3477,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public PromptpayPayments build() { - return new PromptpayPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.PromptpayPayments build() { + return new AccountUpdateParams.Capabilities.PromptpayPayments( + this.extraParams, this.requested); } /** @@ -3515,8 +3556,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebitPayments build() { - return new SepaDebitPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.SepaDebitPayments build() { + return new AccountUpdateParams.Capabilities.SepaDebitPayments( + this.extraParams, this.requested); } /** @@ -3593,8 +3635,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public SofortPayments build() { - return new SofortPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.SofortPayments build() { + return new AccountUpdateParams.Capabilities.SofortPayments( + this.extraParams, this.requested); } /** @@ -3671,8 +3714,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public TaxReportingUs1099K build() { - return new TaxReportingUs1099K(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.TaxReportingUs1099K build() { + return new AccountUpdateParams.Capabilities.TaxReportingUs1099K( + this.extraParams, this.requested); } /** @@ -3749,8 +3793,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public TaxReportingUs1099Misc build() { - return new TaxReportingUs1099Misc(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.TaxReportingUs1099Misc build() { + return new AccountUpdateParams.Capabilities.TaxReportingUs1099Misc( + this.extraParams, this.requested); } /** @@ -3827,8 +3872,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Transfers build() { - return new Transfers(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.Transfers build() { + return new AccountUpdateParams.Capabilities.Transfers(this.extraParams, this.requested); } /** @@ -3905,8 +3950,8 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Treasury build() { - return new Treasury(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.Treasury build() { + return new AccountUpdateParams.Capabilities.Treasury(this.extraParams, this.requested); } /** @@ -3983,8 +4028,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccountAchPayments build() { - return new UsBankAccountAchPayments(this.extraParams, this.requested); + public AccountUpdateParams.Capabilities.UsBankAccountAchPayments build() { + return new AccountUpdateParams.Capabilities.UsBankAccountAchPayments( + this.extraParams, this.requested); } /** @@ -4115,7 +4161,7 @@ public static class Company { * structure for more details. */ @SerializedName("structure") - EnumParam structure; + ApiRequestParams.EnumParam structure; /** * The business ID number of the company, as appropriate for the company’s country. (Examples @@ -4153,7 +4199,7 @@ private Company( OwnershipDeclaration ownershipDeclaration, Object phone, Object registrationNumber, - EnumParam structure, + ApiRequestParams.EnumParam structure, Object taxId, Object taxIdRegistrar, Object vatId, @@ -4209,7 +4255,7 @@ public static class Builder { private Object registrationNumber; - private EnumParam structure; + private ApiRequestParams.EnumParam structure; private Object taxId; @@ -4220,8 +4266,8 @@ public static class Builder { private Verification verification; /** Finalize and obtain parameter instance from this builder. */ - public Company build() { - return new Company( + public AccountUpdateParams.Company build() { + return new AccountUpdateParams.Company( this.address, this.addressKana, this.addressKanji, @@ -4243,19 +4289,19 @@ public Company build() { } /** The company's primary address. */ - public Builder setAddress(Address address) { + public Builder setAddress(AccountUpdateParams.Company.Address address) { this.address = address; return this; } /** The Kana variation of the company's primary address (Japan only). */ - public Builder setAddressKana(AddressKana addressKana) { + public Builder setAddressKana(AccountUpdateParams.Company.AddressKana addressKana) { this.addressKana = addressKana; return this; } /** The Kanji variation of the company's primary address (Japan only). */ - public Builder setAddressKanji(AddressKanji addressKanji) { + public Builder setAddressKanji(AccountUpdateParams.Company.AddressKanji addressKanji) { this.addressKanji = addressKanji; return this; } @@ -4359,7 +4405,8 @@ public Builder setOwnersProvided(Boolean ownersProvided) { * This hash is used to attest that the beneficial owner information provided to Stripe is * both current and correct. */ - public Builder setOwnershipDeclaration(OwnershipDeclaration ownershipDeclaration) { + public Builder setOwnershipDeclaration( + AccountUpdateParams.Company.OwnershipDeclaration ownershipDeclaration) { this.ownershipDeclaration = ownershipDeclaration; return this; } @@ -4403,7 +4450,7 @@ public Builder setRegistrationNumber(EmptyParam registrationNumber) { * href="https://stripe.com/docs/connect/identity-verification#business-structure">Business * structure for more details. */ - public Builder setStructure(Structure structure) { + public Builder setStructure(AccountUpdateParams.Company.Structure structure) { this.structure = structure; return this; } @@ -4467,7 +4514,7 @@ public Builder setVatId(EmptyParam vatId) { } /** Information on the verification state of the company. */ - public Builder setVerification(Verification verification) { + public Builder setVerification(AccountUpdateParams.Company.Verification verification) { this.verification = verification; return this; } @@ -4548,8 +4595,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public AccountUpdateParams.Company.Address build() { + return new AccountUpdateParams.Company.Address( this.city, this.country, this.extraParams, @@ -4750,8 +4797,8 @@ public static class Builder { private Object town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKana build() { - return new AddressKana( + public AccountUpdateParams.Company.AddressKana build() { + return new AccountUpdateParams.Company.AddressKana( this.city, this.country, this.extraParams, @@ -4965,8 +5012,8 @@ public static class Builder { private Object town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKanji build() { - return new AddressKanji( + public AccountUpdateParams.Company.AddressKanji build() { + return new AccountUpdateParams.Company.AddressKanji( this.city, this.country, this.extraParams, @@ -5142,8 +5189,9 @@ public static class Builder { private Object userAgent; /** Finalize and obtain parameter instance from this builder. */ - public OwnershipDeclaration build() { - return new OwnershipDeclaration(this.date, this.extraParams, this.ip, this.userAgent); + public AccountUpdateParams.Company.OwnershipDeclaration build() { + return new AccountUpdateParams.Company.OwnershipDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); } /** The Unix timestamp marking when the beneficial owner attestation was made. */ @@ -5236,12 +5284,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Verification build() { - return new Verification(this.document, this.extraParams); + public AccountUpdateParams.Company.Verification build() { + return new AccountUpdateParams.Company.Verification(this.document, this.extraParams); } /** A document verifying the business. */ - public Builder setDocument(Document document) { + public Builder setDocument(AccountUpdateParams.Company.Verification.Document document) { this.document = document; return this; } @@ -5325,8 +5373,9 @@ public static class Builder { private Object front; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document(this.back, this.extraParams, this.front); + public AccountUpdateParams.Company.Verification.Document build() { + return new AccountUpdateParams.Company.Verification.Document( + this.back, this.extraParams, this.front); } /** @@ -5573,8 +5622,8 @@ public static class Builder { private ProofOfRegistration proofOfRegistration; /** Finalize and obtain parameter instance from this builder. */ - public Documents build() { - return new Documents( + public AccountUpdateParams.Documents build() { + return new AccountUpdateParams.Documents( this.bankAccountOwnershipVerification, this.companyLicense, this.companyMemorandumOfAssociation, @@ -5593,20 +5642,23 @@ public Documents build() { * number, either a statement or a voided check. */ public Builder setBankAccountOwnershipVerification( - BankAccountOwnershipVerification bankAccountOwnershipVerification) { + AccountUpdateParams.Documents.BankAccountOwnershipVerification + bankAccountOwnershipVerification) { this.bankAccountOwnershipVerification = bankAccountOwnershipVerification; return this; } /** One or more documents that demonstrate proof of a company's license to operate. */ - public Builder setCompanyLicense(CompanyLicense companyLicense) { + public Builder setCompanyLicense( + AccountUpdateParams.Documents.CompanyLicense companyLicense) { this.companyLicense = companyLicense; return this; } /** One or more documents showing the company's Memorandum of Association. */ public Builder setCompanyMemorandumOfAssociation( - CompanyMemorandumOfAssociation companyMemorandumOfAssociation) { + AccountUpdateParams.Documents.CompanyMemorandumOfAssociation + companyMemorandumOfAssociation) { this.companyMemorandumOfAssociation = companyMemorandumOfAssociation; return this; } @@ -5616,7 +5668,7 @@ public Builder setCompanyMemorandumOfAssociation( * the company's establishment. */ public Builder setCompanyMinisterialDecree( - CompanyMinisterialDecree companyMinisterialDecree) { + AccountUpdateParams.Documents.CompanyMinisterialDecree companyMinisterialDecree) { this.companyMinisterialDecree = companyMinisterialDecree; return this; } @@ -5626,14 +5678,15 @@ public Builder setCompanyMinisterialDecree( * appropriate local authorities. */ public Builder setCompanyRegistrationVerification( - CompanyRegistrationVerification companyRegistrationVerification) { + AccountUpdateParams.Documents.CompanyRegistrationVerification + companyRegistrationVerification) { this.companyRegistrationVerification = companyRegistrationVerification; return this; } /** One or more documents that demonstrate proof of a company's tax ID. */ public Builder setCompanyTaxIdVerification( - CompanyTaxIdVerification companyTaxIdVerification) { + AccountUpdateParams.Documents.CompanyTaxIdVerification companyTaxIdVerification) { this.companyTaxIdVerification = companyTaxIdVerification; return this; } @@ -5668,7 +5721,8 @@ public Builder putAllExtraParam(Map map) { * One or more documents showing the company’s proof of registration with the national * business registry. */ - public Builder setProofOfRegistration(ProofOfRegistration proofOfRegistration) { + public Builder setProofOfRegistration( + AccountUpdateParams.Documents.ProofOfRegistration proofOfRegistration) { this.proofOfRegistration = proofOfRegistration; return this; } @@ -5709,8 +5763,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public BankAccountOwnershipVerification build() { - return new BankAccountOwnershipVerification(this.extraParams, this.files); + public AccountUpdateParams.Documents.BankAccountOwnershipVerification build() { + return new AccountUpdateParams.Documents.BankAccountOwnershipVerification( + this.extraParams, this.files); } /** @@ -5807,8 +5862,8 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyLicense build() { - return new CompanyLicense(this.extraParams, this.files); + public AccountUpdateParams.Documents.CompanyLicense build() { + return new AccountUpdateParams.Documents.CompanyLicense(this.extraParams, this.files); } /** @@ -5901,8 +5956,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyMemorandumOfAssociation build() { - return new CompanyMemorandumOfAssociation(this.extraParams, this.files); + public AccountUpdateParams.Documents.CompanyMemorandumOfAssociation build() { + return new AccountUpdateParams.Documents.CompanyMemorandumOfAssociation( + this.extraParams, this.files); } /** @@ -5997,8 +6053,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyMinisterialDecree build() { - return new CompanyMinisterialDecree(this.extraParams, this.files); + public AccountUpdateParams.Documents.CompanyMinisterialDecree build() { + return new AccountUpdateParams.Documents.CompanyMinisterialDecree( + this.extraParams, this.files); } /** @@ -6093,8 +6150,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyRegistrationVerification build() { - return new CompanyRegistrationVerification(this.extraParams, this.files); + public AccountUpdateParams.Documents.CompanyRegistrationVerification build() { + return new AccountUpdateParams.Documents.CompanyRegistrationVerification( + this.extraParams, this.files); } /** @@ -6191,8 +6249,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyTaxIdVerification build() { - return new CompanyTaxIdVerification(this.extraParams, this.files); + public AccountUpdateParams.Documents.CompanyTaxIdVerification build() { + return new AccountUpdateParams.Documents.CompanyTaxIdVerification( + this.extraParams, this.files); } /** @@ -6287,8 +6346,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public ProofOfRegistration build() { - return new ProofOfRegistration(this.extraParams, this.files); + public AccountUpdateParams.Documents.ProofOfRegistration build() { + return new AccountUpdateParams.Documents.ProofOfRegistration( + this.extraParams, this.files); } /** @@ -6573,8 +6633,8 @@ public static class Builder { private Verification verification; /** Finalize and obtain parameter instance from this builder. */ - public Individual build() { - return new Individual( + public AccountUpdateParams.Individual build() { + return new AccountUpdateParams.Individual( this.address, this.addressKana, this.addressKanji, @@ -6601,25 +6661,25 @@ public Individual build() { } /** The individual's primary address. */ - public Builder setAddress(Address address) { + public Builder setAddress(AccountUpdateParams.Individual.Address address) { this.address = address; return this; } /** The Kana variation of the the individual's primary address (Japan only). */ - public Builder setAddressKana(AddressKana addressKana) { + public Builder setAddressKana(AccountUpdateParams.Individual.AddressKana addressKana) { this.addressKana = addressKana; return this; } /** The Kanji variation of the the individual's primary address (Japan only). */ - public Builder setAddressKanji(AddressKanji addressKanji) { + public Builder setAddressKanji(AccountUpdateParams.Individual.AddressKanji addressKanji) { this.addressKanji = addressKanji; return this; } /** The individual's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(AccountUpdateParams.Individual.Dob dob) { this.dob = dob; return this; } @@ -6927,13 +6987,15 @@ public Builder setPhone(EmptyParam phone) { * related persons, declares that they hold or have held an important public job or function, * in any jurisdiction. */ - public Builder setPoliticalExposure(PoliticalExposure politicalExposure) { + public Builder setPoliticalExposure( + AccountUpdateParams.Individual.PoliticalExposure politicalExposure) { this.politicalExposure = politicalExposure; return this; } /** The individual's registered address. */ - public Builder setRegisteredAddress(RegisteredAddress registeredAddress) { + public Builder setRegisteredAddress( + AccountUpdateParams.Individual.RegisteredAddress registeredAddress) { this.registeredAddress = registeredAddress; return this; } @@ -6951,7 +7013,7 @@ public Builder setSsnLast4(EmptyParam ssnLast4) { } /** The individual's verification document information. */ - public Builder setVerification(Verification verification) { + public Builder setVerification(AccountUpdateParams.Individual.Verification verification) { this.verification = verification; return this; } @@ -7032,8 +7094,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public AccountUpdateParams.Individual.Address build() { + return new AccountUpdateParams.Individual.Address( this.city, this.country, this.extraParams, @@ -7234,8 +7296,8 @@ public static class Builder { private Object town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKana build() { - return new AddressKana( + public AccountUpdateParams.Individual.AddressKana build() { + return new AccountUpdateParams.Individual.AddressKana( this.city, this.country, this.extraParams, @@ -7449,8 +7511,8 @@ public static class Builder { private Object town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKanji build() { - return new AddressKanji( + public AccountUpdateParams.Individual.AddressKanji build() { + return new AccountUpdateParams.Individual.AddressKanji( this.city, this.country, this.extraParams, @@ -7625,8 +7687,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public AccountUpdateParams.Individual.Dob build() { + return new AccountUpdateParams.Individual.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -7752,8 +7815,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public RegisteredAddress build() { - return new RegisteredAddress( + public AccountUpdateParams.Individual.RegisteredAddress build() { + return new AccountUpdateParams.Individual.RegisteredAddress( this.city, this.country, this.extraParams, @@ -7914,21 +7977,23 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Verification build() { - return new Verification(this.additionalDocument, this.document, this.extraParams); + public AccountUpdateParams.Individual.Verification build() { + return new AccountUpdateParams.Individual.Verification( + this.additionalDocument, this.document, this.extraParams); } /** * A document showing address, either a passport, local ID card, or utility bill from a * well-known utility company. */ - public Builder setAdditionalDocument(AdditionalDocument additionalDocument) { + public Builder setAdditionalDocument( + AccountUpdateParams.Individual.Verification.AdditionalDocument additionalDocument) { this.additionalDocument = additionalDocument; return this; } /** An identifying document, either a passport or local ID card. */ - public Builder setDocument(Document document) { + public Builder setDocument(AccountUpdateParams.Individual.Verification.Document document) { this.document = document; return this; } @@ -8010,8 +8075,9 @@ public static class Builder { private Object front; /** Finalize and obtain parameter instance from this builder. */ - public AdditionalDocument build() { - return new AdditionalDocument(this.back, this.extraParams, this.front); + public AccountUpdateParams.Individual.Verification.AdditionalDocument build() { + return new AccountUpdateParams.Individual.Verification.AdditionalDocument( + this.back, this.extraParams, this.front); } /** @@ -8138,8 +8204,9 @@ public static class Builder { private Object front; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document(this.back, this.extraParams, this.front); + public AccountUpdateParams.Individual.Verification.Document build() { + return new AccountUpdateParams.Individual.Verification.Document( + this.back, this.extraParams, this.front); } /** @@ -8308,8 +8375,8 @@ public static class Builder { private Treasury treasury; /** Finalize and obtain parameter instance from this builder. */ - public Settings build() { - return new Settings( + public AccountUpdateParams.Settings build() { + return new AccountUpdateParams.Settings( this.branding, this.cardIssuing, this.cardPayments, @@ -8323,19 +8390,19 @@ public Settings build() { * Settings used to apply the account's branding to email receipts, invoices, Checkout, and * other products. */ - public Builder setBranding(Branding branding) { + public Builder setBranding(AccountUpdateParams.Settings.Branding branding) { this.branding = branding; return this; } /** Settings specific to the account's use of the Card Issuing product. */ - public Builder setCardIssuing(CardIssuing cardIssuing) { + public Builder setCardIssuing(AccountUpdateParams.Settings.CardIssuing cardIssuing) { this.cardIssuing = cardIssuing; return this; } /** Settings specific to card charging on the account. */ - public Builder setCardPayments(CardPayments cardPayments) { + public Builder setCardPayments(AccountUpdateParams.Settings.CardPayments cardPayments) { this.cardPayments = cardPayments; return this; } @@ -8367,19 +8434,19 @@ public Builder putAllExtraParam(Map map) { } /** Settings that apply across payment methods for charging on the account. */ - public Builder setPayments(Payments payments) { + public Builder setPayments(AccountUpdateParams.Settings.Payments payments) { this.payments = payments; return this; } /** Settings specific to the account's payouts. */ - public Builder setPayouts(Payouts payouts) { + public Builder setPayouts(AccountUpdateParams.Settings.Payouts payouts) { this.payouts = payouts; return this; } /** Settings specific to the account's Treasury FinancialAccounts. */ - public Builder setTreasury(Treasury treasury) { + public Builder setTreasury(AccountUpdateParams.Settings.Treasury treasury) { this.treasury = treasury; return this; } @@ -8448,8 +8515,8 @@ public static class Builder { private Object secondaryColor; /** Finalize and obtain parameter instance from this builder. */ - public Branding build() { - return new Branding( + public AccountUpdateParams.Settings.Branding build() { + return new AccountUpdateParams.Settings.Branding( this.extraParams, this.icon, this.logo, this.primaryColor, this.secondaryColor); } @@ -8579,8 +8646,8 @@ public static class Builder { private TosAcceptance tosAcceptance; /** Finalize and obtain parameter instance from this builder. */ - public CardIssuing build() { - return new CardIssuing(this.extraParams, this.tosAcceptance); + public AccountUpdateParams.Settings.CardIssuing build() { + return new AccountUpdateParams.Settings.CardIssuing(this.extraParams, this.tosAcceptance); } /** @@ -8616,7 +8683,8 @@ public Builder putAllExtraParam(Map map) { * href="https://stripe.com/docs/issuing/connect/tos_acceptance">Stripe Issuing Terms and * Disclosures. */ - public Builder setTosAcceptance(TosAcceptance tosAcceptance) { + public Builder setTosAcceptance( + AccountUpdateParams.Settings.CardIssuing.TosAcceptance tosAcceptance) { this.tosAcceptance = tosAcceptance; return this; } @@ -8674,8 +8742,9 @@ public static class Builder { private Object userAgent; /** Finalize and obtain parameter instance from this builder. */ - public TosAcceptance build() { - return new TosAcceptance(this.date, this.extraParams, this.ip, this.userAgent); + public AccountUpdateParams.Settings.CardIssuing.TosAcceptance build() { + return new AccountUpdateParams.Settings.CardIssuing.TosAcceptance( + this.date, this.extraParams, this.ip, this.userAgent); } /** @@ -8828,8 +8897,8 @@ public static class Builder { private Object statementDescriptorPrefixKanji; /** Finalize and obtain parameter instance from this builder. */ - public CardPayments build() { - return new CardPayments( + public AccountUpdateParams.Settings.CardPayments build() { + return new AccountUpdateParams.Settings.CardPayments( this.declineOn, this.extraParams, this.statementDescriptorPrefix, @@ -8841,7 +8910,7 @@ public CardPayments build() { * Automatically declines certain charge types regardless of whether the card issuer * accepted or declined the charge. */ - public Builder setDeclineOn(DeclineOn declineOn) { + public Builder setDeclineOn(AccountUpdateParams.Settings.CardPayments.DeclineOn declineOn) { this.declineOn = declineOn; return this; } @@ -8991,8 +9060,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public DeclineOn build() { - return new DeclineOn(this.avsFailure, this.cvcFailure, this.extraParams); + public AccountUpdateParams.Settings.CardPayments.DeclineOn build() { + return new AccountUpdateParams.Settings.CardPayments.DeclineOn( + this.avsFailure, this.cvcFailure, this.extraParams); } /** @@ -9102,8 +9172,8 @@ public static class Builder { private Object statementDescriptorKanji; /** Finalize and obtain parameter instance from this builder. */ - public Payments build() { - return new Payments( + public AccountUpdateParams.Settings.Payments build() { + return new AccountUpdateParams.Settings.Payments( this.extraParams, this.statementDescriptor, this.statementDescriptorKana, @@ -9255,8 +9325,8 @@ public static class Builder { private Object statementDescriptor; /** Finalize and obtain parameter instance from this builder. */ - public Payouts build() { - return new Payouts( + public AccountUpdateParams.Settings.Payouts build() { + return new AccountUpdateParams.Settings.Payouts( this.debitNegativeBalances, this.extraParams, this.schedule, @@ -9308,7 +9378,7 @@ public Builder putAllExtraParam(Map map) { * href="https://stripe.com/docs/connect/bank-transfers#payout-information">Setting Bank and * Debit Card Payouts documentation. */ - public Builder setSchedule(Schedule schedule) { + public Builder setSchedule(AccountUpdateParams.Settings.Payouts.Schedule schedule) { this.schedule = schedule; return this; } @@ -9406,8 +9476,8 @@ public static class Builder { private WeeklyAnchor weeklyAnchor; /** Finalize and obtain parameter instance from this builder. */ - public Schedule build() { - return new Schedule( + public AccountUpdateParams.Settings.Payouts.Schedule build() { + return new AccountUpdateParams.Settings.Payouts.Schedule( this.delayDays, this.extraParams, this.interval, @@ -9421,7 +9491,8 @@ public Schedule build() { * Default is {@code minimum}. The {@code delay_days} parameter does not apply when the * {@code interval} is {@code manual}. */ - public Builder setDelayDays(DelayDays delayDays) { + public Builder setDelayDays( + AccountUpdateParams.Settings.Payouts.Schedule.DelayDays delayDays) { this.delayDays = delayDays; return this; } @@ -9469,7 +9540,8 @@ public Builder putAllExtraParam(Map map) { * How frequently available funds are paid out. One of: {@code daily}, {@code manual}, * {@code weekly}, or {@code monthly}. Default is {@code daily}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + AccountUpdateParams.Settings.Payouts.Schedule.Interval interval) { this.interval = interval; return this; } @@ -9490,7 +9562,8 @@ public Builder setMonthlyAnchor(Long monthlyAnchor) { * {@code tuesday}, etc. (required and applicable only if {@code interval} is {@code * weekly}.) */ - public Builder setWeeklyAnchor(WeeklyAnchor weeklyAnchor) { + public Builder setWeeklyAnchor( + AccountUpdateParams.Settings.Payouts.Schedule.WeeklyAnchor weeklyAnchor) { this.weeklyAnchor = weeklyAnchor; return this; } @@ -9591,8 +9664,8 @@ public static class Builder { private TosAcceptance tosAcceptance; /** Finalize and obtain parameter instance from this builder. */ - public Treasury build() { - return new Treasury(this.extraParams, this.tosAcceptance); + public AccountUpdateParams.Settings.Treasury build() { + return new AccountUpdateParams.Settings.Treasury(this.extraParams, this.tosAcceptance); } /** @@ -9624,7 +9697,8 @@ public Builder putAllExtraParam(Map map) { } /** Details on the account's acceptance of the Stripe Treasury Services Agreement. */ - public Builder setTosAcceptance(TosAcceptance tosAcceptance) { + public Builder setTosAcceptance( + AccountUpdateParams.Settings.Treasury.TosAcceptance tosAcceptance) { this.tosAcceptance = tosAcceptance; return this; } @@ -9682,8 +9756,9 @@ public static class Builder { private Object userAgent; /** Finalize and obtain parameter instance from this builder. */ - public TosAcceptance build() { - return new TosAcceptance(this.date, this.extraParams, this.ip, this.userAgent); + public AccountUpdateParams.Settings.Treasury.TosAcceptance build() { + return new AccountUpdateParams.Settings.Treasury.TosAcceptance( + this.date, this.extraParams, this.ip, this.userAgent); } /** @@ -9822,8 +9897,8 @@ public static class Builder { private Object userAgent; /** Finalize and obtain parameter instance from this builder. */ - public TosAcceptance build() { - return new TosAcceptance( + public AccountUpdateParams.TosAcceptance build() { + return new AccountUpdateParams.TosAcceptance( this.date, this.extraParams, this.ip, this.serviceAgreement, this.userAgent); } diff --git a/src/main/java/com/stripe/param/ApplicationFeeListParams.java b/src/main/java/com/stripe/param/ApplicationFeeListParams.java index 7ac574d52e1..b78de4ddaa2 100644 --- a/src/main/java/com/stripe/param/ApplicationFeeListParams.java +++ b/src/main/java/com/stripe/param/ApplicationFeeListParams.java @@ -110,7 +110,7 @@ public Builder setCharge(String charge) { return this; } - public Builder setCreated(Created created) { + public Builder setCreated(ApplicationFeeListParams.Created created) { this.created = created; return this; } @@ -255,8 +255,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public ApplicationFeeListParams.Created build() { + return new ApplicationFeeListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/BalanceTransactionListParams.java b/src/main/java/com/stripe/param/BalanceTransactionListParams.java index c2aa5d11ea0..142feb442b6 100644 --- a/src/main/java/com/stripe/param/BalanceTransactionListParams.java +++ b/src/main/java/com/stripe/param/BalanceTransactionListParams.java @@ -165,7 +165,7 @@ public BalanceTransactionListParams build() { * This parameter is deprecated and we recommend listing by created and filtering in memory * instead. */ - public Builder setAvailableOn(AvailableOn availableOn) { + public Builder setAvailableOn(BalanceTransactionListParams.AvailableOn availableOn) { this.availableOn = availableOn; return this; } @@ -179,7 +179,7 @@ public Builder setAvailableOn(Long availableOn) { return this; } - public Builder setCreated(Created created) { + public Builder setCreated(BalanceTransactionListParams.Created created) { this.created = created; return this; } @@ -366,8 +366,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public AvailableOn build() { - return new AvailableOn(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public BalanceTransactionListParams.AvailableOn build() { + return new BalanceTransactionListParams.AvailableOn( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -474,8 +475,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public BalanceTransactionListParams.Created build() { + return new BalanceTransactionListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/CashBalanceUpdateParams.java b/src/main/java/com/stripe/param/CashBalanceUpdateParams.java index a83e9cf2968..e5b0a7e182d 100644 --- a/src/main/java/com/stripe/param/CashBalanceUpdateParams.java +++ b/src/main/java/com/stripe/param/CashBalanceUpdateParams.java @@ -104,7 +104,7 @@ public Builder putAllExtraParam(Map map) { } /** A hash of settings for this cash balance. */ - public Builder setSettings(Settings settings) { + public Builder setSettings(CashBalanceUpdateParams.Settings settings) { this.settings = settings; return this; } @@ -145,8 +145,8 @@ public static class Builder { private ReconciliationMode reconciliationMode; /** Finalize and obtain parameter instance from this builder. */ - public Settings build() { - return new Settings(this.extraParams, this.reconciliationMode); + public CashBalanceUpdateParams.Settings build() { + return new CashBalanceUpdateParams.Settings(this.extraParams, this.reconciliationMode); } /** @@ -181,7 +181,8 @@ public Builder putAllExtraParam(Map map) { * reconciliation modes, see Reconciliation. */ - public Builder setReconciliationMode(ReconciliationMode reconciliationMode) { + public Builder setReconciliationMode( + CashBalanceUpdateParams.Settings.ReconciliationMode reconciliationMode) { this.reconciliationMode = reconciliationMode; return this; } diff --git a/src/main/java/com/stripe/param/ChargeCaptureParams.java b/src/main/java/com/stripe/param/ChargeCaptureParams.java index 53d8d2be205..7993a842bff 100644 --- a/src/main/java/com/stripe/param/ChargeCaptureParams.java +++ b/src/main/java/com/stripe/param/ChargeCaptureParams.java @@ -257,7 +257,7 @@ public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) { * destination charge. See the * Connect documentation for details. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(ChargeCaptureParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -307,8 +307,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.extraParams); + public ChargeCaptureParams.TransferData build() { + return new ChargeCaptureParams.TransferData(this.amount, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/ChargeCreateParams.java b/src/main/java/com/stripe/param/ChargeCreateParams.java index ba44c681e17..6ac04789925 100644 --- a/src/main/java/com/stripe/param/ChargeCreateParams.java +++ b/src/main/java/com/stripe/param/ChargeCreateParams.java @@ -357,7 +357,7 @@ public Builder setDescription(String description) { return this; } - public Builder setDestination(Destination destination) { + public Builder setDestination(ChargeCreateParams.Destination destination) { this.destination = destination; return this; } @@ -479,7 +479,7 @@ public Builder setOnBehalfOf(String onBehalfOf) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions(ChargeCreateParams.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -499,7 +499,7 @@ public Builder setReceiptEmail(String receiptEmail) { } /** Shipping information for the charge. Helps prevent fraud on charges for physical goods. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(ChargeCreateParams.Shipping shipping) { this.shipping = shipping; return this; } @@ -548,7 +548,7 @@ public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) { * destination charge. See the * Connect documentation for details. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(ChargeCreateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -605,8 +605,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Destination build() { - return new Destination(this.account, this.amount, this.extraParams); + public ChargeCreateParams.Destination build() { + return new ChargeCreateParams.Destination(this.account, this.amount, this.extraParams); } /** ID of an existing, connected Stripe account. */ @@ -687,8 +687,8 @@ public static class Builder { private String session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public ChargeCreateParams.RadarOptions build() { + return new ChargeCreateParams.RadarOptions(this.extraParams, this.session); } /** @@ -796,8 +796,8 @@ public static class Builder { private String trackingNumber; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping( + public ChargeCreateParams.Shipping build() { + return new ChargeCreateParams.Shipping( this.address, this.carrier, this.extraParams, @@ -807,7 +807,7 @@ public Shipping build() { } /** Shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(ChargeCreateParams.Shipping.Address address) { this.address = address; return this; } @@ -941,8 +941,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public ChargeCreateParams.Shipping.Address build() { + return new ChargeCreateParams.Shipping.Address( this.city, this.country, this.extraParams, @@ -1062,8 +1062,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.destination, this.extraParams); + public ChargeCreateParams.TransferData build() { + return new ChargeCreateParams.TransferData(this.amount, this.destination, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/ChargeListParams.java b/src/main/java/com/stripe/param/ChargeListParams.java index 515f88098ee..d2a204b0d9d 100644 --- a/src/main/java/com/stripe/param/ChargeListParams.java +++ b/src/main/java/com/stripe/param/ChargeListParams.java @@ -124,7 +124,7 @@ public ChargeListParams build() { this.transferGroup); } - public Builder setCreated(Created created) { + public Builder setCreated(ChargeListParams.Created created) { this.created = created; return this; } @@ -290,8 +290,8 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public ChargeListParams.Created build() { + return new ChargeListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/ChargeUpdateParams.java b/src/main/java/com/stripe/param/ChargeUpdateParams.java index e9140784b92..d1153214139 100644 --- a/src/main/java/com/stripe/param/ChargeUpdateParams.java +++ b/src/main/java/com/stripe/param/ChargeUpdateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -238,7 +237,7 @@ public Builder putAllExtraParam(Map map) { * value of {@code safe}. Stripe will use the information you send to improve our fraud * detection algorithms. */ - public Builder setFraudDetails(FraudDetails fraudDetails) { + public Builder setFraudDetails(ChargeUpdateParams.FraudDetails fraudDetails) { this.fraudDetails = fraudDetails; return this; } @@ -312,7 +311,7 @@ public Builder setReceiptEmail(EmptyParam receiptEmail) { } /** Shipping information for the charge. Helps prevent fraud on charges for physical goods. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(ChargeUpdateParams.Shipping shipping) { this.shipping = shipping; return this; } @@ -353,9 +352,9 @@ public static class FraudDetails { /** Either {@code safe} or {@code fraudulent}. */ @SerializedName("user_report") - EnumParam userReport; + ApiRequestParams.EnumParam userReport; - private FraudDetails(Map extraParams, EnumParam userReport) { + private FraudDetails(Map extraParams, ApiRequestParams.EnumParam userReport) { this.extraParams = extraParams; this.userReport = userReport; } @@ -367,11 +366,11 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam userReport; + private ApiRequestParams.EnumParam userReport; /** Finalize and obtain parameter instance from this builder. */ - public FraudDetails build() { - return new FraudDetails(this.extraParams, this.userReport); + public ChargeUpdateParams.FraudDetails build() { + return new ChargeUpdateParams.FraudDetails(this.extraParams, this.userReport); } /** @@ -401,7 +400,7 @@ public Builder putAllExtraParam(Map map) { } /** Either {@code safe} or {@code fraudulent}. */ - public Builder setUserReport(UserReport userReport) { + public Builder setUserReport(ChargeUpdateParams.FraudDetails.UserReport userReport) { this.userReport = userReport; return this; } @@ -496,8 +495,8 @@ public static class Builder { private Object trackingNumber; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping( + public ChargeUpdateParams.Shipping build() { + return new ChargeUpdateParams.Shipping( this.address, this.carrier, this.extraParams, @@ -507,7 +506,7 @@ public Shipping build() { } /** Shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(ChargeUpdateParams.Shipping.Address address) { this.address = address; return this; } @@ -668,8 +667,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public ChargeUpdateParams.Shipping.Address build() { + return new ChargeUpdateParams.Shipping.Address( this.city, this.country, this.extraParams, diff --git a/src/main/java/com/stripe/param/CouponCreateParams.java b/src/main/java/com/stripe/param/CouponCreateParams.java index deb966fe63d..819777f1ba0 100644 --- a/src/main/java/com/stripe/param/CouponCreateParams.java +++ b/src/main/java/com/stripe/param/CouponCreateParams.java @@ -38,7 +38,7 @@ public class CouponCreateParams extends ApiRequestParams { * href="https://stripe.com/docs/currencies">supported currency. */ @SerializedName("currency_options") - Map currencyOptions; + Map currencyOptions; /** * Specifies how long the discount will be in effect if used on a subscription. Can be {@code @@ -117,7 +117,7 @@ private CouponCreateParams( Long amountOff, AppliesTo appliesTo, String currency, - Map currencyOptions, + Map currencyOptions, Duration duration, Long durationInMonths, List expand, @@ -155,7 +155,7 @@ public static class Builder { private String currency; - private Map currencyOptions; + private Map currencyOptions; private Duration duration; @@ -206,7 +206,7 @@ public Builder setAmountOff(Long amountOff) { } /** A hash containing directions for what this Coupon will apply discounts to. */ - public Builder setAppliesTo(AppliesTo appliesTo) { + public Builder setAppliesTo(CouponCreateParams.AppliesTo appliesTo) { this.appliesTo = appliesTo; return this; } @@ -225,7 +225,7 @@ public Builder setCurrency(String currency) { * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link CouponCreateParams#currencyOptions} for the field documentation. */ - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption(String key, CouponCreateParams.CurrencyOption value) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -238,7 +238,7 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link CouponCreateParams#currencyOptions} for the field documentation. */ - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption(Map map) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -250,7 +250,7 @@ public Builder putAllCurrencyOption(Map map) { * Specifies how long the discount will be in effect if used on a subscription. Can be {@code * forever}, {@code once}, or {@code repeating}. Defaults to {@code once}. */ - public Builder setDuration(Duration duration) { + public Builder setDuration(CouponCreateParams.Duration duration) { this.duration = duration; return this; } @@ -444,8 +444,8 @@ public static class Builder { private List products; /** Finalize and obtain parameter instance from this builder. */ - public AppliesTo build() { - return new AppliesTo(this.extraParams, this.products); + public CouponCreateParams.AppliesTo build() { + return new CouponCreateParams.AppliesTo(this.extraParams, this.products); } /** @@ -532,8 +532,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption(this.amountOff, this.extraParams); + public CouponCreateParams.CurrencyOption build() { + return new CouponCreateParams.CurrencyOption(this.amountOff, this.extraParams); } /** A positive integer representing the amount to subtract from an invoice total. */ diff --git a/src/main/java/com/stripe/param/CouponListParams.java b/src/main/java/com/stripe/param/CouponListParams.java index 86c24b5c0d7..844ef9ffaad 100644 --- a/src/main/java/com/stripe/param/CouponListParams.java +++ b/src/main/java/com/stripe/param/CouponListParams.java @@ -104,7 +104,7 @@ public CouponListParams build() { * with an integer Unix timestamp, or it can be a dictionary with a number of different query * options. */ - public Builder setCreated(Created created) { + public Builder setCreated(CouponListParams.Created created) { this.created = created; return this; } @@ -254,8 +254,8 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public CouponListParams.Created build() { + return new CouponListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/CouponUpdateParams.java b/src/main/java/com/stripe/param/CouponUpdateParams.java index 883cf64eb71..5acc40dae23 100644 --- a/src/main/java/com/stripe/param/CouponUpdateParams.java +++ b/src/main/java/com/stripe/param/CouponUpdateParams.java @@ -19,7 +19,7 @@ public class CouponUpdateParams extends ApiRequestParams { * href="https://stripe.com/docs/currencies">supported currency. */ @SerializedName("currency_options") - Map currencyOptions; + Map currencyOptions; /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") @@ -51,7 +51,7 @@ public class CouponUpdateParams extends ApiRequestParams { Object name; private CouponUpdateParams( - Map currencyOptions, + Map currencyOptions, List expand, Map extraParams, Object metadata, @@ -68,7 +68,7 @@ public static Builder builder() { } public static class Builder { - private Map currencyOptions; + private Map currencyOptions; private List expand; @@ -89,7 +89,7 @@ public CouponUpdateParams build() { * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link CouponUpdateParams#currencyOptions} for the field documentation. */ - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption(String key, CouponUpdateParams.CurrencyOption value) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -102,7 +102,7 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link CouponUpdateParams#currencyOptions} for the field documentation. */ - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption(Map map) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -261,8 +261,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption(this.amountOff, this.extraParams); + public CouponUpdateParams.CurrencyOption build() { + return new CouponUpdateParams.CurrencyOption(this.amountOff, this.extraParams); } /** A positive integer representing the amount to subtract from an invoice total. */ diff --git a/src/main/java/com/stripe/param/CreditNoteCreateParams.java b/src/main/java/com/stripe/param/CreditNoteCreateParams.java index a3f148af6ea..e61c05fa3fb 100644 --- a/src/main/java/com/stripe/param/CreditNoteCreateParams.java +++ b/src/main/java/com/stripe/param/CreditNoteCreateParams.java @@ -46,7 +46,7 @@ public class CreditNoteCreateParams extends ApiRequestParams { /** Line items that make up the credit note. */ @SerializedName("lines") - List lines; + List lines; /** The credit note's memo appears on the credit note PDF. */ @SerializedName("memo") @@ -92,7 +92,7 @@ private CreditNoteCreateParams( List expand, Map extraParams, String invoice, - List lines, + List lines, String memo, Map metadata, Long outOfBandAmount, @@ -128,7 +128,7 @@ public static class Builder { private String invoice; - private List lines; + private List lines; private String memo; @@ -240,7 +240,7 @@ public Builder setInvoice(String invoice) { * subsequent calls adds additional elements to the original list. See {@link * CreditNoteCreateParams#lines} for the field documentation. */ - public Builder addLine(Line element) { + public Builder addLine(CreditNoteCreateParams.Line element) { if (this.lines == null) { this.lines = new ArrayList<>(); } @@ -253,7 +253,7 @@ public Builder addLine(Line element) { * subsequent calls adds additional elements to the original list. See {@link * CreditNoteCreateParams#lines} for the field documentation. */ - public Builder addAllLine(List elements) { + public Builder addAllLine(List elements) { if (this.lines == null) { this.lines = new ArrayList<>(); } @@ -306,7 +306,7 @@ public Builder setOutOfBandAmount(Long outOfBandAmount) { * Reason for issuing this credit note, one of {@code duplicate}, {@code fraudulent}, {@code * order_change}, or {@code product_unsatisfactory}. */ - public Builder setReason(Reason reason) { + public Builder setReason(CreditNoteCreateParams.Reason reason) { this.reason = reason; return this; } @@ -437,8 +437,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public Line build() { - return new Line( + public CreditNoteCreateParams.Line build() { + return new CreditNoteCreateParams.Line( this.amount, this.description, this.extraParams, @@ -558,7 +558,7 @@ public Builder setTaxRates(List taxRates) { * Type of the credit note line item, one of {@code invoice_line_item} or {@code * custom_line_item}. */ - public Builder setType(Type type) { + public Builder setType(CreditNoteCreateParams.Line.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/CreditNotePreviewParams.java b/src/main/java/com/stripe/param/CreditNotePreviewParams.java index eea1313023a..f39032a53a7 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewParams.java @@ -46,7 +46,7 @@ public class CreditNotePreviewParams extends ApiRequestParams { /** Line items that make up the credit note. */ @SerializedName("lines") - List lines; + List lines; /** The credit note's memo appears on the credit note PDF. */ @SerializedName("memo") @@ -92,7 +92,7 @@ private CreditNotePreviewParams( List expand, Map extraParams, String invoice, - List lines, + List lines, String memo, Map metadata, Long outOfBandAmount, @@ -128,7 +128,7 @@ public static class Builder { private String invoice; - private List lines; + private List lines; private String memo; @@ -240,7 +240,7 @@ public Builder setInvoice(String invoice) { * subsequent calls adds additional elements to the original list. See {@link * CreditNotePreviewParams#lines} for the field documentation. */ - public Builder addLine(Line element) { + public Builder addLine(CreditNotePreviewParams.Line element) { if (this.lines == null) { this.lines = new ArrayList<>(); } @@ -253,7 +253,7 @@ public Builder addLine(Line element) { * subsequent calls adds additional elements to the original list. See {@link * CreditNotePreviewParams#lines} for the field documentation. */ - public Builder addAllLine(List elements) { + public Builder addAllLine(List elements) { if (this.lines == null) { this.lines = new ArrayList<>(); } @@ -306,7 +306,7 @@ public Builder setOutOfBandAmount(Long outOfBandAmount) { * Reason for issuing this credit note, one of {@code duplicate}, {@code fraudulent}, {@code * order_change}, or {@code product_unsatisfactory}. */ - public Builder setReason(Reason reason) { + public Builder setReason(CreditNotePreviewParams.Reason reason) { this.reason = reason; return this; } @@ -437,8 +437,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public Line build() { - return new Line( + public CreditNotePreviewParams.Line build() { + return new CreditNotePreviewParams.Line( this.amount, this.description, this.extraParams, @@ -558,7 +558,7 @@ public Builder setTaxRates(List taxRates) { * Type of the credit note line item, one of {@code invoice_line_item} or {@code * custom_line_item}. */ - public Builder setType(Type type) { + public Builder setType(CreditNotePreviewParams.Line.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/CustomerCreateFundingInstructionsParams.java b/src/main/java/com/stripe/param/CustomerCreateFundingInstructionsParams.java index 2ea637abe02..13597142a89 100644 --- a/src/main/java/com/stripe/param/CustomerCreateFundingInstructionsParams.java +++ b/src/main/java/com/stripe/param/CustomerCreateFundingInstructionsParams.java @@ -74,7 +74,8 @@ public CustomerCreateFundingInstructionsParams build() { } /** Additional parameters for {@code bank_transfer} funding types. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + CustomerCreateFundingInstructionsParams.BankTransfer bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -142,7 +143,7 @@ public Builder putAllExtraParam(Map map) { } /** The {@code funding_type} to get the instructions for. */ - public Builder setFundingType(FundingType fundingType) { + public Builder setFundingType(CustomerCreateFundingInstructionsParams.FundingType fundingType) { this.fundingType = fundingType; return this; } @@ -171,7 +172,8 @@ public static class BankTransfer { * spei}. */ @SerializedName("requested_address_types") - List requestedAddressTypes; + List + requestedAddressTypes; /** The type of the {@code bank_transfer}. */ @SerializedName("type") @@ -180,7 +182,8 @@ public static class BankTransfer { private BankTransfer( EuBankTransfer euBankTransfer, Map extraParams, - List requestedAddressTypes, + List + requestedAddressTypes, Type type) { this.euBankTransfer = euBankTransfer; this.extraParams = extraParams; @@ -197,18 +200,20 @@ public static class Builder { private Map extraParams; - private List requestedAddressTypes; + private List + requestedAddressTypes; private Type type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer( + public CustomerCreateFundingInstructionsParams.BankTransfer build() { + return new CustomerCreateFundingInstructionsParams.BankTransfer( this.euBankTransfer, this.extraParams, this.requestedAddressTypes, this.type); } /** Configuration for eu_bank_transfer funding type. */ - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + CustomerCreateFundingInstructionsParams.BankTransfer.EuBankTransfer euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -247,7 +252,8 @@ public Builder putAllExtraParam(Map map) { * {@link CustomerCreateFundingInstructionsParams.BankTransfer#requestedAddressTypes} for the * field documentation. */ - public Builder addRequestedAddressType(RequestedAddressType element) { + public Builder addRequestedAddressType( + CustomerCreateFundingInstructionsParams.BankTransfer.RequestedAddressType element) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -261,7 +267,9 @@ public Builder addRequestedAddressType(RequestedAddressType element) { * {@link CustomerCreateFundingInstructionsParams.BankTransfer#requestedAddressTypes} for the * field documentation. */ - public Builder addAllRequestedAddressType(List elements) { + public Builder addAllRequestedAddressType( + List + elements) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -270,7 +278,7 @@ public Builder addAllRequestedAddressType(List elements) { } /** The type of the {@code bank_transfer}. */ - public Builder setType(Type type) { + public Builder setType(CustomerCreateFundingInstructionsParams.BankTransfer.Type type) { this.type = type; return this; } @@ -309,8 +317,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public CustomerCreateFundingInstructionsParams.BankTransfer.EuBankTransfer build() { + return new CustomerCreateFundingInstructionsParams.BankTransfer.EuBankTransfer( + this.country, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/CustomerCreateParams.java b/src/main/java/com/stripe/param/CustomerCreateParams.java index a7e56b58411..74538d6fe2f 100644 --- a/src/main/java/com/stripe/param/CustomerCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerCreateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -120,11 +119,11 @@ public class CustomerCreateParams extends ApiRequestParams { /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */ @SerializedName("tax_exempt") - EnumParam taxExempt; + ApiRequestParams.EnumParam taxExempt; /** The customer's tax IDs. */ @SerializedName("tax_id_data") - List taxIdData; + List taxIdData; /** ID of the test clock to attach to the customer. */ @SerializedName("test_clock") @@ -154,8 +153,8 @@ private CustomerCreateParams( Object shipping, String source, Tax tax, - EnumParam taxExempt, - List taxIdData, + ApiRequestParams.EnumParam taxExempt, + List taxIdData, String testClock, Boolean validate) { this.address = address; @@ -229,9 +228,9 @@ public static class Builder { private Tax tax; - private EnumParam taxExempt; + private ApiRequestParams.EnumParam taxExempt; - private List taxIdData; + private List taxIdData; private String testClock; @@ -267,7 +266,7 @@ public CustomerCreateParams build() { } /** The customer's address. */ - public Builder setAddress(Address address) { + public Builder setAddress(CustomerCreateParams.Address address) { this.address = address; return this; } @@ -290,7 +289,7 @@ public Builder setBalance(Long balance) { } /** Balance information and default balance settings for this customer. */ - public Builder setCashBalance(CashBalance cashBalance) { + public Builder setCashBalance(CustomerCreateParams.CashBalance cashBalance) { this.cashBalance = cashBalance; return this; } @@ -380,7 +379,7 @@ public Builder setInvoicePrefix(String invoicePrefix) { } /** Default invoice settings for this customer. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings(CustomerCreateParams.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -495,7 +494,7 @@ public Builder setPromotionCode(String promotionCode) { } /** The customer's shipping information. Appears on invoices emailed to this customer. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(CustomerCreateParams.Shipping shipping) { this.shipping = shipping; return this; } @@ -512,13 +511,13 @@ public Builder setSource(String source) { } /** Tax details about the customer. */ - public Builder setTax(Tax tax) { + public Builder setTax(CustomerCreateParams.Tax tax) { this.tax = tax; return this; } /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */ - public Builder setTaxExempt(TaxExempt taxExempt) { + public Builder setTaxExempt(CustomerCreateParams.TaxExempt taxExempt) { this.taxExempt = taxExempt; return this; } @@ -534,7 +533,7 @@ public Builder setTaxExempt(EmptyParam taxExempt) { * and subsequent calls adds additional elements to the original list. See {@link * CustomerCreateParams#taxIdData} for the field documentation. */ - public Builder addTaxIdData(TaxIdData element) { + public Builder addTaxIdData(CustomerCreateParams.TaxIdData element) { if (this.taxIdData == null) { this.taxIdData = new ArrayList<>(); } @@ -547,7 +546,7 @@ public Builder addTaxIdData(TaxIdData element) { * and subsequent calls adds additional elements to the original list. See {@link * CustomerCreateParams#taxIdData} for the field documentation. */ - public Builder addAllTaxIdData(List elements) { + public Builder addAllTaxIdData(List elements) { if (this.taxIdData == null) { this.taxIdData = new ArrayList<>(); } @@ -642,8 +641,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public CustomerCreateParams.Address build() { + return new CustomerCreateParams.Address( this.city, this.country, this.extraParams, @@ -753,8 +752,8 @@ public static class Builder { private Settings settings; /** Finalize and obtain parameter instance from this builder. */ - public CashBalance build() { - return new CashBalance(this.extraParams, this.settings); + public CustomerCreateParams.CashBalance build() { + return new CustomerCreateParams.CashBalance(this.extraParams, this.settings); } /** @@ -787,7 +786,7 @@ public Builder putAllExtraParam(Map map) { * Settings controlling the behavior of the customer's cash balance, such as reconciliation of * funds received. */ - public Builder setSettings(Settings settings) { + public Builder setSettings(CustomerCreateParams.CashBalance.Settings settings) { this.settings = settings; return this; } @@ -828,8 +827,9 @@ public static class Builder { private ReconciliationMode reconciliationMode; /** Finalize and obtain parameter instance from this builder. */ - public Settings build() { - return new Settings(this.extraParams, this.reconciliationMode); + public CustomerCreateParams.CashBalance.Settings build() { + return new CustomerCreateParams.CashBalance.Settings( + this.extraParams, this.reconciliationMode); } /** @@ -866,7 +866,8 @@ public Builder putAllExtraParam(Map map) { * about these reconciliation modes, see Reconciliation. */ - public Builder setReconciliationMode(ReconciliationMode reconciliationMode) { + public Builder setReconciliationMode( + CustomerCreateParams.CashBalance.Settings.ReconciliationMode reconciliationMode) { this.reconciliationMode = reconciliationMode; return this; } @@ -951,8 +952,8 @@ public static class Builder { private Object renderingOptions; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings( + public CustomerCreateParams.InvoiceSettings build() { + return new CustomerCreateParams.InvoiceSettings( this.customFields, this.defaultPaymentMethod, this.extraParams, @@ -966,7 +967,7 @@ public InvoiceSettings build() { * CustomerCreateParams.InvoiceSettings#customFields} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addCustomField(CustomField element) { + public Builder addCustomField(CustomerCreateParams.InvoiceSettings.CustomField element) { if (this.customFields == null || this.customFields instanceof EmptyParam) { this.customFields = new ArrayList(); } @@ -980,7 +981,8 @@ public Builder addCustomField(CustomField element) { * CustomerCreateParams.InvoiceSettings#customFields} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllCustomField(List elements) { + public Builder addAllCustomField( + List elements) { if (this.customFields == null || this.customFields instanceof EmptyParam) { this.customFields = new ArrayList(); } @@ -1002,7 +1004,8 @@ public Builder setCustomFields(EmptyParam customFields) { * Default custom fields to be displayed on invoices for this customer. When updating, pass an * empty string to remove previously-defined fields. */ - public Builder setCustomFields(List customFields) { + public Builder setCustomFields( + List customFields) { this.customFields = customFields; return this; } @@ -1049,7 +1052,8 @@ public Builder setFooter(String footer) { } /** Default options for invoice PDF rendering for this customer. */ - public Builder setRenderingOptions(RenderingOptions renderingOptions) { + public Builder setRenderingOptions( + CustomerCreateParams.InvoiceSettings.RenderingOptions renderingOptions) { this.renderingOptions = renderingOptions; return this; } @@ -1098,8 +1102,9 @@ public static class Builder { private String value; /** Finalize and obtain parameter instance from this builder. */ - public CustomField build() { - return new CustomField(this.extraParams, this.name, this.value); + public CustomerCreateParams.InvoiceSettings.CustomField build() { + return new CustomerCreateParams.InvoiceSettings.CustomField( + this.extraParams, this.name, this.value); } /** @@ -1153,7 +1158,7 @@ public static class RenderingOptions { * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. */ @SerializedName("amount_tax_display") - EnumParam amountTaxDisplay; + ApiRequestParams.EnumParam amountTaxDisplay; /** * Map of extra parameters for custom features not available in this client library. The @@ -1164,7 +1169,8 @@ public static class RenderingOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private RenderingOptions(EnumParam amountTaxDisplay, Map extraParams) { + private RenderingOptions( + ApiRequestParams.EnumParam amountTaxDisplay, Map extraParams) { this.amountTaxDisplay = amountTaxDisplay; this.extraParams = extraParams; } @@ -1174,13 +1180,14 @@ public static Builder builder() { } public static class Builder { - private EnumParam amountTaxDisplay; + private ApiRequestParams.EnumParam amountTaxDisplay; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public RenderingOptions build() { - return new RenderingOptions(this.amountTaxDisplay, this.extraParams); + public CustomerCreateParams.InvoiceSettings.RenderingOptions build() { + return new CustomerCreateParams.InvoiceSettings.RenderingOptions( + this.amountTaxDisplay, this.extraParams); } /** @@ -1190,7 +1197,9 @@ public RenderingOptions build() { * PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive alike) * from invoice PDF amounts. */ - public Builder setAmountTaxDisplay(AmountTaxDisplay amountTaxDisplay) { + public Builder setAmountTaxDisplay( + CustomerCreateParams.InvoiceSettings.RenderingOptions.AmountTaxDisplay + amountTaxDisplay) { this.amountTaxDisplay = amountTaxDisplay; return this; } @@ -1297,12 +1306,13 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping(this.address, this.extraParams, this.name, this.phone); + public CustomerCreateParams.Shipping build() { + return new CustomerCreateParams.Shipping( + this.address, this.extraParams, this.name, this.phone); } /** Customer shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(CustomerCreateParams.Shipping.Address address) { this.address = address; return this; } @@ -1421,8 +1431,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public CustomerCreateParams.Shipping.Address build() { + return new CustomerCreateParams.Shipping.Address( this.city, this.country, this.extraParams, @@ -1537,8 +1547,8 @@ public static class Builder { private Object ipAddress; /** Finalize and obtain parameter instance from this builder. */ - public Tax build() { - return new Tax(this.extraParams, this.ipAddress); + public CustomerCreateParams.Tax build() { + return new CustomerCreateParams.Tax(this.extraParams, this.ipAddress); } /** @@ -1638,8 +1648,8 @@ public static class Builder { private String value; /** Finalize and obtain parameter instance from this builder. */ - public TaxIdData build() { - return new TaxIdData(this.extraParams, this.type, this.value); + public CustomerCreateParams.TaxIdData build() { + return new CustomerCreateParams.TaxIdData(this.extraParams, this.type, this.value); } /** @@ -1679,7 +1689,7 @@ public Builder putAllExtraParam(Map map) { * {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code * th_vat}, {@code tw_vat}, {@code ua_vat}, {@code us_ein}, or {@code za_vat}. */ - public Builder setType(Type type) { + public Builder setType(CustomerCreateParams.TaxIdData.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/CustomerListParams.java b/src/main/java/com/stripe/param/CustomerListParams.java index dedbb8df7c0..c93fe57973e 100644 --- a/src/main/java/com/stripe/param/CustomerListParams.java +++ b/src/main/java/com/stripe/param/CustomerListParams.java @@ -119,7 +119,7 @@ public CustomerListParams build() { this.testClock); } - public Builder setCreated(Created created) { + public Builder setCreated(CustomerListParams.Created created) { this.created = created; return this; } @@ -282,8 +282,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public CustomerListParams.Created build() { + return new CustomerListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java index ea6e3802f2b..e0a26ea0b18 100644 --- a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java +++ b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java @@ -180,7 +180,7 @@ public Builder setStartingAfter(String startingAfter) { } /** A required filter on the list, based on the object {@code type} field. */ - public Builder setType(Type type) { + public Builder setType(CustomerListPaymentMethodsParams.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/CustomerUpdateParams.java b/src/main/java/com/stripe/param/CustomerUpdateParams.java index 52f197d7302..51cd76f90a5 100644 --- a/src/main/java/com/stripe/param/CustomerUpdateParams.java +++ b/src/main/java/com/stripe/param/CustomerUpdateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -131,7 +130,7 @@ public class CustomerUpdateParams extends ApiRequestParams { /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */ @SerializedName("tax_exempt") - EnumParam taxExempt; + ApiRequestParams.EnumParam taxExempt; @SerializedName("validate") Boolean validate; @@ -157,7 +156,7 @@ private CustomerUpdateParams( Object shipping, Object source, Tax tax, - EnumParam taxExempt, + ApiRequestParams.EnumParam taxExempt, Boolean validate) { this.address = address; this.balance = balance; @@ -228,7 +227,7 @@ public static class Builder { private Tax tax; - private EnumParam taxExempt; + private ApiRequestParams.EnumParam taxExempt; private Boolean validate; @@ -260,7 +259,7 @@ public CustomerUpdateParams build() { } /** The customer's address. */ - public Builder setAddress(Address address) { + public Builder setAddress(CustomerUpdateParams.Address address) { this.address = address; return this; } @@ -283,7 +282,7 @@ public Builder setBalance(Long balance) { } /** Balance information and default balance settings for this customer. */ - public Builder setCashBalance(CashBalance cashBalance) { + public Builder setCashBalance(CustomerUpdateParams.CashBalance cashBalance) { this.cashBalance = cashBalance; return this; } @@ -439,7 +438,7 @@ public Builder setInvoicePrefix(EmptyParam invoicePrefix) { } /** Default invoice settings for this customer. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings(CustomerUpdateParams.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -571,7 +570,7 @@ public Builder setPromotionCode(EmptyParam promotionCode) { } /** The customer's shipping information. Appears on invoices emailed to this customer. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(CustomerUpdateParams.Shipping shipping) { this.shipping = shipping; return this; } @@ -593,13 +592,13 @@ public Builder setSource(EmptyParam source) { } /** Tax details about the customer. */ - public Builder setTax(Tax tax) { + public Builder setTax(CustomerUpdateParams.Tax tax) { this.tax = tax; return this; } /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */ - public Builder setTaxExempt(TaxExempt taxExempt) { + public Builder setTaxExempt(CustomerUpdateParams.TaxExempt taxExempt) { this.taxExempt = taxExempt; return this; } @@ -691,8 +690,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public CustomerUpdateParams.Address build() { + return new CustomerUpdateParams.Address( this.city, this.country, this.extraParams, @@ -841,8 +840,8 @@ public static class Builder { private Settings settings; /** Finalize and obtain parameter instance from this builder. */ - public CashBalance build() { - return new CashBalance(this.extraParams, this.settings); + public CustomerUpdateParams.CashBalance build() { + return new CustomerUpdateParams.CashBalance(this.extraParams, this.settings); } /** @@ -875,7 +874,7 @@ public Builder putAllExtraParam(Map map) { * Settings controlling the behavior of the customer's cash balance, such as reconciliation of * funds received. */ - public Builder setSettings(Settings settings) { + public Builder setSettings(CustomerUpdateParams.CashBalance.Settings settings) { this.settings = settings; return this; } @@ -916,8 +915,9 @@ public static class Builder { private ReconciliationMode reconciliationMode; /** Finalize and obtain parameter instance from this builder. */ - public Settings build() { - return new Settings(this.extraParams, this.reconciliationMode); + public CustomerUpdateParams.CashBalance.Settings build() { + return new CustomerUpdateParams.CashBalance.Settings( + this.extraParams, this.reconciliationMode); } /** @@ -954,7 +954,8 @@ public Builder putAllExtraParam(Map map) { * about these reconciliation modes, see Reconciliation. */ - public Builder setReconciliationMode(ReconciliationMode reconciliationMode) { + public Builder setReconciliationMode( + CustomerUpdateParams.CashBalance.Settings.ReconciliationMode reconciliationMode) { this.reconciliationMode = reconciliationMode; return this; } @@ -1039,8 +1040,8 @@ public static class Builder { private Object renderingOptions; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings( + public CustomerUpdateParams.InvoiceSettings build() { + return new CustomerUpdateParams.InvoiceSettings( this.customFields, this.defaultPaymentMethod, this.extraParams, @@ -1054,7 +1055,7 @@ public InvoiceSettings build() { * CustomerUpdateParams.InvoiceSettings#customFields} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addCustomField(CustomField element) { + public Builder addCustomField(CustomerUpdateParams.InvoiceSettings.CustomField element) { if (this.customFields == null || this.customFields instanceof EmptyParam) { this.customFields = new ArrayList(); } @@ -1068,7 +1069,8 @@ public Builder addCustomField(CustomField element) { * CustomerUpdateParams.InvoiceSettings#customFields} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllCustomField(List elements) { + public Builder addAllCustomField( + List elements) { if (this.customFields == null || this.customFields instanceof EmptyParam) { this.customFields = new ArrayList(); } @@ -1090,7 +1092,8 @@ public Builder setCustomFields(EmptyParam customFields) { * Default custom fields to be displayed on invoices for this customer. When updating, pass an * empty string to remove previously-defined fields. */ - public Builder setCustomFields(List customFields) { + public Builder setCustomFields( + List customFields) { this.customFields = customFields; return this; } @@ -1152,7 +1155,8 @@ public Builder setFooter(EmptyParam footer) { } /** Default options for invoice PDF rendering for this customer. */ - public Builder setRenderingOptions(RenderingOptions renderingOptions) { + public Builder setRenderingOptions( + CustomerUpdateParams.InvoiceSettings.RenderingOptions renderingOptions) { this.renderingOptions = renderingOptions; return this; } @@ -1201,8 +1205,9 @@ public static class Builder { private Object value; /** Finalize and obtain parameter instance from this builder. */ - public CustomField build() { - return new CustomField(this.extraParams, this.name, this.value); + public CustomerUpdateParams.InvoiceSettings.CustomField build() { + return new CustomerUpdateParams.InvoiceSettings.CustomField( + this.extraParams, this.name, this.value); } /** @@ -1268,7 +1273,7 @@ public static class RenderingOptions { * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. */ @SerializedName("amount_tax_display") - EnumParam amountTaxDisplay; + ApiRequestParams.EnumParam amountTaxDisplay; /** * Map of extra parameters for custom features not available in this client library. The @@ -1279,7 +1284,8 @@ public static class RenderingOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private RenderingOptions(EnumParam amountTaxDisplay, Map extraParams) { + private RenderingOptions( + ApiRequestParams.EnumParam amountTaxDisplay, Map extraParams) { this.amountTaxDisplay = amountTaxDisplay; this.extraParams = extraParams; } @@ -1289,13 +1295,14 @@ public static Builder builder() { } public static class Builder { - private EnumParam amountTaxDisplay; + private ApiRequestParams.EnumParam amountTaxDisplay; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public RenderingOptions build() { - return new RenderingOptions(this.amountTaxDisplay, this.extraParams); + public CustomerUpdateParams.InvoiceSettings.RenderingOptions build() { + return new CustomerUpdateParams.InvoiceSettings.RenderingOptions( + this.amountTaxDisplay, this.extraParams); } /** @@ -1305,7 +1312,9 @@ public RenderingOptions build() { * PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive alike) * from invoice PDF amounts. */ - public Builder setAmountTaxDisplay(AmountTaxDisplay amountTaxDisplay) { + public Builder setAmountTaxDisplay( + CustomerUpdateParams.InvoiceSettings.RenderingOptions.AmountTaxDisplay + amountTaxDisplay) { this.amountTaxDisplay = amountTaxDisplay; return this; } @@ -1412,12 +1421,13 @@ public static class Builder { private Object phone; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping(this.address, this.extraParams, this.name, this.phone); + public CustomerUpdateParams.Shipping build() { + return new CustomerUpdateParams.Shipping( + this.address, this.extraParams, this.name, this.phone); } /** Customer shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(CustomerUpdateParams.Shipping.Address address) { this.address = address; return this; } @@ -1548,8 +1558,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public CustomerUpdateParams.Shipping.Address build() { + return new CustomerUpdateParams.Shipping.Address( this.city, this.country, this.extraParams, @@ -1703,8 +1713,8 @@ public static class Builder { private Object ipAddress; /** Finalize and obtain parameter instance from this builder. */ - public Tax build() { - return new Tax(this.extraParams, this.ipAddress); + public CustomerUpdateParams.Tax build() { + return new CustomerUpdateParams.Tax(this.extraParams, this.ipAddress); } /** diff --git a/src/main/java/com/stripe/param/DisputeListParams.java b/src/main/java/com/stripe/param/DisputeListParams.java index 28ad10010ce..c9dad3d6b4b 100644 --- a/src/main/java/com/stripe/param/DisputeListParams.java +++ b/src/main/java/com/stripe/param/DisputeListParams.java @@ -119,7 +119,7 @@ public Builder setCharge(String charge) { return this; } - public Builder setCreated(Created created) { + public Builder setCreated(DisputeListParams.Created created) { this.created = created; return this; } @@ -270,8 +270,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public DisputeListParams.Created build() { + return new DisputeListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/DisputeUpdateParams.java b/src/main/java/com/stripe/param/DisputeUpdateParams.java index 5d5fe87acdb..06818e7a66e 100644 --- a/src/main/java/com/stripe/param/DisputeUpdateParams.java +++ b/src/main/java/com/stripe/param/DisputeUpdateParams.java @@ -89,7 +89,7 @@ public DisputeUpdateParams build() { * fields in the hash for review. The combined character count of all fields is limited to * 150,000. */ - public Builder setEvidence(Evidence evidence) { + public Builder setEvidence(DisputeUpdateParams.Evidence evidence) { this.evidence = evidence; return this; } @@ -520,8 +520,8 @@ public static class Builder { private Object uncategorizedText; /** Finalize and obtain parameter instance from this builder. */ - public Evidence build() { - return new Evidence( + public DisputeUpdateParams.Evidence build() { + return new DisputeUpdateParams.Evidence( this.accessActivityLog, this.billingAddress, this.cancellationPolicy, diff --git a/src/main/java/com/stripe/param/EventListParams.java b/src/main/java/com/stripe/param/EventListParams.java index bee7b474ec8..1f9bcf7f0be 100644 --- a/src/main/java/com/stripe/param/EventListParams.java +++ b/src/main/java/com/stripe/param/EventListParams.java @@ -132,7 +132,7 @@ public EventListParams build() { this.types); } - public Builder setCreated(Created created) { + public Builder setCreated(EventListParams.Created created) { this.created = created; return this; } @@ -321,8 +321,8 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public EventListParams.Created build() { + return new EventListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/ExternalAccountUpdateParams.java b/src/main/java/com/stripe/param/ExternalAccountUpdateParams.java index f1d02809fdb..b87eb9ab638 100644 --- a/src/main/java/com/stripe/param/ExternalAccountUpdateParams.java +++ b/src/main/java/com/stripe/param/ExternalAccountUpdateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -22,7 +21,7 @@ public class ExternalAccountUpdateParams extends ApiRequestParams { * company}. */ @SerializedName("account_holder_type") - EnumParam accountHolderType; + ApiRequestParams.EnumParam accountHolderType; /** * The bank account type. This can only be {@code checking} or {@code savings} in most countries. @@ -95,7 +94,7 @@ public class ExternalAccountUpdateParams extends ApiRequestParams { private ExternalAccountUpdateParams( Object accountHolderName, - EnumParam accountHolderType, + ApiRequestParams.EnumParam accountHolderType, AccountType accountType, Object addressCity, Object addressCountry, @@ -135,7 +134,7 @@ public static Builder builder() { public static class Builder { private Object accountHolderName; - private EnumParam accountHolderType; + private ApiRequestParams.EnumParam accountHolderType; private AccountType accountType; @@ -202,7 +201,8 @@ public Builder setAccountHolderName(EmptyParam accountHolderName) { * The type of entity that holds the account. This can be either {@code individual} or {@code * company}. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + ExternalAccountUpdateParams.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -220,7 +220,7 @@ public Builder setAccountHolderType(EmptyParam accountHolderType) { * The bank account type. This can only be {@code checking} or {@code savings} in most * countries. In Japan, this can only be {@code futsu} or {@code toza}. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType(ExternalAccountUpdateParams.AccountType accountType) { this.accountType = accountType; return this; } diff --git a/src/main/java/com/stripe/param/FileLinkListParams.java b/src/main/java/com/stripe/param/FileLinkListParams.java index 870d96f9efa..955e5bb6523 100644 --- a/src/main/java/com/stripe/param/FileLinkListParams.java +++ b/src/main/java/com/stripe/param/FileLinkListParams.java @@ -113,7 +113,7 @@ public FileLinkListParams build() { this.startingAfter); } - public Builder setCreated(Created created) { + public Builder setCreated(FileLinkListParams.Created created) { this.created = created; return this; } @@ -270,8 +270,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public FileLinkListParams.Created build() { + return new FileLinkListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/FileLinkUpdateParams.java b/src/main/java/com/stripe/param/FileLinkUpdateParams.java index e9d7bdb9b2f..56374326637 100644 --- a/src/main/java/com/stripe/param/FileLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/FileLinkUpdateParams.java @@ -97,7 +97,7 @@ public Builder addAllExpand(List elements) { * A future timestamp after which the link will no longer be usable, or {@code now} to expire * the link immediately. */ - public Builder setExpiresAt(ExpiresAt expiresAt) { + public Builder setExpiresAt(FileLinkUpdateParams.ExpiresAt expiresAt) { this.expiresAt = expiresAt; return this; } diff --git a/src/main/java/com/stripe/param/InvoiceCreateParams.java b/src/main/java/com/stripe/param/InvoiceCreateParams.java index 9d3f2ff4427..3fe4f3791f3 100644 --- a/src/main/java/com/stripe/param/InvoiceCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -415,7 +414,7 @@ public Builder setAutoAdvance(Boolean autoAdvance) { } /** Settings for automatic tax lookup for this invoice. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(InvoiceCreateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -426,7 +425,7 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * When sending an invoice, Stripe will email this invoice to the customer with payment * instructions. Defaults to {@code charge_automatically}. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(InvoiceCreateParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -446,7 +445,7 @@ public Builder setCurrency(String currency) { * InvoiceCreateParams#customFields} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addCustomField(CustomField element) { + public Builder addCustomField(InvoiceCreateParams.CustomField element) { if (this.customFields == null || this.customFields instanceof EmptyParam) { this.customFields = new ArrayList(); } @@ -460,7 +459,7 @@ public Builder addCustomField(CustomField element) { * InvoiceCreateParams#customFields} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllCustomField(List elements) { + public Builder addAllCustomField(List elements) { if (this.customFields == null || this.customFields instanceof EmptyParam) { this.customFields = new ArrayList(); } @@ -475,7 +474,7 @@ public Builder setCustomFields(EmptyParam customFields) { } /** A list of up to 4 custom fields to be displayed on the invoice. */ - public Builder setCustomFields(List customFields) { + public Builder setCustomFields(List customFields) { this.customFields = customFields; return this; } @@ -556,7 +555,7 @@ public Builder setDescription(String description) { * InvoiceCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(InvoiceCreateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -570,7 +569,7 @@ public Builder addDiscount(Discount element) { * InvoiceCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -591,7 +590,7 @@ public Builder setDiscounts(EmptyParam discounts) { * The coupons to redeem into discounts for the invoice. If not specified, inherits the discount * from the invoice's customer. Pass an empty string to avoid inheriting any discounts. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -668,7 +667,7 @@ public Builder setFooter(String footer) { * revision documentation for * more details. */ - public Builder setFromInvoice(FromInvoice fromInvoice) { + public Builder setFromInvoice(InvoiceCreateParams.FromInvoice fromInvoice) { this.fromInvoice = fromInvoice; return this; } @@ -737,7 +736,7 @@ public Builder setOnBehalfOf(String onBehalfOf) { /** * Configuration settings for the PaymentIntent that is generated when the invoice is finalized. */ - public Builder setPaymentSettings(PaymentSettings paymentSettings) { + public Builder setPaymentSettings(InvoiceCreateParams.PaymentSettings paymentSettings) { this.paymentSettings = paymentSettings; return this; } @@ -750,13 +749,13 @@ public Builder setPaymentSettings(PaymentSettings paymentSettings) { * exclude} if the parameter is omitted. */ public Builder setPendingInvoiceItemsBehavior( - PendingInvoiceItemsBehavior pendingInvoiceItemsBehavior) { + InvoiceCreateParams.PendingInvoiceItemsBehavior pendingInvoiceItemsBehavior) { this.pendingInvoiceItemsBehavior = pendingInvoiceItemsBehavior; return this; } /** Options for invoice PDF rendering. */ - public Builder setRenderingOptions(RenderingOptions renderingOptions) { + public Builder setRenderingOptions(InvoiceCreateParams.RenderingOptions renderingOptions) { this.renderingOptions = renderingOptions; return this; } @@ -793,7 +792,7 @@ public Builder setSubscription(String subscription) { * If specified, the funds from the invoice will be transferred to the destination and the ID of * the resulting transfer will be found on the invoice's charge. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(InvoiceCreateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -834,8 +833,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public InvoiceCreateParams.AutomaticTax build() { + return new InvoiceCreateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -914,8 +913,8 @@ public static class Builder { private String value; /** Finalize and obtain parameter instance from this builder. */ - public CustomField build() { - return new CustomField(this.extraParams, this.name, this.value); + public InvoiceCreateParams.CustomField build() { + return new InvoiceCreateParams.CustomField(this.extraParams, this.name, this.value); } /** @@ -995,8 +994,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public InvoiceCreateParams.Discount build() { + return new InvoiceCreateParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1079,15 +1078,15 @@ public static class Builder { private String invoice; /** Finalize and obtain parameter instance from this builder. */ - public FromInvoice build() { - return new FromInvoice(this.action, this.extraParams, this.invoice); + public InvoiceCreateParams.FromInvoice build() { + return new InvoiceCreateParams.FromInvoice(this.action, this.extraParams, this.invoice); } /** * The relation between the new invoice and the original invoice. Currently, only 'revision' * is permitted */ - public Builder setAction(Action action) { + public Builder setAction(InvoiceCreateParams.FromInvoice.Action action) { this.action = action; return this; } @@ -1195,8 +1194,8 @@ public static class Builder { private Object paymentMethodTypes; /** Finalize and obtain parameter instance from this builder. */ - public PaymentSettings build() { - return new PaymentSettings( + public InvoiceCreateParams.PaymentSettings build() { + return new InvoiceCreateParams.PaymentSettings( this.defaultMandate, this.extraParams, this.paymentMethodOptions, @@ -1240,7 +1239,8 @@ public Builder putAllExtraParam(Map map) { } /** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -1251,7 +1251,8 @@ public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions * {@link InvoiceCreateParams.PaymentSettings#paymentMethodTypes} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addPaymentMethodType(PaymentMethodType element) { + public Builder addPaymentMethodType( + InvoiceCreateParams.PaymentSettings.PaymentMethodType element) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -1267,7 +1268,8 @@ public Builder addPaymentMethodType(PaymentMethodType element) { * {@link InvoiceCreateParams.PaymentSettings#paymentMethodTypes} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllPaymentMethodType(List elements) { + public Builder addAllPaymentMethodType( + List elements) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -1296,7 +1298,8 @@ public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) { * default payment method, and your invoice template settings. */ - public Builder setPaymentMethodTypes(List paymentMethodTypes) { + public Builder setPaymentMethodTypes( + List paymentMethodTypes) { this.paymentMethodTypes = paymentMethodTypes; return this; } @@ -1392,8 +1395,8 @@ public static class Builder { private Object usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions( this.acssDebit, this.bancontact, this.card, @@ -1407,7 +1410,8 @@ public PaymentMethodOptions build() { * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -1425,7 +1429,8 @@ public Builder setAcssDebit(EmptyParam acssDebit) { * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact * payment method options to pass to the invoice’s PaymentIntent. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -1443,7 +1448,7 @@ public Builder setBancontact(EmptyParam bancontact) { * If paying by {@code card}, this sub-hash contains details about the Card payment method * options to pass to the invoice’s PaymentIntent. */ - public Builder setCard(Card card) { + public Builder setCard(InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -1461,7 +1466,9 @@ public Builder setCard(EmptyParam card) { * If paying by {@code customer_balance}, this sub-hash contains details about the Bank * transfer payment method options to pass to the invoice’s PaymentIntent. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + customerBalance) { this.customerBalance = customerBalance; return this; } @@ -1507,7 +1514,8 @@ public Builder putAllExtraParam(Map map) { * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment * method options to pass to the invoice’s PaymentIntent. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini konbini) { this.konbini = konbini; return this; } @@ -1525,7 +1533,8 @@ public Builder setKonbini(EmptyParam konbini) { * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct * debit payment method options to pass to the invoice’s PaymentIntent. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -1581,8 +1590,9 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit(this.extraParams, this.mandateOptions, this.verificationMethod); + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit( + this.extraParams, this.mandateOptions, this.verificationMethod); } /** @@ -1616,13 +1626,17 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -1659,8 +1673,10 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams, this.transactionType); + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions + build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions(this.extraParams, this.transactionType); } /** @@ -1694,7 +1710,10 @@ public Builder putAllExtraParam(Map map) { } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions + .TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -1769,8 +1788,9 @@ public static class Builder { private PreferredLanguage preferredLanguage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams, this.preferredLanguage); + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact( + this.extraParams, this.preferredLanguage); } /** @@ -1807,7 +1827,9 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Bancontact authorization page that the customer is redirected * to. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -1890,8 +1912,9 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card(this.extraParams, this.installments, this.requestThreeDSecure); + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card( + this.extraParams, this.installments, this.requestThreeDSecure); } /** @@ -1931,7 +1954,9 @@ public Builder putAllExtraParam(Map map) { * href="https://stripe.com/docs/payments/installments">installments integration * guide. */ - public Builder setInstallments(Installments installments) { + public Builder setInstallments( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments + installments) { this.installments = installments; return this; } @@ -1946,7 +1971,9 @@ public Builder setInstallments(Installments installments) { * 3D Secure for more information on how this configuration interacts with Radar and * our SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -1993,8 +2020,10 @@ public static class Builder { private Object plan; /** Finalize and obtain parameter instance from this builder. */ - public Installments build() { - return new Installments(this.enabled, this.extraParams, this.plan); + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments + build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments( + this.enabled, this.extraParams, this.plan); } /** @@ -2037,7 +2066,9 @@ public Builder putAllExtraParam(Map map) { } /** The selected installment plan to use for this invoice. */ - public Builder setPlan(Plan plan) { + public Builder setPlan( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan + plan) { this.plan = plan; return this; } @@ -2101,8 +2132,10 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Plan build() { - return new Plan(this.count, this.extraParams, this.interval, this.type); + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan + build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card + .Installments.Plan(this.count, this.extraParams, this.interval, this.type); } /** @@ -2148,13 +2181,19 @@ public Builder putAllExtraParam(Map map) { * For {@code fixed_count} installment plans, this is the interval between installment * payments your customer will make to their credit card. One of {@code month}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan + .Interval + interval) { this.interval = interval; return this; } /** Type of installment plan, one of {@code fixed_count}. */ - public Builder setType(Type type) { + public Builder setType( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan + .Type + type) { this.type = type; return this; } @@ -2247,15 +2286,18 @@ public static class Builder { private String fundingType; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.bankTransfer, this.extraParams, this.fundingType); + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance( + this.bankTransfer, this.extraParams, this.fundingType); } /** * Configuration for the bank transfer funding type, if the {@code funding_type} is set to * {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer + bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -2343,12 +2385,18 @@ public static class Builder { private String type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer(this.euBankTransfer, this.extraParams, this.type); + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer + build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer(this.euBankTransfer, this.extraParams, this.type); } /** Configuration for eu_bank_transfer funding type. */ - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -2428,8 +2476,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer(this.country, this.extraParams); } /** @@ -2499,8 +2550,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini( + this.extraParams); } /** @@ -2576,8 +2628,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.verificationMethod); } @@ -2612,13 +2664,19 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -2642,10 +2700,17 @@ public static class FinancialConnections { * balances}, {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; private FinancialConnections( - Map extraParams, List permissions) { + Map extraParams, + List< + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions) { this.extraParams = extraParams; this.permissions = permissions; } @@ -2657,11 +2722,17 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions); + public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + build() { + return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions); } /** @@ -2701,7 +2772,10 @@ public Builder putAllExtraParam(Map map) { * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -2716,7 +2790,11 @@ public Builder addPermission(Permission element) { * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -2852,7 +2930,7 @@ public static class RenderingOptions { * will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. */ @SerializedName("amount_tax_display") - EnumParam amountTaxDisplay; + ApiRequestParams.EnumParam amountTaxDisplay; /** * Map of extra parameters for custom features not available in this client library. The content @@ -2863,7 +2941,8 @@ public static class RenderingOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private RenderingOptions(EnumParam amountTaxDisplay, Map extraParams) { + private RenderingOptions( + ApiRequestParams.EnumParam amountTaxDisplay, Map extraParams) { this.amountTaxDisplay = amountTaxDisplay; this.extraParams = extraParams; } @@ -2873,13 +2952,13 @@ public static Builder builder() { } public static class Builder { - private EnumParam amountTaxDisplay; + private ApiRequestParams.EnumParam amountTaxDisplay; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public RenderingOptions build() { - return new RenderingOptions(this.amountTaxDisplay, this.extraParams); + public InvoiceCreateParams.RenderingOptions build() { + return new InvoiceCreateParams.RenderingOptions(this.amountTaxDisplay, this.extraParams); } /** @@ -2888,7 +2967,8 @@ public RenderingOptions build() { * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. */ - public Builder setAmountTaxDisplay(AmountTaxDisplay amountTaxDisplay) { + public Builder setAmountTaxDisplay( + InvoiceCreateParams.RenderingOptions.AmountTaxDisplay amountTaxDisplay) { this.amountTaxDisplay = amountTaxDisplay; return this; } @@ -2987,8 +3067,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.destination, this.extraParams); + public InvoiceCreateParams.TransferData build() { + return new InvoiceCreateParams.TransferData( + this.amount, this.destination, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/InvoiceItemCreateParams.java b/src/main/java/com/stripe/param/InvoiceItemCreateParams.java index 9179338dfad..5d89c908231 100644 --- a/src/main/java/com/stripe/param/InvoiceItemCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceItemCreateParams.java @@ -289,7 +289,7 @@ public Builder setDiscountable(Boolean discountable) { * InvoiceItemCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(InvoiceItemCreateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -303,7 +303,7 @@ public Builder addDiscount(Discount element) { * InvoiceItemCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -318,7 +318,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The coupons to redeem into discounts for the invoice item or invoice line item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -440,7 +440,7 @@ public Builder setMetadata(Map metadata) { * The period associated with this invoice item. When set to different values, the period will * be rendered on the invoice. */ - public Builder setPeriod(Period period) { + public Builder setPeriod(InvoiceItemCreateParams.Period period) { this.period = period; return this; } @@ -455,7 +455,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(InvoiceItemCreateParams.PriceData priceData) { this.priceData = priceData; return this; } @@ -563,8 +563,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public InvoiceItemCreateParams.Discount build() { + return new InvoiceItemCreateParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -644,8 +644,8 @@ public static class Builder { private Long start; /** Finalize and obtain parameter instance from this builder. */ - public Period build() { - return new Period(this.end, this.extraParams, this.start); + public InvoiceItemCreateParams.Period build() { + return new InvoiceItemCreateParams.Period(this.end, this.extraParams, this.start); } /** The end of the period, which must be greater than or equal to the start. */ @@ -767,8 +767,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public InvoiceItemCreateParams.PriceData build() { + return new InvoiceItemCreateParams.PriceData( this.currency, this.extraParams, this.product, @@ -824,7 +824,7 @@ public Builder setProduct(String product) { * {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior(InvoiceItemCreateParams.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } diff --git a/src/main/java/com/stripe/param/InvoiceItemListParams.java b/src/main/java/com/stripe/param/InvoiceItemListParams.java index 0382179ae32..7164aeea072 100644 --- a/src/main/java/com/stripe/param/InvoiceItemListParams.java +++ b/src/main/java/com/stripe/param/InvoiceItemListParams.java @@ -132,7 +132,7 @@ public InvoiceItemListParams build() { this.startingAfter); } - public Builder setCreated(Created created) { + public Builder setCreated(InvoiceItemListParams.Created created) { this.created = created; return this; } @@ -305,8 +305,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public InvoiceItemListParams.Created build() { + return new InvoiceItemListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java b/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java index 9d2f1870858..9de77f52726 100644 --- a/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java @@ -237,7 +237,7 @@ public Builder setDiscountable(Boolean discountable) { * InvoiceItemUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(InvoiceItemUpdateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -251,7 +251,7 @@ public Builder addDiscount(Discount element) { * InvoiceItemUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -274,7 +274,7 @@ public Builder setDiscounts(EmptyParam discounts) { * Item discounts are applied before invoice discounts. Pass an empty string to remove * previously-defined discounts. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -385,7 +385,7 @@ public Builder setMetadata(Map metadata) { * The period associated with this invoice item. When set to different values, the period will * be rendered on the invoice. */ - public Builder setPeriod(Period period) { + public Builder setPeriod(InvoiceItemUpdateParams.Period period) { this.period = period; return this; } @@ -406,7 +406,7 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(InvoiceItemUpdateParams.PriceData priceData) { this.priceData = priceData; return this; } @@ -533,8 +533,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public InvoiceItemUpdateParams.Discount build() { + return new InvoiceItemUpdateParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -626,8 +626,8 @@ public static class Builder { private Long start; /** Finalize and obtain parameter instance from this builder. */ - public Period build() { - return new Period(this.end, this.extraParams, this.start); + public InvoiceItemUpdateParams.Period build() { + return new InvoiceItemUpdateParams.Period(this.end, this.extraParams, this.start); } /** The end of the period, which must be greater than or equal to the start. */ @@ -749,8 +749,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public InvoiceItemUpdateParams.PriceData build() { + return new InvoiceItemUpdateParams.PriceData( this.currency, this.extraParams, this.product, @@ -822,7 +822,7 @@ public Builder setProduct(EmptyParam product) { * {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior(InvoiceItemUpdateParams.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } diff --git a/src/main/java/com/stripe/param/InvoiceListParams.java b/src/main/java/com/stripe/param/InvoiceListParams.java index 42b808d2e69..a449c79266d 100644 --- a/src/main/java/com/stripe/param/InvoiceListParams.java +++ b/src/main/java/com/stripe/param/InvoiceListParams.java @@ -150,12 +150,12 @@ public InvoiceListParams build() { * The collection method of the invoice to retrieve. Either {@code charge_automatically} or * {@code send_invoice}. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(InvoiceListParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } - public Builder setCreated(Created created) { + public Builder setCreated(InvoiceListParams.Created created) { this.created = created; return this; } @@ -171,7 +171,7 @@ public Builder setCustomer(String customer) { return this; } - public Builder setDueDate(DueDate dueDate) { + public Builder setDueDate(InvoiceListParams.DueDate dueDate) { this.dueDate = dueDate; return this; } @@ -269,7 +269,7 @@ public Builder setStartingAfter(String startingAfter) { * uncollectible}, or {@code void}. Learn more */ - public Builder setStatus(Status status) { + public Builder setStatus(InvoiceListParams.Status status) { this.status = status; return this; } @@ -332,8 +332,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public InvoiceListParams.Created build() { + return new InvoiceListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -439,8 +440,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public DueDate build() { - return new DueDate(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public InvoiceListParams.DueDate build() { + return new InvoiceListParams.DueDate( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java b/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java new file mode 100644 index 00000000000..3a4d547e318 --- /dev/null +++ b/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java @@ -0,0 +1,3439 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +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; +import java.util.Map; +import lombok.Getter; + +@Getter +public class InvoiceUpcomingLinesParams extends ApiRequestParams { + /** Settings for automatic tax lookup for this invoice preview. */ + @SerializedName("automatic_tax") + AutomaticTax automaticTax; + + /** + * The code of the coupon to apply. If {@code subscription} or {@code subscription_items} is + * provided, the invoice returned will preview updating or creating a subscription with that + * coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming + * invoice from among the customer's subscriptions. The invoice can be previewed without a coupon + * by passing this value as an empty string. + */ + @SerializedName("coupon") + String coupon; + + /** + * The currency to preview this invoice in. Defaults to that of {@code customer} if not specified. + */ + @SerializedName("currency") + String currency; + + /** The identifier of the customer whose upcoming invoice you'd like to retrieve. */ + @SerializedName("customer") + String customer; + + /** Details about the customer you want to invoice or overrides for an existing customer. */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** + * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the + * discount from the customer or subscription. This only works for coupons directly applied to the + * invoice. To apply a coupon to a subscription, you must use the {@code coupon} parameter + * instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming + * invoice for a subscription that hasn't been created, use {@code coupon} instead. + */ + @SerializedName("discounts") + Object discounts; + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + @SerializedName("ending_before") + String endingBefore; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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; + + /** List of invoice items to add or update in the upcoming invoice preview. */ + @SerializedName("invoice_items") + List invoiceItems; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + @SerializedName("limit") + Long limit; + + /** + * The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot + * be used with subscription or subscription fields. + */ + @SerializedName("schedule") + String schedule; + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, ending with + * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to + * fetch the next page of the list. + */ + @SerializedName("starting_after") + String startingAfter; + + /** + * The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If + * not provided, but a {@code subscription_items} is provided, you will preview creating a + * subscription with those items. If neither {@code subscription} nor {@code subscription_items} + * is provided, you will retrieve the next upcoming invoice from among the customer's + * subscriptions. + */ + @SerializedName("subscription") + String subscription; + + /** + * For new subscriptions, a future timestamp to anchor the subscription's billing cycle. This is used to + * determine the date of the first full invoice, and, for plans with {@code month} or {@code year} + * intervals, the day of the month for subsequent invoices. For existing subscriptions, the value + * can only be set to {@code now} or {@code unchanged}. + */ + @SerializedName("subscription_billing_cycle_anchor") + Object subscriptionBillingCycleAnchor; + + /** + * Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if + * within the current period and prorations have been enabled using {@code proration_behavior}. + */ + @SerializedName("subscription_cancel_at") + Object subscriptionCancelAt; + + /** + * Boolean indicating whether this subscription should cancel at the end of the current period. + */ + @SerializedName("subscription_cancel_at_period_end") + Boolean subscriptionCancelAtPeriodEnd; + + /** This simulates the subscription being canceled or expired immediately. */ + @SerializedName("subscription_cancel_now") + Boolean subscriptionCancelNow; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with these + * default tax rates. The default tax rates will apply to any line item that does not have {@code + * tax_rates} set. + */ + @SerializedName("subscription_default_tax_rates") + Object subscriptionDefaultTaxRates; + + /** A list of up to 20 subscription items, each with an attached price. */ + @SerializedName("subscription_items") + List subscriptionItems; + + /** + * Determines how to handle prorations when the + * billing cycle changes (e.g., when switching plans, resetting {@code billing_cycle_anchor=now}, + * or starting a trial), or if an item's {@code quantity} changes. + */ + @SerializedName("subscription_proration_behavior") + SubscriptionProrationBehavior subscriptionProrationBehavior; + + /** + * If previewing an update to a subscription, and doing proration, {@code + * subscription_proration_date} forces the proration to be calculated as though the update was + * done at the specified time. The time given must be within the current subscription period, and + * cannot be before the subscription was on its current plan. If set, {@code subscription}, and + * one of {@code subscription_items}, or {@code subscription_trial_end} are required. Also, {@code + * subscription_proration_behavior} cannot be set to 'none'. + */ + @SerializedName("subscription_proration_date") + Long subscriptionProrationDate; + + /** Date a subscription is intended to start (can be future or past). */ + @SerializedName("subscription_start_date") + Long subscriptionStartDate; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with that + * trial end. If set, one of {@code subscription_items} or {@code subscription} is required. + */ + @SerializedName("subscription_trial_end") + Object subscriptionTrialEnd; + + /** + * Indicates if a plan's {@code trial_period_days} should be applied to the subscription. Setting + * {@code subscription_trial_end} per subscription is preferred, and this defaults to {@code + * false}. Setting this flag to {@code true} together with {@code subscription_trial_end} is not + * allowed. See Using trial periods + * on subscriptions to learn more. + */ + @SerializedName("subscription_trial_from_plan") + Boolean subscriptionTrialFromPlan; + + private InvoiceUpcomingLinesParams( + AutomaticTax automaticTax, + String coupon, + String currency, + String customer, + CustomerDetails customerDetails, + Object discounts, + String endingBefore, + List expand, + Map extraParams, + List invoiceItems, + Long limit, + String schedule, + String startingAfter, + String subscription, + Object subscriptionBillingCycleAnchor, + Object subscriptionCancelAt, + Boolean subscriptionCancelAtPeriodEnd, + Boolean subscriptionCancelNow, + Object subscriptionDefaultTaxRates, + List subscriptionItems, + SubscriptionProrationBehavior subscriptionProrationBehavior, + Long subscriptionProrationDate, + Long subscriptionStartDate, + Object subscriptionTrialEnd, + Boolean subscriptionTrialFromPlan) { + this.automaticTax = automaticTax; + this.coupon = coupon; + this.currency = currency; + this.customer = customer; + this.customerDetails = customerDetails; + this.discounts = discounts; + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.invoiceItems = invoiceItems; + this.limit = limit; + this.schedule = schedule; + this.startingAfter = startingAfter; + this.subscription = subscription; + this.subscriptionBillingCycleAnchor = subscriptionBillingCycleAnchor; + this.subscriptionCancelAt = subscriptionCancelAt; + this.subscriptionCancelAtPeriodEnd = subscriptionCancelAtPeriodEnd; + this.subscriptionCancelNow = subscriptionCancelNow; + this.subscriptionDefaultTaxRates = subscriptionDefaultTaxRates; + this.subscriptionItems = subscriptionItems; + this.subscriptionProrationBehavior = subscriptionProrationBehavior; + this.subscriptionProrationDate = subscriptionProrationDate; + this.subscriptionStartDate = subscriptionStartDate; + this.subscriptionTrialEnd = subscriptionTrialEnd; + this.subscriptionTrialFromPlan = subscriptionTrialFromPlan; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private AutomaticTax automaticTax; + + private String coupon; + + private String currency; + + private String customer; + + private CustomerDetails customerDetails; + + private Object discounts; + + private String endingBefore; + + private List expand; + + private Map extraParams; + + private List invoiceItems; + + private Long limit; + + private String schedule; + + private String startingAfter; + + private String subscription; + + private Object subscriptionBillingCycleAnchor; + + private Object subscriptionCancelAt; + + private Boolean subscriptionCancelAtPeriodEnd; + + private Boolean subscriptionCancelNow; + + private Object subscriptionDefaultTaxRates; + + private List subscriptionItems; + + private SubscriptionProrationBehavior subscriptionProrationBehavior; + + private Long subscriptionProrationDate; + + private Long subscriptionStartDate; + + private Object subscriptionTrialEnd; + + private Boolean subscriptionTrialFromPlan; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams build() { + return new InvoiceUpcomingLinesParams( + this.automaticTax, + this.coupon, + this.currency, + this.customer, + this.customerDetails, + this.discounts, + this.endingBefore, + this.expand, + this.extraParams, + this.invoiceItems, + this.limit, + this.schedule, + this.startingAfter, + this.subscription, + this.subscriptionBillingCycleAnchor, + this.subscriptionCancelAt, + this.subscriptionCancelAtPeriodEnd, + this.subscriptionCancelNow, + this.subscriptionDefaultTaxRates, + this.subscriptionItems, + this.subscriptionProrationBehavior, + this.subscriptionProrationDate, + this.subscriptionStartDate, + this.subscriptionTrialEnd, + this.subscriptionTrialFromPlan); + } + + /** Settings for automatic tax lookup for this invoice preview. */ + public Builder setAutomaticTax(InvoiceUpcomingLinesParams.AutomaticTax automaticTax) { + this.automaticTax = automaticTax; + return this; + } + + /** + * The code of the coupon to apply. If {@code subscription} or {@code subscription_items} is + * provided, the invoice returned will preview updating or creating a subscription with that + * coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming + * invoice from among the customer's subscriptions. The invoice can be previewed without a + * coupon by passing this value as an empty string. + */ + public Builder setCoupon(String coupon) { + this.coupon = coupon; + return this; + } + + /** + * The currency to preview this invoice in. Defaults to that of {@code customer} if not + * specified. + */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** The identifier of the customer whose upcoming invoice you'd like to retrieve. */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + /** Details about the customer you want to invoice or overrides for an existing customer. */ + public Builder setCustomerDetails(InvoiceUpcomingLinesParams.CustomerDetails customerDetails) { + this.customerDetails = customerDetails; + return this; + } + + /** + * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams#discounts} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addDiscount(InvoiceUpcomingLinesParams.Discount element) { + if (this.discounts == null || this.discounts instanceof EmptyParam) { + this.discounts = new ArrayList(); + } + ((List) this.discounts).add(element); + return this; + } + + /** + * Add all elements to `discounts` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams#discounts} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllDiscount(List elements) { + if (this.discounts == null || this.discounts instanceof EmptyParam) { + this.discounts = new ArrayList(); + } + ((List) this.discounts).addAll(elements); + return this; + } + + /** + * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the + * discount from the customer or subscription. This only works for coupons directly applied to + * the invoice. To apply a coupon to a subscription, you must use the {@code coupon} parameter + * instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming + * invoice for a subscription that hasn't been created, use {@code coupon} instead. + */ + public Builder setDiscounts(EmptyParam discounts) { + this.discounts = discounts; + return this; + } + + /** + * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the + * discount from the customer or subscription. This only works for coupons directly applied to + * the invoice. To apply a coupon to a subscription, you must use the {@code coupon} parameter + * instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming + * invoice for a subscription that hasn't been created, use {@code coupon} instead. + */ + public Builder setDiscounts(List discounts) { + this.discounts = discounts; + return this; + } + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + public Builder setEndingBefore(String endingBefore) { + this.endingBefore = endingBefore; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * InvoiceUpcomingLinesParams#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 InvoiceUpcomingLinesParams#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 `invoiceItems` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams#invoiceItems} for the field documentation. + */ + public Builder addInvoiceItem(InvoiceUpcomingLinesParams.InvoiceItem element) { + if (this.invoiceItems == null) { + this.invoiceItems = new ArrayList<>(); + } + this.invoiceItems.add(element); + return this; + } + + /** + * Add all elements to `invoiceItems` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams#invoiceItems} for the field documentation. + */ + public Builder addAllInvoiceItem(List elements) { + if (this.invoiceItems == null) { + this.invoiceItems = new ArrayList<>(); + } + this.invoiceItems.addAll(elements); + return this; + } + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. + * Cannot be used with subscription or subscription fields. + */ + public Builder setSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your + * place in the list. For instance, if you make a list request and receive 100 objects, ending + * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in + * order to fetch the next page of the list. + */ + public Builder setStartingAfter(String startingAfter) { + this.startingAfter = startingAfter; + return this; + } + + /** + * The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If + * not provided, but a {@code subscription_items} is provided, you will preview creating a + * subscription with those items. If neither {@code subscription} nor {@code subscription_items} + * is provided, you will retrieve the next upcoming invoice from among the customer's + * subscriptions. + */ + public Builder setSubscription(String subscription) { + this.subscription = subscription; + return this; + } + + /** + * For new subscriptions, a future timestamp to anchor the subscription's billing cycle. This is used to + * determine the date of the first full invoice, and, for plans with {@code month} or {@code + * year} intervals, the day of the month for subsequent invoices. For existing subscriptions, + * the value can only be set to {@code now} or {@code unchanged}. + */ + public Builder setSubscriptionBillingCycleAnchor( + InvoiceUpcomingLinesParams.SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor) { + this.subscriptionBillingCycleAnchor = subscriptionBillingCycleAnchor; + return this; + } + + /** + * For new subscriptions, a future timestamp to anchor the subscription's billing cycle. This is used to + * determine the date of the first full invoice, and, for plans with {@code month} or {@code + * year} intervals, the day of the month for subsequent invoices. For existing subscriptions, + * the value can only be set to {@code now} or {@code unchanged}. + */ + public Builder setSubscriptionBillingCycleAnchor(Long subscriptionBillingCycleAnchor) { + this.subscriptionBillingCycleAnchor = subscriptionBillingCycleAnchor; + return this; + } + + /** + * Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if + * within the current period and prorations have been enabled using {@code proration_behavior}. + */ + public Builder setSubscriptionCancelAt(Long subscriptionCancelAt) { + this.subscriptionCancelAt = subscriptionCancelAt; + return this; + } + + /** + * Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if + * within the current period and prorations have been enabled using {@code proration_behavior}. + */ + public Builder setSubscriptionCancelAt(EmptyParam subscriptionCancelAt) { + this.subscriptionCancelAt = subscriptionCancelAt; + return this; + } + + /** + * Boolean indicating whether this subscription should cancel at the end of the current period. + */ + public Builder setSubscriptionCancelAtPeriodEnd(Boolean subscriptionCancelAtPeriodEnd) { + this.subscriptionCancelAtPeriodEnd = subscriptionCancelAtPeriodEnd; + return this; + } + + /** This simulates the subscription being canceled or expired immediately. */ + public Builder setSubscriptionCancelNow(Boolean subscriptionCancelNow) { + this.subscriptionCancelNow = subscriptionCancelNow; + return this; + } + + /** + * Add an element to `subscriptionDefaultTaxRates` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link InvoiceUpcomingLinesParams#subscriptionDefaultTaxRates} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addSubscriptionDefaultTaxRate(String element) { + if (this.subscriptionDefaultTaxRates == null + || this.subscriptionDefaultTaxRates instanceof EmptyParam) { + this.subscriptionDefaultTaxRates = new ArrayList(); + } + ((List) this.subscriptionDefaultTaxRates).add(element); + return this; + } + + /** + * Add all elements to `subscriptionDefaultTaxRates` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link InvoiceUpcomingLinesParams#subscriptionDefaultTaxRates} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllSubscriptionDefaultTaxRate(List elements) { + if (this.subscriptionDefaultTaxRates == null + || this.subscriptionDefaultTaxRates instanceof EmptyParam) { + this.subscriptionDefaultTaxRates = new ArrayList(); + } + ((List) this.subscriptionDefaultTaxRates).addAll(elements); + return this; + } + + /** + * If provided, the invoice returned will preview updating or creating a subscription with these + * default tax rates. The default tax rates will apply to any line item that does not have + * {@code tax_rates} set. + */ + public Builder setSubscriptionDefaultTaxRates(EmptyParam subscriptionDefaultTaxRates) { + this.subscriptionDefaultTaxRates = subscriptionDefaultTaxRates; + return this; + } + + /** + * If provided, the invoice returned will preview updating or creating a subscription with these + * default tax rates. The default tax rates will apply to any line item that does not have + * {@code tax_rates} set. + */ + public Builder setSubscriptionDefaultTaxRates(List subscriptionDefaultTaxRates) { + this.subscriptionDefaultTaxRates = subscriptionDefaultTaxRates; + return this; + } + + /** + * Add an element to `subscriptionItems` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams#subscriptionItems} for the field documentation. + */ + public Builder addSubscriptionItem(InvoiceUpcomingLinesParams.SubscriptionItem element) { + if (this.subscriptionItems == null) { + this.subscriptionItems = new ArrayList<>(); + } + this.subscriptionItems.add(element); + return this; + } + + /** + * Add all elements to `subscriptionItems` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link InvoiceUpcomingLinesParams#subscriptionItems} for the field documentation. + */ + public Builder addAllSubscriptionItem( + List elements) { + if (this.subscriptionItems == null) { + this.subscriptionItems = new ArrayList<>(); + } + this.subscriptionItems.addAll(elements); + return this; + } + + /** + * Determines how to handle prorations when the + * billing cycle changes (e.g., when switching plans, resetting {@code + * billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes. + */ + public Builder setSubscriptionProrationBehavior( + InvoiceUpcomingLinesParams.SubscriptionProrationBehavior subscriptionProrationBehavior) { + this.subscriptionProrationBehavior = subscriptionProrationBehavior; + return this; + } + + /** + * If previewing an update to a subscription, and doing proration, {@code + * subscription_proration_date} forces the proration to be calculated as though the update was + * done at the specified time. The time given must be within the current subscription period, + * and cannot be before the subscription was on its current plan. If set, {@code subscription}, + * and one of {@code subscription_items}, or {@code subscription_trial_end} are required. Also, + * {@code subscription_proration_behavior} cannot be set to 'none'. + */ + public Builder setSubscriptionProrationDate(Long subscriptionProrationDate) { + this.subscriptionProrationDate = subscriptionProrationDate; + return this; + } + + /** Date a subscription is intended to start (can be future or past). */ + public Builder setSubscriptionStartDate(Long subscriptionStartDate) { + this.subscriptionStartDate = subscriptionStartDate; + return this; + } + + /** + * If provided, the invoice returned will preview updating or creating a subscription with that + * trial end. If set, one of {@code subscription_items} or {@code subscription} is required. + */ + public Builder setSubscriptionTrialEnd( + InvoiceUpcomingLinesParams.SubscriptionTrialEnd subscriptionTrialEnd) { + this.subscriptionTrialEnd = subscriptionTrialEnd; + return this; + } + + /** + * If provided, the invoice returned will preview updating or creating a subscription with that + * trial end. If set, one of {@code subscription_items} or {@code subscription} is required. + */ + public Builder setSubscriptionTrialEnd(Long subscriptionTrialEnd) { + this.subscriptionTrialEnd = subscriptionTrialEnd; + return this; + } + + /** + * Indicates if a plan's {@code trial_period_days} should be applied to the subscription. + * Setting {@code subscription_trial_end} per subscription is preferred, and this defaults to + * {@code false}. Setting this flag to {@code true} together with {@code subscription_trial_end} + * is not allowed. See Using + * trial periods on subscriptions to learn more. + */ + public Builder setSubscriptionTrialFromPlan(Boolean subscriptionTrialFromPlan) { + this.subscriptionTrialFromPlan = subscriptionTrialFromPlan; + return this; + } + } + + @Getter + public static class AutomaticTax { + /** + * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice + * items (invoice items with manually specified tax rates, negative amounts, or {@code + * tax_behavior=unspecified}) cannot be added to automatic tax invoices. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * 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 AutomaticTax(Boolean enabled, Map extraParams) { + this.enabled = enabled; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.AutomaticTax build() { + return new InvoiceUpcomingLinesParams.AutomaticTax(this.enabled, this.extraParams); + } + + /** + * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice + * items (invoice items with manually specified tax rates, negative amounts, or {@code + * tax_behavior=unspecified}) cannot be added to automatic tax invoices. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + 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 + * InvoiceUpcomingLinesParams.AutomaticTax#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 InvoiceUpcomingLinesParams.AutomaticTax#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 + public static class CustomerDetails { + /** The customer's address. */ + @SerializedName("address") + Object address; + + /** + * 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 customer's shipping information. Appears on invoices emailed to this customer. */ + @SerializedName("shipping") + Object shipping; + + /** Tax details about the customer. */ + @SerializedName("tax") + Tax tax; + + /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */ + @SerializedName("tax_exempt") + ApiRequestParams.EnumParam taxExempt; + + /** The customer's tax IDs. */ + @SerializedName("tax_ids") + List taxIds; + + private CustomerDetails( + Object address, + Map extraParams, + Object shipping, + Tax tax, + ApiRequestParams.EnumParam taxExempt, + List taxIds) { + this.address = address; + this.extraParams = extraParams; + this.shipping = shipping; + this.tax = tax; + this.taxExempt = taxExempt; + this.taxIds = taxIds; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object address; + + private Map extraParams; + + private Object shipping; + + private Tax tax; + + private ApiRequestParams.EnumParam taxExempt; + + private List taxIds; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.CustomerDetails build() { + return new InvoiceUpcomingLinesParams.CustomerDetails( + this.address, this.extraParams, this.shipping, this.tax, this.taxExempt, this.taxIds); + } + + /** The customer's address. */ + public Builder setAddress(InvoiceUpcomingLinesParams.CustomerDetails.Address address) { + this.address = address; + return this; + } + + /** The customer's address. */ + public Builder setAddress(EmptyParam address) { + this.address = address; + 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 + * InvoiceUpcomingLinesParams.CustomerDetails#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 InvoiceUpcomingLinesParams.CustomerDetails#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 customer's shipping information. Appears on invoices emailed to this customer. */ + public Builder setShipping(InvoiceUpcomingLinesParams.CustomerDetails.Shipping shipping) { + this.shipping = shipping; + return this; + } + + /** The customer's shipping information. Appears on invoices emailed to this customer. */ + public Builder setShipping(EmptyParam shipping) { + this.shipping = shipping; + return this; + } + + /** Tax details about the customer. */ + public Builder setTax(InvoiceUpcomingLinesParams.CustomerDetails.Tax tax) { + this.tax = tax; + return this; + } + + /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */ + public Builder setTaxExempt(InvoiceUpcomingLinesParams.CustomerDetails.TaxExempt taxExempt) { + this.taxExempt = taxExempt; + return this; + } + + /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */ + public Builder setTaxExempt(EmptyParam taxExempt) { + this.taxExempt = taxExempt; + return this; + } + + /** + * Add an element to `taxIds` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams.CustomerDetails#taxIds} for the field documentation. + */ + public Builder addTaxId(InvoiceUpcomingLinesParams.CustomerDetails.TaxId element) { + if (this.taxIds == null) { + this.taxIds = new ArrayList<>(); + } + this.taxIds.add(element); + return this; + } + + /** + * Add all elements to `taxIds` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams.CustomerDetails#taxIds} for the field documentation. + */ + public Builder addAllTaxId(List elements) { + if (this.taxIds == null) { + this.taxIds = new ArrayList<>(); + } + this.taxIds.addAll(elements); + return this; + } + } + + @Getter + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * 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; + + /** Address line 1 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.CustomerDetails.Address build() { + return new InvoiceUpcomingLinesParams.CustomerDetails.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + 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 InvoiceUpcomingLinesParams.CustomerDetails.Address#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 InvoiceUpcomingLinesParams.CustomerDetails.Address#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1 (e.g., street, PO Box, or company name). */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** State, county, province, or region. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + + @Getter + public static class Shipping { + /** Customer shipping address. */ + @SerializedName("address") + Address address; + + /** + * 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; + + /** Customer name. */ + @SerializedName("name") + String name; + + /** Customer phone (including extension). */ + @SerializedName("phone") + String phone; + + private Shipping( + Address address, Map extraParams, String name, String phone) { + this.address = address; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.CustomerDetails.Shipping build() { + return new InvoiceUpcomingLinesParams.CustomerDetails.Shipping( + this.address, this.extraParams, this.name, this.phone); + } + + /** Customer shipping address. */ + public Builder setAddress( + InvoiceUpcomingLinesParams.CustomerDetails.Shipping.Address address) { + this.address = address; + 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 InvoiceUpcomingLinesParams.CustomerDetails.Shipping#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 InvoiceUpcomingLinesParams.CustomerDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Customer name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Customer phone (including extension). */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * 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; + + /** Address line 1 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.CustomerDetails.Shipping.Address build() { + return new InvoiceUpcomingLinesParams.CustomerDetails.Shipping.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + 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 + * InvoiceUpcomingLinesParams.CustomerDetails.Shipping.Address#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 + * InvoiceUpcomingLinesParams.CustomerDetails.Shipping.Address#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1 (e.g., street, PO Box, or company name). */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** State, county, province, or region. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + + @Getter + public static class Tax { + /** + * 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 recent IP address of the customer used for tax reporting and tax location inference. + * Stripe recommends updating the IP address when a new PaymentMethod is attached or the + * address field on the customer is updated. We recommend against updating this field more + * frequently since it could result in unexpected tax location/reporting outcomes. + */ + @SerializedName("ip_address") + Object ipAddress; + + private Tax(Map extraParams, Object ipAddress) { + this.extraParams = extraParams; + this.ipAddress = ipAddress; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object ipAddress; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.CustomerDetails.Tax build() { + return new InvoiceUpcomingLinesParams.CustomerDetails.Tax( + this.extraParams, this.ipAddress); + } + + /** + * 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 InvoiceUpcomingLinesParams.CustomerDetails.Tax#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 InvoiceUpcomingLinesParams.CustomerDetails.Tax#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 recent IP address of the customer used for tax reporting and tax location inference. + * Stripe recommends updating the IP address when a new PaymentMethod is attached or the + * address field on the customer is updated. We recommend against updating this field more + * frequently since it could result in unexpected tax location/reporting outcomes. + */ + public Builder setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * A recent IP address of the customer used for tax reporting and tax location inference. + * Stripe recommends updating the IP address when a new PaymentMethod is attached or the + * address field on the customer is updated. We recommend against updating this field more + * frequently since it could result in unexpected tax location/reporting outcomes. + */ + public Builder setIpAddress(EmptyParam ipAddress) { + this.ipAddress = ipAddress; + return this; + } + } + } + + @Getter + public static class TaxId { + /** + * 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; + + /** + * Type of the tax ID, one of {@code ae_trn}, {@code au_abn}, {@code au_arn}, {@code bg_uic}, + * {@code br_cnpj}, {@code br_cpf}, {@code ca_bn}, {@code ca_gst_hst}, {@code ca_pst_bc}, + * {@code ca_pst_mb}, {@code ca_pst_sk}, {@code ca_qst}, {@code ch_vat}, {@code cl_tin}, + * {@code es_cif}, {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code + * hk_br}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, + * {@code jp_cn}, {@code jp_rn}, {@code kr_brn}, {@code li_uid}, {@code mx_rfc}, {@code + * my_frp}, {@code my_itn}, {@code my_sst}, {@code no_vat}, {@code nz_gst}, {@code ru_inn}, + * {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code + * th_vat}, {@code tw_vat}, {@code ua_vat}, {@code us_ein}, or {@code za_vat}. + */ + @SerializedName("type") + Type type; + + /** Value of the tax ID. */ + @SerializedName("value") + String value; + + private TaxId(Map extraParams, Type type, String value) { + this.extraParams = extraParams; + this.type = type; + this.value = value; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + private String value; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.CustomerDetails.TaxId build() { + return new InvoiceUpcomingLinesParams.CustomerDetails.TaxId( + this.extraParams, this.type, this.value); + } + + /** + * 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 InvoiceUpcomingLinesParams.CustomerDetails.TaxId#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 InvoiceUpcomingLinesParams.CustomerDetails.TaxId#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Type of the tax ID, one of {@code ae_trn}, {@code au_abn}, {@code au_arn}, {@code + * bg_uic}, {@code br_cnpj}, {@code br_cpf}, {@code ca_bn}, {@code ca_gst_hst}, {@code + * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code ca_qst}, {@code ch_vat}, {@code + * cl_tin}, {@code es_cif}, {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code + * ge_vat}, {@code hk_br}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, + * {@code is_vat}, {@code jp_cn}, {@code jp_rn}, {@code kr_brn}, {@code li_uid}, {@code + * mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code no_vat}, {@code nz_gst}, + * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code + * si_tin}, {@code th_vat}, {@code tw_vat}, {@code ua_vat}, {@code us_ein}, or {@code + * za_vat}. + */ + public Builder setType(InvoiceUpcomingLinesParams.CustomerDetails.TaxId.Type type) { + this.type = type; + return this; + } + + /** Value of the tax ID. */ + public Builder setValue(String value) { + this.value = value; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("ae_trn") + AE_TRN("ae_trn"), + + @SerializedName("au_abn") + AU_ABN("au_abn"), + + @SerializedName("au_arn") + AU_ARN("au_arn"), + + @SerializedName("bg_uic") + BG_UIC("bg_uic"), + + @SerializedName("br_cnpj") + BR_CNPJ("br_cnpj"), + + @SerializedName("br_cpf") + BR_CPF("br_cpf"), + + @SerializedName("ca_bn") + CA_BN("ca_bn"), + + @SerializedName("ca_gst_hst") + CA_GST_HST("ca_gst_hst"), + + @SerializedName("ca_pst_bc") + CA_PST_BC("ca_pst_bc"), + + @SerializedName("ca_pst_mb") + CA_PST_MB("ca_pst_mb"), + + @SerializedName("ca_pst_sk") + CA_PST_SK("ca_pst_sk"), + + @SerializedName("ca_qst") + CA_QST("ca_qst"), + + @SerializedName("ch_vat") + CH_VAT("ch_vat"), + + @SerializedName("cl_tin") + CL_TIN("cl_tin"), + + @SerializedName("es_cif") + ES_CIF("es_cif"), + + @SerializedName("eu_oss_vat") + EU_OSS_VAT("eu_oss_vat"), + + @SerializedName("eu_vat") + EU_VAT("eu_vat"), + + @SerializedName("gb_vat") + GB_VAT("gb_vat"), + + @SerializedName("ge_vat") + GE_VAT("ge_vat"), + + @SerializedName("hk_br") + HK_BR("hk_br"), + + @SerializedName("hu_tin") + HU_TIN("hu_tin"), + + @SerializedName("id_npwp") + ID_NPWP("id_npwp"), + + @SerializedName("il_vat") + IL_VAT("il_vat"), + + @SerializedName("in_gst") + IN_GST("in_gst"), + + @SerializedName("is_vat") + IS_VAT("is_vat"), + + @SerializedName("jp_cn") + JP_CN("jp_cn"), + + @SerializedName("jp_rn") + JP_RN("jp_rn"), + + @SerializedName("kr_brn") + KR_BRN("kr_brn"), + + @SerializedName("li_uid") + LI_UID("li_uid"), + + @SerializedName("mx_rfc") + MX_RFC("mx_rfc"), + + @SerializedName("my_frp") + MY_FRP("my_frp"), + + @SerializedName("my_itn") + MY_ITN("my_itn"), + + @SerializedName("my_sst") + MY_SST("my_sst"), + + @SerializedName("no_vat") + NO_VAT("no_vat"), + + @SerializedName("nz_gst") + NZ_GST("nz_gst"), + + @SerializedName("ru_inn") + RU_INN("ru_inn"), + + @SerializedName("ru_kpp") + RU_KPP("ru_kpp"), + + @SerializedName("sa_vat") + SA_VAT("sa_vat"), + + @SerializedName("sg_gst") + SG_GST("sg_gst"), + + @SerializedName("sg_uen") + SG_UEN("sg_uen"), + + @SerializedName("si_tin") + SI_TIN("si_tin"), + + @SerializedName("th_vat") + TH_VAT("th_vat"), + + @SerializedName("tw_vat") + TW_VAT("tw_vat"), + + @SerializedName("ua_vat") + UA_VAT("ua_vat"), + + @SerializedName("us_ein") + US_EIN("us_ein"), + + @SerializedName("za_vat") + ZA_VAT("za_vat"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum TaxExempt implements ApiRequestParams.EnumParam { + @SerializedName("exempt") + EXEMPT("exempt"), + + @SerializedName("none") + NONE("none"), + + @SerializedName("reverse") + REVERSE("reverse"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TaxExempt(String value) { + this.value = value; + } + } + } + + @Getter + public static class Discount { + /** ID of the coupon to create a new discount for. */ + @SerializedName("coupon") + String coupon; + + /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ + @SerializedName("discount") + String discount; + + /** + * 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 Discount(String coupon, String discount, Map extraParams) { + this.coupon = coupon; + this.discount = discount; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String coupon; + + private String discount; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.Discount build() { + return new InvoiceUpcomingLinesParams.Discount( + this.coupon, this.discount, this.extraParams); + } + + /** ID of the coupon to create a new discount for. */ + public Builder setCoupon(String coupon) { + this.coupon = coupon; + return this; + } + + /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ + public Builder setDiscount(String discount) { + this.discount = discount; + 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 + * InvoiceUpcomingLinesParams.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 InvoiceUpcomingLinesParams.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; + } + } + } + + @Getter + public static class InvoiceItem { + /** The integer amount in cents (or local equivalent) of previewed invoice item. */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. Only applicable to new invoice items. + */ + @SerializedName("currency") + String currency; + + /** + * An arbitrary string which you can attach to the invoice item. The description is displayed in + * the invoice for easy tracking. + */ + @SerializedName("description") + String description; + + /** + * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except + * for negative invoice items. + */ + @SerializedName("discountable") + Boolean discountable; + + /** The coupons to redeem into discounts for the invoice item in the preview. */ + @SerializedName("discounts") + Object discounts; + + /** + * 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 invoice item to update in preview. If not specified, a new invoice item will be + * added to the preview of the upcoming invoice. + */ + @SerializedName("invoiceitem") + String invoiceitem; + + /** + * 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") + Object metadata; + + /** + * The period associated with this invoice item. When set to different values, the period will + * be rendered on the invoice. + */ + @SerializedName("period") + Period period; + + /** The ID of the price object. */ + @SerializedName("price") + String price; + + /** + * Data used to generate a new Price object + * inline. + */ + @SerializedName("price_data") + PriceData priceData; + + /** Non-negative integer. The quantity of units for the invoice item. */ + @SerializedName("quantity") + Long quantity; + + /** + * The tax rates that apply to the item. When set, any {@code default_tax_rates} do not apply to + * this item. + */ + @SerializedName("tax_rates") + Object taxRates; + + /** + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the + * upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. + * If you want to apply a credit to the customer's account, pass a negative unit_amount. + */ + @SerializedName("unit_amount") + Long unitAmount; + + /** + * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent) with + * at most 12 decimal places. Only one of {@code unit_amount} and {@code unit_amount_decimal} + * can be set. + */ + @SerializedName("unit_amount_decimal") + BigDecimal unitAmountDecimal; + + private InvoiceItem( + Long amount, + String currency, + String description, + Boolean discountable, + Object discounts, + Map extraParams, + String invoiceitem, + Object metadata, + Period period, + String price, + PriceData priceData, + Long quantity, + Object taxRates, + Long unitAmount, + BigDecimal unitAmountDecimal) { + this.amount = amount; + this.currency = currency; + this.description = description; + this.discountable = discountable; + this.discounts = discounts; + this.extraParams = extraParams; + this.invoiceitem = invoiceitem; + this.metadata = metadata; + this.period = period; + this.price = price; + this.priceData = priceData; + this.quantity = quantity; + this.taxRates = taxRates; + this.unitAmount = unitAmount; + this.unitAmountDecimal = unitAmountDecimal; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private String description; + + private Boolean discountable; + + private Object discounts; + + private Map extraParams; + + private String invoiceitem; + + private Object metadata; + + private Period period; + + private String price; + + private PriceData priceData; + + private Long quantity; + + private Object taxRates; + + private Long unitAmount; + + private BigDecimal unitAmountDecimal; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.InvoiceItem build() { + return new InvoiceUpcomingLinesParams.InvoiceItem( + this.amount, + this.currency, + this.description, + this.discountable, + this.discounts, + this.extraParams, + this.invoiceitem, + this.metadata, + this.period, + this.price, + this.priceData, + this.quantity, + this.taxRates, + this.unitAmount, + this.unitAmountDecimal); + } + + /** The integer amount in cents (or local equivalent) of previewed invoice item. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. Only applicable to new invoice items. + */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * An arbitrary string which you can attach to the invoice item. The description is displayed + * in the invoice for easy tracking. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except + * for negative invoice items. + */ + public Builder setDiscountable(Boolean discountable) { + this.discountable = discountable; + return this; + } + + /** + * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams.InvoiceItem#discounts} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addDiscount(InvoiceUpcomingLinesParams.InvoiceItem.Discount element) { + if (this.discounts == null || this.discounts instanceof EmptyParam) { + this.discounts = new ArrayList(); + } + ((List) this.discounts).add(element); + return this; + } + + /** + * Add all elements to `discounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams.InvoiceItem#discounts} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllDiscount( + List elements) { + if (this.discounts == null || this.discounts instanceof EmptyParam) { + this.discounts = new ArrayList(); + } + ((List) this.discounts).addAll(elements); + return this; + } + + /** The coupons to redeem into discounts for the invoice item in the preview. */ + public Builder setDiscounts(EmptyParam discounts) { + this.discounts = discounts; + return this; + } + + /** The coupons to redeem into discounts for the invoice item in the preview. */ + public Builder setDiscounts(List discounts) { + this.discounts = discounts; + 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 + * InvoiceUpcomingLinesParams.InvoiceItem#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 InvoiceUpcomingLinesParams.InvoiceItem#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 invoice item to update in preview. If not specified, a new invoice item will + * be added to the preview of the upcoming invoice. + */ + public Builder setInvoiceitem(String invoiceitem) { + this.invoiceitem = invoiceitem; + 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 + * InvoiceUpcomingLinesParams.InvoiceItem#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) 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 InvoiceUpcomingLinesParams.InvoiceItem#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * The period associated with this invoice item. When set to different values, the period will + * be rendered on the invoice. + */ + public Builder setPeriod(InvoiceUpcomingLinesParams.InvoiceItem.Period period) { + this.period = period; + return this; + } + + /** The ID of the price object. */ + public Builder setPrice(String price) { + this.price = price; + return this; + } + + /** + * Data used to generate a new Price object + * inline. + */ + public Builder setPriceData(InvoiceUpcomingLinesParams.InvoiceItem.PriceData priceData) { + this.priceData = priceData; + return this; + } + + /** Non-negative integer. The quantity of units for the invoice item. */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** + * Add an element to `taxRates` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams.InvoiceItem#taxRates} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addTaxRate(String element) { + if (this.taxRates == null || this.taxRates instanceof EmptyParam) { + this.taxRates = new ArrayList(); + } + ((List) this.taxRates).add(element); + return this; + } + + /** + * Add all elements to `taxRates` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams.InvoiceItem#taxRates} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllTaxRate(List elements) { + if (this.taxRates == null || this.taxRates instanceof EmptyParam) { + this.taxRates = new ArrayList(); + } + ((List) this.taxRates).addAll(elements); + return this; + } + + /** + * The tax rates that apply to the item. When set, any {@code default_tax_rates} do not apply + * to this item. + */ + public Builder setTaxRates(EmptyParam taxRates) { + this.taxRates = taxRates; + return this; + } + + /** + * The tax rates that apply to the item. When set, any {@code default_tax_rates} do not apply + * to this item. + */ + public Builder setTaxRates(List taxRates) { + this.taxRates = taxRates; + return this; + } + + /** + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the + * upcoming invoice. This unit_amount will be multiplied by the quantity to get the full + * amount. If you want to apply a credit to the customer's account, pass a negative + * unit_amount. + */ + public Builder setUnitAmount(Long unitAmount) { + this.unitAmount = unitAmount; + return this; + } + + /** + * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent) + * with at most 12 decimal places. Only one of {@code unit_amount} and {@code + * unit_amount_decimal} can be set. + */ + public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) { + this.unitAmountDecimal = unitAmountDecimal; + return this; + } + } + + @Getter + public static class Discount { + /** ID of the coupon to create a new discount for. */ + @SerializedName("coupon") + String coupon; + + /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ + @SerializedName("discount") + String discount; + + /** + * 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 Discount(String coupon, String discount, Map extraParams) { + this.coupon = coupon; + this.discount = discount; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String coupon; + + private String discount; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.InvoiceItem.Discount build() { + return new InvoiceUpcomingLinesParams.InvoiceItem.Discount( + this.coupon, this.discount, this.extraParams); + } + + /** ID of the coupon to create a new discount for. */ + public Builder setCoupon(String coupon) { + this.coupon = coupon; + return this; + } + + /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ + public Builder setDiscount(String discount) { + this.discount = discount; + 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 InvoiceUpcomingLinesParams.InvoiceItem.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 InvoiceUpcomingLinesParams.InvoiceItem.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; + } + } + } + + @Getter + public static class Period { + /** The end of the period, which must be greater than or equal to the start. */ + @SerializedName("end") + Long end; + + /** + * 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 start of the period. */ + @SerializedName("start") + Long start; + + private Period(Long end, Map extraParams, Long start) { + this.end = end; + this.extraParams = extraParams; + this.start = start; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long end; + + private Map extraParams; + + private Long start; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.InvoiceItem.Period build() { + return new InvoiceUpcomingLinesParams.InvoiceItem.Period( + this.end, this.extraParams, this.start); + } + + /** The end of the period, which must be greater than or equal to the start. */ + public Builder setEnd(Long end) { + this.end = end; + 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 InvoiceUpcomingLinesParams.InvoiceItem.Period#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 InvoiceUpcomingLinesParams.InvoiceItem.Period#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 start of the period. */ + public Builder setStart(Long start) { + this.start = start; + return this; + } + } + } + + @Getter + public static class PriceData { + /** + * 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; + + /** The ID of the product that this price will belong to. */ + @SerializedName("product") + String product; + + /** + * Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of + * {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either + * {@code inclusive} or {@code exclusive}, it cannot be changed. + */ + @SerializedName("tax_behavior") + TaxBehavior taxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how + * much to charge. + */ + @SerializedName("unit_amount") + Long unitAmount; + + /** + * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent) + * with at most 12 decimal places. Only one of {@code unit_amount} and {@code + * unit_amount_decimal} can be set. + */ + @SerializedName("unit_amount_decimal") + BigDecimal unitAmountDecimal; + + private PriceData( + String currency, + Map extraParams, + String product, + TaxBehavior taxBehavior, + Long unitAmount, + BigDecimal unitAmountDecimal) { + this.currency = currency; + this.extraParams = extraParams; + this.product = product; + this.taxBehavior = taxBehavior; + this.unitAmount = unitAmount; + this.unitAmountDecimal = unitAmountDecimal; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String currency; + + private Map extraParams; + + private String product; + + private TaxBehavior taxBehavior; + + private Long unitAmount; + + private BigDecimal unitAmountDecimal; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.InvoiceItem.PriceData build() { + return new InvoiceUpcomingLinesParams.InvoiceItem.PriceData( + this.currency, + this.extraParams, + this.product, + this.taxBehavior, + this.unitAmount, + this.unitAmountDecimal); + } + + /** + * 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 InvoiceUpcomingLinesParams.InvoiceItem.PriceData#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 InvoiceUpcomingLinesParams.InvoiceItem.PriceData#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 product that this price will belong to. */ + public Builder setProduct(String product) { + this.product = product; + return this; + } + + /** + * Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One + * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either + * {@code inclusive} or {@code exclusive}, it cannot be changed. + */ + public Builder setTaxBehavior( + InvoiceUpcomingLinesParams.InvoiceItem.PriceData.TaxBehavior taxBehavior) { + this.taxBehavior = taxBehavior; + return this; + } + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing + * how much to charge. + */ + public Builder setUnitAmount(Long unitAmount) { + this.unitAmount = unitAmount; + return this; + } + + /** + * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent) + * with at most 12 decimal places. Only one of {@code unit_amount} and {@code + * unit_amount_decimal} can be set. + */ + public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) { + this.unitAmountDecimal = unitAmountDecimal; + return this; + } + } + + public enum TaxBehavior implements ApiRequestParams.EnumParam { + @SerializedName("exclusive") + EXCLUSIVE("exclusive"), + + @SerializedName("inclusive") + INCLUSIVE("inclusive"), + + @SerializedName("unspecified") + UNSPECIFIED("unspecified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TaxBehavior(String value) { + this.value = value; + } + } + } + } + + @Getter + public static class SubscriptionItem { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + + /** + * Delete all usage for a given subscription item. Allowed only when {@code deleted} is set to + * {@code true} and the current plan's {@code usage_type} is {@code metered}. + */ + @SerializedName("clear_usage") + Boolean clearUsage; + + /** A flag that, if set to {@code true}, will delete the specified item. */ + @SerializedName("deleted") + Boolean deleted; + + /** + * 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; + + /** Subscription item to update. */ + @SerializedName("id") + String id; + + /** + * 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") + Object metadata; + + /** Plan ID for this item, as a string. */ + @SerializedName("plan") + String plan; + + /** + * The ID of the price object. When changing a subscription item's price, {@code quantity} is + * set to 1 unless a {@code quantity} parameter is provided. + */ + @SerializedName("price") + String price; + + /** + * Data used to generate a new Price object + * inline. + */ + @SerializedName("price_data") + PriceData priceData; + + /** Quantity for this item. */ + @SerializedName("quantity") + Long quantity; + + /** + * A list of Tax Rate ids. These Tax Rates + * will override the {@code + * default_tax_rates} on the Subscription. When updating, pass an empty string to remove + * previously-defined tax rates. + */ + @SerializedName("tax_rates") + Object taxRates; + + private SubscriptionItem( + Object billingThresholds, + Boolean clearUsage, + Boolean deleted, + Map extraParams, + String id, + Object metadata, + String plan, + String price, + PriceData priceData, + Long quantity, + Object taxRates) { + this.billingThresholds = billingThresholds; + this.clearUsage = clearUsage; + this.deleted = deleted; + this.extraParams = extraParams; + this.id = id; + this.metadata = metadata; + this.plan = plan; + this.price = price; + this.priceData = priceData; + this.quantity = quantity; + this.taxRates = taxRates; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object billingThresholds; + + private Boolean clearUsage; + + private Boolean deleted; + + private Map extraParams; + + private String id; + + private Object metadata; + + private String plan; + + private String price; + + private PriceData priceData; + + private Long quantity; + + private Object taxRates; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.SubscriptionItem build() { + return new InvoiceUpcomingLinesParams.SubscriptionItem( + this.billingThresholds, + this.clearUsage, + this.deleted, + this.extraParams, + this.id, + this.metadata, + this.plan, + this.price, + this.priceData, + this.quantity, + this.taxRates); + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. When updating, pass an empty string to remove previously-defined + * thresholds. + */ + public Builder setBillingThresholds( + InvoiceUpcomingLinesParams.SubscriptionItem.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. When updating, pass an empty string to remove previously-defined + * thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Delete all usage for a given subscription item. Allowed only when {@code deleted} is set to + * {@code true} and the current plan's {@code usage_type} is {@code metered}. + */ + public Builder setClearUsage(Boolean clearUsage) { + this.clearUsage = clearUsage; + return this; + } + + /** A flag that, if set to {@code true}, will delete the specified item. */ + public Builder setDeleted(Boolean deleted) { + this.deleted = deleted; + 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 + * InvoiceUpcomingLinesParams.SubscriptionItem#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 InvoiceUpcomingLinesParams.SubscriptionItem#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Subscription item to update. */ + public Builder setId(String id) { + this.id = id; + 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 + * InvoiceUpcomingLinesParams.SubscriptionItem#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) 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 InvoiceUpcomingLinesParams.SubscriptionItem#metadata} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** Plan ID for this item, as a string. */ + public Builder setPlan(String plan) { + this.plan = plan; + return this; + } + + /** + * The ID of the price object. When changing a subscription item's price, {@code quantity} is + * set to 1 unless a {@code quantity} parameter is provided. + */ + public Builder setPrice(String price) { + this.price = price; + return this; + } + + /** + * Data used to generate a new Price object + * inline. + */ + public Builder setPriceData(InvoiceUpcomingLinesParams.SubscriptionItem.PriceData priceData) { + this.priceData = priceData; + return this; + } + + /** Quantity for this item. */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** + * Add an element to `taxRates` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams.SubscriptionItem#taxRates} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addTaxRate(String element) { + if (this.taxRates == null || this.taxRates instanceof EmptyParam) { + this.taxRates = new ArrayList(); + } + ((List) this.taxRates).add(element); + return this; + } + + /** + * Add all elements to `taxRates` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams.SubscriptionItem#taxRates} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllTaxRate(List elements) { + if (this.taxRates == null || this.taxRates instanceof EmptyParam) { + this.taxRates = new ArrayList(); + } + ((List) this.taxRates).addAll(elements); + return this; + } + + /** + * A list of Tax Rate ids. These Tax Rates + * will override the {@code + * default_tax_rates} on the Subscription. When updating, pass an empty string to remove + * previously-defined tax rates. + */ + public Builder setTaxRates(EmptyParam taxRates) { + this.taxRates = taxRates; + return this; + } + + /** + * A list of Tax Rate ids. These Tax Rates + * will override the {@code + * default_tax_rates} on the Subscription. When updating, pass an empty string to remove + * previously-defined tax rates. + */ + public Builder setTaxRates(List taxRates) { + this.taxRates = taxRates; + return this; + } + } + + @Getter + public static class BillingThresholds { + /** + * 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; + + /** Usage threshold that triggers the subscription to advance to a new billing period. */ + @SerializedName("usage_gte") + Long usageGte; + + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; + this.usageGte = usageGte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long usageGte; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.SubscriptionItem.BillingThresholds build() { + return new InvoiceUpcomingLinesParams.SubscriptionItem.BillingThresholds( + this.extraParams, this.usageGte); + } + + /** + * 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 + * InvoiceUpcomingLinesParams.SubscriptionItem.BillingThresholds#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 + * InvoiceUpcomingLinesParams.SubscriptionItem.BillingThresholds#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Usage threshold that triggers the subscription to advance to a new billing period. */ + public Builder setUsageGte(Long usageGte) { + this.usageGte = usageGte; + return this; + } + } + } + + @Getter + public static class PriceData { + /** + * 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; + + /** The ID of the product that this price will belong to. */ + @SerializedName("product") + String product; + + /** + * The recurring components of a price such as {@code interval} and {@code interval_count}. + */ + @SerializedName("recurring") + Recurring recurring; + + /** + * Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of + * {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either + * {@code inclusive} or {@code exclusive}, it cannot be changed. + */ + @SerializedName("tax_behavior") + TaxBehavior taxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how + * much to charge. + */ + @SerializedName("unit_amount") + Long unitAmount; + + /** + * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent) + * with at most 12 decimal places. Only one of {@code unit_amount} and {@code + * unit_amount_decimal} can be set. + */ + @SerializedName("unit_amount_decimal") + BigDecimal unitAmountDecimal; + + private PriceData( + String currency, + Map extraParams, + String product, + Recurring recurring, + TaxBehavior taxBehavior, + Long unitAmount, + BigDecimal unitAmountDecimal) { + this.currency = currency; + this.extraParams = extraParams; + this.product = product; + this.recurring = recurring; + this.taxBehavior = taxBehavior; + this.unitAmount = unitAmount; + this.unitAmountDecimal = unitAmountDecimal; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String currency; + + private Map extraParams; + + private String product; + + private Recurring recurring; + + private TaxBehavior taxBehavior; + + private Long unitAmount; + + private BigDecimal unitAmountDecimal; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.SubscriptionItem.PriceData build() { + return new InvoiceUpcomingLinesParams.SubscriptionItem.PriceData( + this.currency, + this.extraParams, + this.product, + this.recurring, + this.taxBehavior, + this.unitAmount, + this.unitAmountDecimal); + } + + /** + * 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 InvoiceUpcomingLinesParams.SubscriptionItem.PriceData#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 InvoiceUpcomingLinesParams.SubscriptionItem.PriceData#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 product that this price will belong to. */ + public Builder setProduct(String product) { + this.product = product; + return this; + } + + /** + * The recurring components of a price such as {@code interval} and {@code interval_count}. + */ + public Builder setRecurring( + InvoiceUpcomingLinesParams.SubscriptionItem.PriceData.Recurring recurring) { + this.recurring = recurring; + return this; + } + + /** + * Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One + * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either + * {@code inclusive} or {@code exclusive}, it cannot be changed. + */ + public Builder setTaxBehavior( + InvoiceUpcomingLinesParams.SubscriptionItem.PriceData.TaxBehavior taxBehavior) { + this.taxBehavior = taxBehavior; + return this; + } + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing + * how much to charge. + */ + public Builder setUnitAmount(Long unitAmount) { + this.unitAmount = unitAmount; + return this; + } + + /** + * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent) + * with at most 12 decimal places. Only one of {@code unit_amount} and {@code + * unit_amount_decimal} can be set. + */ + public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) { + this.unitAmountDecimal = unitAmountDecimal; + return this; + } + } + + @Getter + public static class Recurring { + /** + * 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; + + /** + * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code + * year}. + */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals between subscription billings. 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 Recurring(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 InvoiceUpcomingLinesParams.SubscriptionItem.PriceData.Recurring build() { + return new InvoiceUpcomingLinesParams.SubscriptionItem.PriceData.Recurring( + 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 + * InvoiceUpcomingLinesParams.SubscriptionItem.PriceData.Recurring#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 + * InvoiceUpcomingLinesParams.SubscriptionItem.PriceData.Recurring#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code + * year}. + */ + public Builder setInterval( + InvoiceUpcomingLinesParams.SubscriptionItem.PriceData.Recurring.Interval interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals between subscription billings. 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; + } + } + } + + public enum TaxBehavior implements ApiRequestParams.EnumParam { + @SerializedName("exclusive") + EXCLUSIVE("exclusive"), + + @SerializedName("inclusive") + INCLUSIVE("inclusive"), + + @SerializedName("unspecified") + UNSPECIFIED("unspecified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TaxBehavior(String value) { + this.value = value; + } + } + } + } + + public enum SubscriptionBillingCycleAnchor implements ApiRequestParams.EnumParam { + @SerializedName("now") + NOW("now"), + + @SerializedName("unchanged") + UNCHANGED("unchanged"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SubscriptionBillingCycleAnchor(String value) { + this.value = value; + } + } + + public enum SubscriptionProrationBehavior implements ApiRequestParams.EnumParam { + @SerializedName("always_invoice") + ALWAYS_INVOICE("always_invoice"), + + @SerializedName("create_prorations") + CREATE_PRORATIONS("create_prorations"), + + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SubscriptionProrationBehavior(String value) { + this.value = value; + } + } + + public enum SubscriptionTrialEnd implements ApiRequestParams.EnumParam { + @SerializedName("now") + NOW("now"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SubscriptionTrialEnd(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/InvoiceUpcomingParams.java b/src/main/java/com/stripe/param/InvoiceUpcomingParams.java index afeba719bb4..d831350f134 100644 --- a/src/main/java/com/stripe/param/InvoiceUpcomingParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpcomingParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; import java.util.ArrayList; @@ -67,7 +66,7 @@ public class InvoiceUpcomingParams extends ApiRequestParams { /** List of invoice items to add or update in the upcoming invoice preview. */ @SerializedName("invoice_items") - List invoiceItems; + List invoiceItems; /** * The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot @@ -123,7 +122,7 @@ public class InvoiceUpcomingParams extends ApiRequestParams { /** A list of up to 20 subscription items, each with an attached price. */ @SerializedName("subscription_items") - List subscriptionItems; + List subscriptionItems; /** * Determines how to handle expand, Map extraParams, - List invoiceItems, + List invoiceItems, String schedule, String subscription, Object subscriptionBillingCycleAnchor, @@ -183,7 +182,7 @@ private InvoiceUpcomingParams( Boolean subscriptionCancelAtPeriodEnd, Boolean subscriptionCancelNow, Object subscriptionDefaultTaxRates, - List subscriptionItems, + List subscriptionItems, SubscriptionProrationBehavior subscriptionProrationBehavior, Long subscriptionProrationDate, Long subscriptionStartDate, @@ -234,7 +233,7 @@ public static class Builder { private Map extraParams; - private List invoiceItems; + private List invoiceItems; private String schedule; @@ -250,7 +249,7 @@ public static class Builder { private Object subscriptionDefaultTaxRates; - private List subscriptionItems; + private List subscriptionItems; private SubscriptionProrationBehavior subscriptionProrationBehavior; @@ -290,7 +289,7 @@ public InvoiceUpcomingParams build() { } /** Settings for automatic tax lookup for this invoice preview. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(InvoiceUpcomingParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -323,7 +322,7 @@ public Builder setCustomer(String customer) { } /** Details about the customer you want to invoice or overrides for an existing customer. */ - public Builder setCustomerDetails(CustomerDetails customerDetails) { + public Builder setCustomerDetails(InvoiceUpcomingParams.CustomerDetails customerDetails) { this.customerDetails = customerDetails; return this; } @@ -334,7 +333,7 @@ public Builder setCustomerDetails(CustomerDetails customerDetails) { * InvoiceUpcomingParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(InvoiceUpcomingParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -348,7 +347,7 @@ public Builder addDiscount(Discount element) { * InvoiceUpcomingParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -375,7 +374,7 @@ public Builder setDiscounts(EmptyParam discounts) { * instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming * invoice for a subscription that hasn't been created, use {@code coupon} instead. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -437,7 +436,7 @@ public Builder putAllExtraParam(Map map) { * and subsequent calls adds additional elements to the original list. See {@link * InvoiceUpcomingParams#invoiceItems} for the field documentation. */ - public Builder addInvoiceItem(InvoiceItem element) { + public Builder addInvoiceItem(InvoiceUpcomingParams.InvoiceItem element) { if (this.invoiceItems == null) { this.invoiceItems = new ArrayList<>(); } @@ -450,7 +449,7 @@ public Builder addInvoiceItem(InvoiceItem element) { * call, and subsequent calls adds additional elements to the original list. See {@link * InvoiceUpcomingParams#invoiceItems} for the field documentation. */ - public Builder addAllInvoiceItem(List elements) { + public Builder addAllInvoiceItem(List elements) { if (this.invoiceItems == null) { this.invoiceItems = new ArrayList<>(); } @@ -487,7 +486,7 @@ public Builder setSubscription(String subscription) { * the value can only be set to {@code now} or {@code unchanged}. */ public Builder setSubscriptionBillingCycleAnchor( - SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor) { + InvoiceUpcomingParams.SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor) { this.subscriptionBillingCycleAnchor = subscriptionBillingCycleAnchor; return this; } @@ -591,7 +590,7 @@ public Builder setSubscriptionDefaultTaxRates(List subscriptionDefaultTa * call, and subsequent calls adds additional elements to the original list. See {@link * InvoiceUpcomingParams#subscriptionItems} for the field documentation. */ - public Builder addSubscriptionItem(SubscriptionItem element) { + public Builder addSubscriptionItem(InvoiceUpcomingParams.SubscriptionItem element) { if (this.subscriptionItems == null) { this.subscriptionItems = new ArrayList<>(); } @@ -604,7 +603,7 @@ public Builder addSubscriptionItem(SubscriptionItem element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link InvoiceUpcomingParams#subscriptionItems} for the field documentation. */ - public Builder addAllSubscriptionItem(List elements) { + public Builder addAllSubscriptionItem(List elements) { if (this.subscriptionItems == null) { this.subscriptionItems = new ArrayList<>(); } @@ -619,7 +618,7 @@ public Builder addAllSubscriptionItem(List elements) { * billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes. */ public Builder setSubscriptionProrationBehavior( - SubscriptionProrationBehavior subscriptionProrationBehavior) { + InvoiceUpcomingParams.SubscriptionProrationBehavior subscriptionProrationBehavior) { this.subscriptionProrationBehavior = subscriptionProrationBehavior; return this; } @@ -647,7 +646,8 @@ public Builder setSubscriptionStartDate(Long subscriptionStartDate) { * If provided, the invoice returned will preview updating or creating a subscription with that * trial end. If set, one of {@code subscription_items} or {@code subscription} is required. */ - public Builder setSubscriptionTrialEnd(SubscriptionTrialEnd subscriptionTrialEnd) { + public Builder setSubscriptionTrialEnd( + InvoiceUpcomingParams.SubscriptionTrialEnd subscriptionTrialEnd) { this.subscriptionTrialEnd = subscriptionTrialEnd; return this; } @@ -709,8 +709,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public InvoiceUpcomingParams.AutomaticTax build() { + return new InvoiceUpcomingParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -777,19 +777,19 @@ public static class CustomerDetails { /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */ @SerializedName("tax_exempt") - EnumParam taxExempt; + ApiRequestParams.EnumParam taxExempt; /** The customer's tax IDs. */ @SerializedName("tax_ids") - List taxIds; + List taxIds; private CustomerDetails( Object address, Map extraParams, Object shipping, Tax tax, - EnumParam taxExempt, - List taxIds) { + ApiRequestParams.EnumParam taxExempt, + List taxIds) { this.address = address; this.extraParams = extraParams; this.shipping = shipping; @@ -811,18 +811,18 @@ public static class Builder { private Tax tax; - private EnumParam taxExempt; + private ApiRequestParams.EnumParam taxExempt; - private List taxIds; + private List taxIds; /** Finalize and obtain parameter instance from this builder. */ - public CustomerDetails build() { - return new CustomerDetails( + public InvoiceUpcomingParams.CustomerDetails build() { + return new InvoiceUpcomingParams.CustomerDetails( this.address, this.extraParams, this.shipping, this.tax, this.taxExempt, this.taxIds); } /** The customer's address. */ - public Builder setAddress(Address address) { + public Builder setAddress(InvoiceUpcomingParams.CustomerDetails.Address address) { this.address = address; return this; } @@ -860,7 +860,7 @@ public Builder putAllExtraParam(Map map) { } /** The customer's shipping information. Appears on invoices emailed to this customer. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(InvoiceUpcomingParams.CustomerDetails.Shipping shipping) { this.shipping = shipping; return this; } @@ -872,13 +872,13 @@ public Builder setShipping(EmptyParam shipping) { } /** Tax details about the customer. */ - public Builder setTax(Tax tax) { + public Builder setTax(InvoiceUpcomingParams.CustomerDetails.Tax tax) { this.tax = tax; return this; } /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */ - public Builder setTaxExempt(TaxExempt taxExempt) { + public Builder setTaxExempt(InvoiceUpcomingParams.CustomerDetails.TaxExempt taxExempt) { this.taxExempt = taxExempt; return this; } @@ -894,7 +894,7 @@ public Builder setTaxExempt(EmptyParam taxExempt) { * subsequent calls adds additional elements to the original list. See {@link * InvoiceUpcomingParams.CustomerDetails#taxIds} for the field documentation. */ - public Builder addTaxId(TaxId element) { + public Builder addTaxId(InvoiceUpcomingParams.CustomerDetails.TaxId element) { if (this.taxIds == null) { this.taxIds = new ArrayList<>(); } @@ -907,7 +907,7 @@ public Builder addTaxId(TaxId element) { * and subsequent calls adds additional elements to the original list. See {@link * InvoiceUpcomingParams.CustomerDetails#taxIds} for the field documentation. */ - public Builder addAllTaxId(List elements) { + public Builder addAllTaxId(List elements) { if (this.taxIds == null) { this.taxIds = new ArrayList<>(); } @@ -991,8 +991,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public InvoiceUpcomingParams.CustomerDetails.Address build() { + return new InvoiceUpcomingParams.CustomerDetails.Address( this.city, this.country, this.extraParams, @@ -1116,12 +1116,13 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping(this.address, this.extraParams, this.name, this.phone); + public InvoiceUpcomingParams.CustomerDetails.Shipping build() { + return new InvoiceUpcomingParams.CustomerDetails.Shipping( + this.address, this.extraParams, this.name, this.phone); } /** Customer shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(InvoiceUpcomingParams.CustomerDetails.Shipping.Address address) { this.address = address; return this; } @@ -1243,8 +1244,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public InvoiceUpcomingParams.CustomerDetails.Shipping.Address build() { + return new InvoiceUpcomingParams.CustomerDetails.Shipping.Address( this.city, this.country, this.extraParams, @@ -1359,8 +1360,8 @@ public static class Builder { private Object ipAddress; /** Finalize and obtain parameter instance from this builder. */ - public Tax build() { - return new Tax(this.extraParams, this.ipAddress); + public InvoiceUpcomingParams.CustomerDetails.Tax build() { + return new InvoiceUpcomingParams.CustomerDetails.Tax(this.extraParams, this.ipAddress); } /** @@ -1462,8 +1463,9 @@ public static class Builder { private String value; /** Finalize and obtain parameter instance from this builder. */ - public TaxId build() { - return new TaxId(this.extraParams, this.type, this.value); + public InvoiceUpcomingParams.CustomerDetails.TaxId build() { + return new InvoiceUpcomingParams.CustomerDetails.TaxId( + this.extraParams, this.type, this.value); } /** @@ -1506,7 +1508,7 @@ public Builder putAllExtraParam(Map map) { * si_tin}, {@code th_vat}, {@code tw_vat}, {@code ua_vat}, {@code us_ein}, or {@code * za_vat}. */ - public Builder setType(Type type) { + public Builder setType(InvoiceUpcomingParams.CustomerDetails.TaxId.Type type) { this.type = type; return this; } @@ -1722,8 +1724,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public InvoiceUpcomingParams.Discount build() { + return new InvoiceUpcomingParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1937,8 +1939,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceItem build() { - return new InvoiceItem( + public InvoiceUpcomingParams.InvoiceItem build() { + return new InvoiceUpcomingParams.InvoiceItem( this.amount, this.currency, this.description, @@ -1996,7 +1998,7 @@ public Builder setDiscountable(Boolean discountable) { * InvoiceUpcomingParams.InvoiceItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(InvoiceUpcomingParams.InvoiceItem.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2010,7 +2012,7 @@ public Builder addDiscount(Discount element) { * InvoiceUpcomingParams.InvoiceItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2025,7 +2027,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The coupons to redeem into discounts for the invoice item in the preview. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -2119,7 +2121,7 @@ public Builder setMetadata(Map metadata) { * The period associated with this invoice item. When set to different values, the period will * be rendered on the invoice. */ - public Builder setPeriod(Period period) { + public Builder setPeriod(InvoiceUpcomingParams.InvoiceItem.Period period) { this.period = period; return this; } @@ -2134,7 +2136,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(InvoiceUpcomingParams.InvoiceItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -2250,8 +2252,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public InvoiceUpcomingParams.InvoiceItem.Discount build() { + return new InvoiceUpcomingParams.InvoiceItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2333,8 +2336,9 @@ public static class Builder { private Long start; /** Finalize and obtain parameter instance from this builder. */ - public Period build() { - return new Period(this.end, this.extraParams, this.start); + public InvoiceUpcomingParams.InvoiceItem.Period build() { + return new InvoiceUpcomingParams.InvoiceItem.Period( + this.end, this.extraParams, this.start); } /** The end of the period, which must be greater than or equal to the start. */ @@ -2458,8 +2462,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public InvoiceUpcomingParams.InvoiceItem.PriceData build() { + return new InvoiceUpcomingParams.InvoiceItem.PriceData( this.currency, this.extraParams, this.product, @@ -2517,7 +2521,8 @@ public Builder setProduct(String product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + InvoiceUpcomingParams.InvoiceItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2689,8 +2694,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionItem build() { - return new SubscriptionItem( + public InvoiceUpcomingParams.SubscriptionItem build() { + return new InvoiceUpcomingParams.SubscriptionItem( this.billingThresholds, this.clearUsage, this.deleted, @@ -2709,7 +2714,8 @@ public SubscriptionItem build() { * billing period. When updating, pass an empty string to remove previously-defined * thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + InvoiceUpcomingParams.SubscriptionItem.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -2840,7 +2846,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(InvoiceUpcomingParams.SubscriptionItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -2934,8 +2940,9 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public InvoiceUpcomingParams.SubscriptionItem.BillingThresholds build() { + return new InvoiceUpcomingParams.SubscriptionItem.BillingThresholds( + this.extraParams, this.usageGte); } /** @@ -3063,8 +3070,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public InvoiceUpcomingParams.SubscriptionItem.PriceData build() { + return new InvoiceUpcomingParams.SubscriptionItem.PriceData( this.currency, this.extraParams, this.product, @@ -3121,7 +3128,8 @@ public Builder setProduct(String product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring( + InvoiceUpcomingParams.SubscriptionItem.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -3131,7 +3139,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + InvoiceUpcomingParams.SubscriptionItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -3201,8 +3210,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public InvoiceUpcomingParams.SubscriptionItem.PriceData.Recurring build() { + return new InvoiceUpcomingParams.SubscriptionItem.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -3237,7 +3247,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + InvoiceUpcomingParams.SubscriptionItem.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } diff --git a/src/main/java/com/stripe/param/InvoiceUpdateParams.java b/src/main/java/com/stripe/param/InvoiceUpdateParams.java index 835a4f27bc3..b7f9359aafc 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -358,7 +357,7 @@ public Builder setAutoAdvance(Boolean autoAdvance) { } /** Settings for automatic tax lookup for this invoice. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(InvoiceUpdateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -367,7 +366,7 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * Either {@code charge_automatically} or {@code send_invoice}. This field can be updated only * on {@code draft} invoices. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(InvoiceUpdateParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -378,7 +377,7 @@ public Builder setCollectionMethod(CollectionMethod collectionMethod) { * InvoiceUpdateParams#customFields} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addCustomField(CustomField element) { + public Builder addCustomField(InvoiceUpdateParams.CustomField element) { if (this.customFields == null || this.customFields instanceof EmptyParam) { this.customFields = new ArrayList(); } @@ -392,7 +391,7 @@ public Builder addCustomField(CustomField element) { * InvoiceUpdateParams#customFields} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllCustomField(List elements) { + public Builder addAllCustomField(List elements) { if (this.customFields == null || this.customFields instanceof EmptyParam) { this.customFields = new ArrayList(); } @@ -415,7 +414,7 @@ public Builder setCustomFields(EmptyParam customFields) { * custom_fields} is specified, the list specified will replace the existing custom field list * on this invoice. Pass an empty string to remove previously-defined fields. */ - public Builder setCustomFields(List customFields) { + public Builder setCustomFields(List customFields) { this.customFields = customFields; return this; } @@ -540,7 +539,7 @@ public Builder setDescription(EmptyParam description) { * InvoiceUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(InvoiceUpdateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -554,7 +553,7 @@ public Builder addDiscount(Discount element) { * InvoiceUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -575,7 +574,7 @@ public Builder setDiscounts(EmptyParam discounts) { * The discounts that will apply to the invoice. Pass an empty string to remove * previously-defined discounts. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -728,13 +727,13 @@ public Builder setOnBehalfOf(EmptyParam onBehalfOf) { /** * Configuration settings for the PaymentIntent that is generated when the invoice is finalized. */ - public Builder setPaymentSettings(PaymentSettings paymentSettings) { + public Builder setPaymentSettings(InvoiceUpdateParams.PaymentSettings paymentSettings) { this.paymentSettings = paymentSettings; return this; } /** Options for invoice PDF rendering. */ - public Builder setRenderingOptions(RenderingOptions renderingOptions) { + public Builder setRenderingOptions(InvoiceUpdateParams.RenderingOptions renderingOptions) { this.renderingOptions = renderingOptions; return this; } @@ -772,7 +771,7 @@ public Builder setStatementDescriptor(EmptyParam statementDescriptor) { * the resulting transfer will be found on the invoice's charge. This will be unset if you POST * an empty value. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(InvoiceUpdateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -823,8 +822,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public InvoiceUpdateParams.AutomaticTax build() { + return new InvoiceUpdateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -903,8 +902,8 @@ public static class Builder { private Object value; /** Finalize and obtain parameter instance from this builder. */ - public CustomField build() { - return new CustomField(this.extraParams, this.name, this.value); + public InvoiceUpdateParams.CustomField build() { + return new InvoiceUpdateParams.CustomField(this.extraParams, this.name, this.value); } /** @@ -996,8 +995,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public InvoiceUpdateParams.Discount build() { + return new InvoiceUpdateParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1109,8 +1108,8 @@ public static class Builder { private Object paymentMethodTypes; /** Finalize and obtain parameter instance from this builder. */ - public PaymentSettings build() { - return new PaymentSettings( + public InvoiceUpdateParams.PaymentSettings build() { + return new InvoiceUpdateParams.PaymentSettings( this.defaultMandate, this.extraParams, this.paymentMethodOptions, @@ -1164,7 +1163,8 @@ public Builder putAllExtraParam(Map map) { } /** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -1175,7 +1175,8 @@ public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions * {@link InvoiceUpdateParams.PaymentSettings#paymentMethodTypes} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addPaymentMethodType(PaymentMethodType element) { + public Builder addPaymentMethodType( + InvoiceUpdateParams.PaymentSettings.PaymentMethodType element) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -1191,7 +1192,8 @@ public Builder addPaymentMethodType(PaymentMethodType element) { * {@link InvoiceUpdateParams.PaymentSettings#paymentMethodTypes} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllPaymentMethodType(List elements) { + public Builder addAllPaymentMethodType( + List elements) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -1220,7 +1222,8 @@ public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) { * default payment method, and your invoice template settings. */ - public Builder setPaymentMethodTypes(List paymentMethodTypes) { + public Builder setPaymentMethodTypes( + List paymentMethodTypes) { this.paymentMethodTypes = paymentMethodTypes; return this; } @@ -1316,8 +1319,8 @@ public static class Builder { private Object usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions( this.acssDebit, this.bancontact, this.card, @@ -1331,7 +1334,8 @@ public PaymentMethodOptions build() { * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -1349,7 +1353,8 @@ public Builder setAcssDebit(EmptyParam acssDebit) { * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact * payment method options to pass to the invoice’s PaymentIntent. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -1367,7 +1372,7 @@ public Builder setBancontact(EmptyParam bancontact) { * If paying by {@code card}, this sub-hash contains details about the Card payment method * options to pass to the invoice’s PaymentIntent. */ - public Builder setCard(Card card) { + public Builder setCard(InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -1385,7 +1390,9 @@ public Builder setCard(EmptyParam card) { * If paying by {@code customer_balance}, this sub-hash contains details about the Bank * transfer payment method options to pass to the invoice’s PaymentIntent. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + customerBalance) { this.customerBalance = customerBalance; return this; } @@ -1431,7 +1438,8 @@ public Builder putAllExtraParam(Map map) { * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment * method options to pass to the invoice’s PaymentIntent. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini konbini) { this.konbini = konbini; return this; } @@ -1449,7 +1457,8 @@ public Builder setKonbini(EmptyParam konbini) { * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct * debit payment method options to pass to the invoice’s PaymentIntent. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -1505,8 +1514,9 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit(this.extraParams, this.mandateOptions, this.verificationMethod); + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit( + this.extraParams, this.mandateOptions, this.verificationMethod); } /** @@ -1540,13 +1550,17 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -1583,8 +1597,10 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams, this.transactionType); + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions + build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions(this.extraParams, this.transactionType); } /** @@ -1618,7 +1634,10 @@ public Builder putAllExtraParam(Map map) { } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions + .TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -1693,8 +1712,9 @@ public static class Builder { private PreferredLanguage preferredLanguage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams, this.preferredLanguage); + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact( + this.extraParams, this.preferredLanguage); } /** @@ -1731,7 +1751,9 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Bancontact authorization page that the customer is redirected * to. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -1814,8 +1836,9 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card(this.extraParams, this.installments, this.requestThreeDSecure); + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card( + this.extraParams, this.installments, this.requestThreeDSecure); } /** @@ -1855,7 +1878,9 @@ public Builder putAllExtraParam(Map map) { * href="https://stripe.com/docs/payments/installments">installments integration * guide. */ - public Builder setInstallments(Installments installments) { + public Builder setInstallments( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments + installments) { this.installments = installments; return this; } @@ -1870,7 +1895,9 @@ public Builder setInstallments(Installments installments) { * 3D Secure for more information on how this configuration interacts with Radar and * our SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -1917,8 +1944,10 @@ public static class Builder { private Object plan; /** Finalize and obtain parameter instance from this builder. */ - public Installments build() { - return new Installments(this.enabled, this.extraParams, this.plan); + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments + build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments( + this.enabled, this.extraParams, this.plan); } /** @@ -1961,7 +1990,9 @@ public Builder putAllExtraParam(Map map) { } /** The selected installment plan to use for this invoice. */ - public Builder setPlan(Plan plan) { + public Builder setPlan( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan + plan) { this.plan = plan; return this; } @@ -2025,8 +2056,10 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Plan build() { - return new Plan(this.count, this.extraParams, this.interval, this.type); + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan + build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card + .Installments.Plan(this.count, this.extraParams, this.interval, this.type); } /** @@ -2072,13 +2105,19 @@ public Builder putAllExtraParam(Map map) { * For {@code fixed_count} installment plans, this is the interval between installment * payments your customer will make to their credit card. One of {@code month}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan + .Interval + interval) { this.interval = interval; return this; } /** Type of installment plan, one of {@code fixed_count}. */ - public Builder setType(Type type) { + public Builder setType( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan + .Type + type) { this.type = type; return this; } @@ -2171,15 +2210,18 @@ public static class Builder { private Object fundingType; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.bankTransfer, this.extraParams, this.fundingType); + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance( + this.bankTransfer, this.extraParams, this.fundingType); } /** * Configuration for the bank transfer funding type, if the {@code funding_type} is set to * {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer + bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -2276,12 +2318,18 @@ public static class Builder { private Object type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer(this.euBankTransfer, this.extraParams, this.type); + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer + build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer(this.euBankTransfer, this.extraParams, this.type); } /** Configuration for eu_bank_transfer funding type. */ - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -2371,8 +2419,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer(this.country, this.extraParams); } /** @@ -2451,8 +2502,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini( + this.extraParams); } /** @@ -2528,8 +2580,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.verificationMethod); } @@ -2564,13 +2616,19 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -2594,10 +2652,17 @@ public static class FinancialConnections { * balances}, {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; private FinancialConnections( - Map extraParams, List permissions) { + Map extraParams, + List< + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions) { this.extraParams = extraParams; this.permissions = permissions; } @@ -2609,11 +2674,17 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions); + public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + build() { + return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions); } /** @@ -2653,7 +2724,10 @@ public Builder putAllExtraParam(Map map) { * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -2668,7 +2742,11 @@ public Builder addPermission(Permission element) { * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -2804,7 +2882,7 @@ public static class RenderingOptions { * will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. */ @SerializedName("amount_tax_display") - EnumParam amountTaxDisplay; + ApiRequestParams.EnumParam amountTaxDisplay; /** * Map of extra parameters for custom features not available in this client library. The content @@ -2815,7 +2893,8 @@ public static class RenderingOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private RenderingOptions(EnumParam amountTaxDisplay, Map extraParams) { + private RenderingOptions( + ApiRequestParams.EnumParam amountTaxDisplay, Map extraParams) { this.amountTaxDisplay = amountTaxDisplay; this.extraParams = extraParams; } @@ -2825,13 +2904,13 @@ public static Builder builder() { } public static class Builder { - private EnumParam amountTaxDisplay; + private ApiRequestParams.EnumParam amountTaxDisplay; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public RenderingOptions build() { - return new RenderingOptions(this.amountTaxDisplay, this.extraParams); + public InvoiceUpdateParams.RenderingOptions build() { + return new InvoiceUpdateParams.RenderingOptions(this.amountTaxDisplay, this.extraParams); } /** @@ -2840,7 +2919,8 @@ public RenderingOptions build() { * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. */ - public Builder setAmountTaxDisplay(AmountTaxDisplay amountTaxDisplay) { + public Builder setAmountTaxDisplay( + InvoiceUpdateParams.RenderingOptions.AmountTaxDisplay amountTaxDisplay) { this.amountTaxDisplay = amountTaxDisplay; return this; } @@ -2939,8 +3019,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.destination, this.extraParams); + public InvoiceUpdateParams.TransferData build() { + return new InvoiceUpdateParams.TransferData( + this.amount, this.destination, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/PaymentIntentCancelParams.java b/src/main/java/com/stripe/param/PaymentIntentCancelParams.java index e5a248eb535..74f52167c3e 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCancelParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCancelParams.java @@ -58,7 +58,8 @@ public PaymentIntentCancelParams build() { * Reason for canceling this PaymentIntent. Possible values are {@code duplicate}, {@code * fraudulent}, {@code requested_by_customer}, or {@code abandoned} */ - public Builder setCancellationReason(CancellationReason cancellationReason) { + public Builder setCancellationReason( + PaymentIntentCancelParams.CancellationReason cancellationReason) { this.cancellationReason = cancellationReason; return this; } diff --git a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java index beb859cee67..a543dcc865e 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java @@ -213,7 +213,7 @@ public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) { * href="https://stripe.com/docs/payments/connected-accounts">use case for connected * accounts. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(PaymentIntentCaptureParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -249,8 +249,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.extraParams); + public PaymentIntentCaptureParams.TransferData build() { + return new PaymentIntentCaptureParams.TransferData(this.amount, this.extraParams); } /** The amount that will be transferred automatically when a charge succeeds. */ diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 3a4726e628b..93832ba3b5a 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -120,7 +119,7 @@ public class PaymentIntentConfirmParams extends ApiRequestParams { * publishable key, you may only update the value from {@code on_session} to {@code off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Shipping information for this PaymentIntent. */ @SerializedName("shipping") @@ -147,7 +146,7 @@ private PaymentIntentConfirmParams( RadarOptions radarOptions, Object receiptEmail, String returnUrl, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, Object shipping, Boolean useStripeSdk) { this.captureMethod = captureMethod; @@ -199,7 +198,7 @@ public static class Builder { private String returnUrl; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private Object shipping; @@ -227,7 +226,7 @@ public PaymentIntentConfirmParams build() { } /** Controls when the funds will be captured from the customer's account. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod(PaymentIntentConfirmParams.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -303,7 +302,7 @@ public Builder setMandate(String mandate) { } /** This hash contains details about the Mandate to create. */ - public Builder setMandateData(MandateData mandateData) { + public Builder setMandateData(PaymentIntentConfirmParams.MandateData mandateData) { this.mandateData = mandateData; return this; } @@ -325,7 +324,7 @@ public Builder setOffSession(Boolean offSession) { * scenarios where you collect card details and charge them later. */ - public Builder setOffSession(OffSession offSession) { + public Builder setOffSession(PaymentIntentConfirmParams.OffSession offSession) { this.offSession = offSession; return this; } @@ -346,13 +345,15 @@ public Builder setPaymentMethod(String paymentMethod) { * href="https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method">payment_method * property on the PaymentIntent. */ - public Builder setPaymentMethodData(PaymentMethodData paymentMethodData) { + public Builder setPaymentMethodData( + PaymentIntentConfirmParams.PaymentMethodData paymentMethodData) { this.paymentMethodData = paymentMethodData; return this; } /** Payment-method-specific configuration for this PaymentIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + PaymentIntentConfirmParams.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -361,7 +362,7 @@ public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions(PaymentIntentConfirmParams.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -415,7 +416,8 @@ public Builder setReturnUrl(String returnUrl) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -444,7 +446,7 @@ public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { } /** Shipping information for this PaymentIntent. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(PaymentIntentConfirmParams.Shipping shipping) { this.shipping = shipping; return this; } @@ -495,12 +497,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateData build() { - return new MandateData(this.customerAcceptance, this.extraParams); + public PaymentIntentConfirmParams.MandateData build() { + return new PaymentIntentConfirmParams.MandateData( + this.customerAcceptance, this.extraParams); } /** This hash contains details about the customer acceptance of the Mandate. */ - public Builder setCustomerAcceptance(CustomerAcceptance customerAcceptance) { + public Builder setCustomerAcceptance( + PaymentIntentConfirmParams.MandateData.CustomerAcceptance customerAcceptance) { this.customerAcceptance = customerAcceptance; return this; } @@ -597,8 +601,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public CustomerAcceptance build() { - return new CustomerAcceptance( + public PaymentIntentConfirmParams.MandateData.CustomerAcceptance build() { + return new PaymentIntentConfirmParams.MandateData.CustomerAcceptance( this.acceptedAt, this.extraParams, this.offline, this.online, this.type); } @@ -640,7 +644,8 @@ public Builder putAllExtraParam(Map map) { * If this is a Mandate accepted offline, this hash contains details about the offline * acceptance. */ - public Builder setOffline(Offline offline) { + public Builder setOffline( + PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline offline) { this.offline = offline; return this; } @@ -649,7 +654,8 @@ public Builder setOffline(Offline offline) { * If this is a Mandate accepted online, this hash contains details about the online * acceptance. */ - public Builder setOnline(Online online) { + public Builder setOnline( + PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Online online) { this.online = online; return this; } @@ -658,7 +664,8 @@ public Builder setOnline(Online online) { * The type of customer acceptance information included with the Mandate. One of {@code * online} or {@code offline}. */ - public Builder setType(Type type) { + public Builder setType( + PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Type type) { this.type = type; return this; } @@ -688,8 +695,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Offline build() { - return new Offline(this.extraParams); + public PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline build() { + return new PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline( + this.extraParams); } /** @@ -762,8 +770,9 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public Online build() { - return new Online(this.extraParams, this.ipAddress, this.userAgent); + public PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Online build() { + return new PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Online( + this.extraParams, this.ipAddress, this.userAgent); } /** @@ -1206,8 +1215,8 @@ public static class Builder { private WechatPay wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodData build() { - return new PaymentMethodData( + public PaymentIntentConfirmParams.PaymentMethodData build() { + return new PaymentIntentConfirmParams.PaymentMethodData( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -1247,7 +1256,8 @@ public PaymentMethodData build() { * If this is an {@code acss_debit} PaymentMethod, this hash contains details about the ACSS * Debit payment method. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + PaymentIntentConfirmParams.PaymentMethodData.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -1256,7 +1266,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is an {@code affirm} PaymentMethod, this hash contains details about the Affirm * payment method. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(PaymentIntentConfirmParams.PaymentMethodData.Affirm affirm) { this.affirm = affirm; return this; } @@ -1265,7 +1275,8 @@ public Builder setAffirm(Affirm affirm) { * If this is an {@code AfterpayClearpay} PaymentMethod, this hash contains details about the * AfterpayClearpay payment method. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + PaymentIntentConfirmParams.PaymentMethodData.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -1274,7 +1285,7 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If this is an {@code Alipay} PaymentMethod, this hash contains details about the Alipay * payment method. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(PaymentIntentConfirmParams.PaymentMethodData.Alipay alipay) { this.alipay = alipay; return this; } @@ -1283,7 +1294,8 @@ public Builder setAlipay(Alipay alipay) { * If this is an {@code au_becs_debit} PaymentMethod, this hash contains details about the * bank account. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + PaymentIntentConfirmParams.PaymentMethodData.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -1292,7 +1304,8 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs * Direct Debit bank account. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit( + PaymentIntentConfirmParams.PaymentMethodData.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -1301,7 +1314,8 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this hash contains details about the * Bancontact payment method. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + PaymentIntentConfirmParams.PaymentMethodData.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -1310,7 +1324,8 @@ public Builder setBancontact(Bancontact bancontact) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails( + PaymentIntentConfirmParams.PaymentMethodData.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -1319,7 +1334,7 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(PaymentIntentConfirmParams.PaymentMethodData.Blik blik) { this.blik = blik; return this; } @@ -1328,7 +1343,7 @@ public Builder setBlik(Blik blik) { * If this is a {@code boleto} PaymentMethod, this hash contains details about the Boleto * payment method. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(PaymentIntentConfirmParams.PaymentMethodData.Boleto boleto) { this.boleto = boleto; return this; } @@ -1337,7 +1352,8 @@ public Builder setBoleto(Boleto boleto) { * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + PaymentIntentConfirmParams.PaymentMethodData.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -1346,7 +1362,7 @@ public Builder setCustomerBalance(CustomerBalance customerBalance) { * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment * method. */ - public Builder setEps(Eps eps) { + public Builder setEps(PaymentIntentConfirmParams.PaymentMethodData.Eps eps) { this.eps = eps; return this; } @@ -1382,7 +1398,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code fpx} PaymentMethod, this hash contains details about the FPX payment * method. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(PaymentIntentConfirmParams.PaymentMethodData.Fpx fpx) { this.fpx = fpx; return this; } @@ -1391,7 +1407,7 @@ public Builder setFpx(Fpx fpx) { * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(PaymentIntentConfirmParams.PaymentMethodData.Giropay giropay) { this.giropay = giropay; return this; } @@ -1400,7 +1416,7 @@ public Builder setGiropay(Giropay giropay) { * If this is a {@code grabpay} PaymentMethod, this hash contains details about the GrabPay * payment method. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(PaymentIntentConfirmParams.PaymentMethodData.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -1409,7 +1425,7 @@ public Builder setGrabpay(Grabpay grabpay) { * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL * payment method. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(PaymentIntentConfirmParams.PaymentMethodData.Ideal ideal) { this.ideal = ideal; return this; } @@ -1418,7 +1434,8 @@ public Builder setIdeal(Ideal ideal) { * If this is an {@code interac_present} PaymentMethod, this hash contains details about the * Interac Present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + PaymentIntentConfirmParams.PaymentMethodData.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -1427,7 +1444,7 @@ public Builder setInteracPresent(InteracPresent interacPresent) { * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna * payment method. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(PaymentIntentConfirmParams.PaymentMethodData.Klarna klarna) { this.klarna = klarna; return this; } @@ -1436,7 +1453,7 @@ public Builder setKlarna(Klarna klarna) { * If this is a {@code konbini} PaymentMethod, this hash contains details about the Konbini * payment method. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(PaymentIntentConfirmParams.PaymentMethodData.Konbini konbini) { this.konbini = konbini; return this; } @@ -1445,7 +1462,7 @@ public Builder setKonbini(Konbini konbini) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(PaymentIntentConfirmParams.PaymentMethodData.Link link) { this.link = link; return this; } @@ -1481,7 +1498,7 @@ public Builder putAllMetadata(Map map) { * If this is an {@code oxxo} PaymentMethod, this hash contains details about the OXXO payment * method. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(PaymentIntentConfirmParams.PaymentMethodData.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -1490,7 +1507,7 @@ public Builder setOxxo(Oxxo oxxo) { * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment * method. */ - public Builder setP24(P24 p24) { + public Builder setP24(PaymentIntentConfirmParams.PaymentMethodData.P24 p24) { this.p24 = p24; return this; } @@ -1499,7 +1516,7 @@ public Builder setP24(P24 p24) { * If this is a {@code paynow} PaymentMethod, this hash contains details about the PayNow * payment method. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(PaymentIntentConfirmParams.PaymentMethodData.Paynow paynow) { this.paynow = paynow; return this; } @@ -1508,7 +1525,7 @@ public Builder setPaynow(Paynow paynow) { * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. */ - public Builder setPix(Pix pix) { + public Builder setPix(PaymentIntentConfirmParams.PaymentMethodData.Pix pix) { this.pix = pix; return this; } @@ -1517,7 +1534,8 @@ public Builder setPix(Pix pix) { * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay( + PaymentIntentConfirmParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1526,7 +1544,8 @@ public Builder setPromptpay(Promptpay promptpay) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions( + PaymentIntentConfirmParams.PaymentMethodData.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -1535,7 +1554,8 @@ public Builder setRadarOptions(RadarOptions radarOptions) { * If this is a {@code sepa_debit} PaymentMethod, this hash contains details about the SEPA * debit bank account. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + PaymentIntentConfirmParams.PaymentMethodData.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -1544,7 +1564,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code sofort} PaymentMethod, this hash contains details about the SOFORT * payment method. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(PaymentIntentConfirmParams.PaymentMethodData.Sofort sofort) { this.sofort = sofort; return this; } @@ -1554,7 +1574,7 @@ public Builder setSofort(Sofort sofort) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(PaymentIntentConfirmParams.PaymentMethodData.Type type) { this.type = type; return this; } @@ -1563,7 +1583,8 @@ public Builder setType(Type type) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + PaymentIntentConfirmParams.PaymentMethodData.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -1572,7 +1593,8 @@ public Builder setUsBankAccount(UsBankAccount usBankAccount) { * If this is an {@code wechat_pay} PaymentMethod, this hash contains details about the * wechat_pay payment method. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay( + PaymentIntentConfirmParams.PaymentMethodData.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -1626,8 +1648,8 @@ public static class Builder { private String transitNumber; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public PaymentIntentConfirmParams.PaymentMethodData.AcssDebit build() { + return new PaymentIntentConfirmParams.PaymentMethodData.AcssDebit( this.accountNumber, this.extraParams, this.institutionNumber, this.transitNumber); } @@ -1702,8 +1724,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Affirm build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Affirm(this.extraParams); } /** @@ -1759,8 +1781,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.AfterpayClearpay build() { + return new PaymentIntentConfirmParams.PaymentMethodData.AfterpayClearpay( + this.extraParams); } /** @@ -1818,8 +1841,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Alipay build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Alipay(this.extraParams); } /** @@ -1889,8 +1912,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.accountNumber, this.bsbNumber, this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.AuBecsDebit build() { + return new PaymentIntentConfirmParams.PaymentMethodData.AuBecsDebit( + this.accountNumber, this.bsbNumber, this.extraParams); } /** The account number for the bank account. */ @@ -1972,8 +1996,9 @@ public static class Builder { private String sortCode; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.accountNumber, this.extraParams, this.sortCode); + public PaymentIntentConfirmParams.PaymentMethodData.BacsDebit build() { + return new PaymentIntentConfirmParams.PaymentMethodData.BacsDebit( + this.accountNumber, this.extraParams, this.sortCode); } /** Account number of the bank account that the funds will be debited from. */ @@ -2041,8 +2066,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Bancontact build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Bancontact(this.extraParams); } /** @@ -2131,13 +2156,14 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public PaymentIntentConfirmParams.PaymentMethodData.BillingDetails build() { + return new PaymentIntentConfirmParams.PaymentMethodData.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress( + PaymentIntentConfirmParams.PaymentMethodData.BillingDetails.Address address) { this.address = address; return this; } @@ -2277,8 +2303,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public PaymentIntentConfirmParams.PaymentMethodData.BillingDetails.Address build() { + return new PaymentIntentConfirmParams.PaymentMethodData.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -2383,8 +2409,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Blik build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Blik(this.extraParams); } /** @@ -2449,8 +2475,9 @@ public static class Builder { private String taxId; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.extraParams, this.taxId); + public PaymentIntentConfirmParams.PaymentMethodData.Boleto build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Boleto( + this.extraParams, this.taxId); } /** @@ -2515,8 +2542,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.CustomerBalance build() { + return new PaymentIntentConfirmParams.PaymentMethodData.CustomerBalance(this.extraParams); } /** @@ -2579,12 +2606,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.bank, this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Eps build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Eps(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentConfirmParams.PaymentMethodData.Eps.Bank bank) { this.bank = bank; return this; } @@ -2749,18 +2776,20 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.accountHolderType, this.bank, this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Fpx build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Fpx( + this.accountHolderType, this.bank, this.extraParams); } /** Account holder type for FPX transaction. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + PaymentIntentConfirmParams.PaymentMethodData.Fpx.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentConfirmParams.PaymentMethodData.Fpx.Bank bank) { this.bank = bank; return this; } @@ -2905,8 +2934,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Giropay build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Giropay(this.extraParams); } /** @@ -2962,8 +2991,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Grabpay build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Grabpay(this.extraParams); } /** @@ -3026,12 +3055,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.bank, this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Ideal build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Ideal( + this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentConfirmParams.PaymentMethodData.Ideal.Bank bank) { this.bank = bank; return this; } @@ -3137,8 +3167,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.InteracPresent build() { + return new PaymentIntentConfirmParams.PaymentMethodData.InteracPresent(this.extraParams); } /** @@ -3201,12 +3231,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.dob, this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Klarna build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Klarna( + this.dob, this.extraParams); } /** Customer's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(PaymentIntentConfirmParams.PaymentMethodData.Klarna.Dob dob) { this.dob = dob; return this; } @@ -3285,8 +3316,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public PaymentIntentConfirmParams.PaymentMethodData.Klarna.Dob build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Klarna.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -3361,8 +3393,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Konbini build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Konbini(this.extraParams); } /** @@ -3418,8 +3450,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Link build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Link(this.extraParams); } /** @@ -3475,8 +3507,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Oxxo build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Oxxo(this.extraParams); } /** @@ -3539,12 +3571,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.bank, this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.P24 build() { + return new PaymentIntentConfirmParams.PaymentMethodData.P24(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentConfirmParams.PaymentMethodData.P24.Bank bank) { this.bank = bank; return this; } @@ -3686,8 +3718,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Paynow build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Paynow(this.extraParams); } /** @@ -3743,8 +3775,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pix build() { - return new Pix(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Pix build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Pix(this.extraParams); } /** @@ -3800,8 +3832,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Promptpay build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Promptpay(this.extraParams); } /** @@ -3868,8 +3900,9 @@ public static class Builder { private String session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public PaymentIntentConfirmParams.PaymentMethodData.RadarOptions build() { + return new PaymentIntentConfirmParams.PaymentMethodData.RadarOptions( + this.extraParams, this.session); } /** @@ -3942,8 +3975,9 @@ public static class Builder { private String iban; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.iban); + public PaymentIntentConfirmParams.PaymentMethodData.SepaDebit build() { + return new PaymentIntentConfirmParams.PaymentMethodData.SepaDebit( + this.extraParams, this.iban); } /** @@ -4012,12 +4046,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.country, this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.Sofort build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Sofort( + this.country, this.extraParams); } /** Two-letter ISO code representing the country the bank account is located in. */ - public Builder setCountry(Country country) { + public Builder setCountry( + PaymentIntentConfirmParams.PaymentMethodData.Sofort.Country country) { this.country = country; return this; } @@ -4143,8 +4179,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public PaymentIntentConfirmParams.PaymentMethodData.UsBankAccount build() { + return new PaymentIntentConfirmParams.PaymentMethodData.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -4154,7 +4190,9 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + PaymentIntentConfirmParams.PaymentMethodData.UsBankAccount.AccountHolderType + accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -4166,7 +4204,8 @@ public Builder setAccountNumber(String accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + PaymentIntentConfirmParams.PaymentMethodData.UsBankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -4266,8 +4305,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodData.WechatPay build() { + return new PaymentIntentConfirmParams.PaymentMethodData.WechatPay(this.extraParams); } /** @@ -4742,8 +4781,8 @@ public static class Builder { private Object wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public PaymentIntentConfirmParams.PaymentMethodOptions build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -4781,7 +4820,8 @@ public PaymentMethodOptions build() { * If this is a {@code acss_debit} PaymentMethod, this sub-hash contains details about the * ACSS Debit payment method options. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -4799,7 +4839,7 @@ public Builder setAcssDebit(EmptyParam acssDebit) { * If this is an {@code affirm} PaymentMethod, this sub-hash contains details about the Affirm * payment method options. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(PaymentIntentConfirmParams.PaymentMethodOptions.Affirm affirm) { this.affirm = affirm; return this; } @@ -4817,7 +4857,8 @@ public Builder setAffirm(EmptyParam affirm) { * If this is a {@code afterpay_clearpay} PaymentMethod, this sub-hash contains details about * the Afterpay Clearpay payment method options. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + PaymentIntentConfirmParams.PaymentMethodOptions.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -4835,7 +4876,7 @@ public Builder setAfterpayClearpay(EmptyParam afterpayClearpay) { * If this is a {@code alipay} PaymentMethod, this sub-hash contains details about the Alipay * payment method options. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(PaymentIntentConfirmParams.PaymentMethodOptions.Alipay alipay) { this.alipay = alipay; return this; } @@ -4853,7 +4894,8 @@ public Builder setAlipay(EmptyParam alipay) { * If this is a {@code au_becs_debit} PaymentMethod, this sub-hash contains details about the * AU BECS Direct Debit payment method options. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + PaymentIntentConfirmParams.PaymentMethodOptions.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -4871,7 +4913,8 @@ public Builder setAuBecsDebit(EmptyParam auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this sub-hash contains details about the * BACS Debit payment method options. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit( + PaymentIntentConfirmParams.PaymentMethodOptions.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -4889,7 +4932,8 @@ public Builder setBacsDebit(EmptyParam bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the * Bancontact payment method options. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + PaymentIntentConfirmParams.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -4907,7 +4951,7 @@ public Builder setBancontact(EmptyParam bancontact) { * If this is a {@code blik} PaymentMethod, this sub-hash contains details about the BLIK * payment method options. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(PaymentIntentConfirmParams.PaymentMethodOptions.Blik blik) { this.blik = blik; return this; } @@ -4925,7 +4969,7 @@ public Builder setBlik(EmptyParam blik) { * If this is a {@code boleto} PaymentMethod, this sub-hash contains details about the Boleto * payment method options. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(PaymentIntentConfirmParams.PaymentMethodOptions.Boleto boleto) { this.boleto = boleto; return this; } @@ -4940,7 +4984,7 @@ public Builder setBoleto(EmptyParam boleto) { } /** Configuration for any card payments attempted on this PaymentIntent. */ - public Builder setCard(Card card) { + public Builder setCard(PaymentIntentConfirmParams.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -4955,7 +4999,8 @@ public Builder setCard(EmptyParam card) { * If this is a {@code card_present} PaymentMethod, this sub-hash contains details about the * Card Present payment method options. */ - public Builder setCardPresent(CardPresent cardPresent) { + public Builder setCardPresent( + PaymentIntentConfirmParams.PaymentMethodOptions.CardPresent cardPresent) { this.cardPresent = cardPresent; return this; } @@ -4973,7 +5018,8 @@ public Builder setCardPresent(EmptyParam cardPresent) { * If this is a {@code customer balance} PaymentMethod, this sub-hash contains details about * the customer balance payment method options. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -4991,7 +5037,7 @@ public Builder setCustomerBalance(EmptyParam customerBalance) { * If this is a {@code eps} PaymentMethod, this sub-hash contains details about the EPS * payment method options. */ - public Builder setEps(Eps eps) { + public Builder setEps(PaymentIntentConfirmParams.PaymentMethodOptions.Eps eps) { this.eps = eps; return this; } @@ -5036,7 +5082,7 @@ public Builder putAllExtraParam(Map map) { * If this is a {@code fpx} PaymentMethod, this sub-hash contains details about the FPX * payment method options. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(PaymentIntentConfirmParams.PaymentMethodOptions.Fpx fpx) { this.fpx = fpx; return this; } @@ -5054,7 +5100,7 @@ public Builder setFpx(EmptyParam fpx) { * If this is a {@code giropay} PaymentMethod, this sub-hash contains details about the * Giropay payment method options. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(PaymentIntentConfirmParams.PaymentMethodOptions.Giropay giropay) { this.giropay = giropay; return this; } @@ -5072,7 +5118,7 @@ public Builder setGiropay(EmptyParam giropay) { * If this is a {@code grabpay} PaymentMethod, this sub-hash contains details about the * Grabpay payment method options. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(PaymentIntentConfirmParams.PaymentMethodOptions.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -5090,7 +5136,7 @@ public Builder setGrabpay(EmptyParam grabpay) { * If this is a {@code ideal} PaymentMethod, this sub-hash contains details about the Ideal * payment method options. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(PaymentIntentConfirmParams.PaymentMethodOptions.Ideal ideal) { this.ideal = ideal; return this; } @@ -5108,7 +5154,8 @@ public Builder setIdeal(EmptyParam ideal) { * If this is a {@code interac_present} PaymentMethod, this sub-hash contains details about * the Card Present payment method options. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + PaymentIntentConfirmParams.PaymentMethodOptions.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -5126,7 +5173,7 @@ public Builder setInteracPresent(EmptyParam interacPresent) { * If this is a {@code klarna} PaymentMethod, this sub-hash contains details about the Klarna * payment method options. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(PaymentIntentConfirmParams.PaymentMethodOptions.Klarna klarna) { this.klarna = klarna; return this; } @@ -5144,7 +5191,7 @@ public Builder setKlarna(EmptyParam klarna) { * If this is a {@code konbini} PaymentMethod, this sub-hash contains details about the * Konbini payment method options. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(PaymentIntentConfirmParams.PaymentMethodOptions.Konbini konbini) { this.konbini = konbini; return this; } @@ -5162,7 +5209,7 @@ public Builder setKonbini(EmptyParam konbini) { * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. */ - public Builder setLink(Link link) { + public Builder setLink(PaymentIntentConfirmParams.PaymentMethodOptions.Link link) { this.link = link; return this; } @@ -5180,7 +5227,7 @@ public Builder setLink(EmptyParam link) { * If this is a {@code oxxo} PaymentMethod, this sub-hash contains details about the OXXO * payment method options. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(PaymentIntentConfirmParams.PaymentMethodOptions.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -5198,7 +5245,7 @@ public Builder setOxxo(EmptyParam oxxo) { * If this is a {@code p24} PaymentMethod, this sub-hash contains details about the Przelewy24 * payment method options. */ - public Builder setP24(P24 p24) { + public Builder setP24(PaymentIntentConfirmParams.PaymentMethodOptions.P24 p24) { this.p24 = p24; return this; } @@ -5216,7 +5263,7 @@ public Builder setP24(EmptyParam p24) { * If this is a {@code paynow} PaymentMethod, this sub-hash contains details about the PayNow * payment method options. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(PaymentIntentConfirmParams.PaymentMethodOptions.Paynow paynow) { this.paynow = paynow; return this; } @@ -5234,7 +5281,7 @@ public Builder setPaynow(EmptyParam paynow) { * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix * payment method options. */ - public Builder setPix(Pix pix) { + public Builder setPix(PaymentIntentConfirmParams.PaymentMethodOptions.Pix pix) { this.pix = pix; return this; } @@ -5252,7 +5299,8 @@ public Builder setPix(EmptyParam pix) { * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay( + PaymentIntentConfirmParams.PaymentMethodOptions.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -5270,7 +5318,8 @@ public Builder setPromptpay(EmptyParam promptpay) { * If this is a {@code sepa_debit} PaymentIntent, this sub-hash contains details about the * SEPA Debit payment method options. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + PaymentIntentConfirmParams.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -5288,7 +5337,7 @@ public Builder setSepaDebit(EmptyParam sepaDebit) { * If this is a {@code sofort} PaymentMethod, this sub-hash contains details about the SOFORT * payment method options. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(PaymentIntentConfirmParams.PaymentMethodOptions.Sofort sofort) { this.sofort = sofort; return this; } @@ -5306,7 +5355,8 @@ public Builder setSofort(EmptyParam sofort) { * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about * the US bank account payment method options. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -5324,7 +5374,8 @@ public Builder setUsBankAccount(EmptyParam usBankAccount) { * If this is a {@code wechat_pay} PaymentMethod, this sub-hash contains details about the * WeChat Pay payment method options. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay( + PaymentIntentConfirmParams.PaymentMethodOptions.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -5374,7 +5425,7 @@ public static class AcssDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -5383,7 +5434,7 @@ public static class AcssDebit { private AcssDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; @@ -5400,13 +5451,13 @@ public static class Builder { private MandateOptions mandateOptions; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit( this.extraParams, this.mandateOptions, this.setupFutureUsage, @@ -5442,7 +5493,9 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5467,7 +5520,9 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5498,7 +5553,9 @@ public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -5569,8 +5626,8 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions( this.customMandateUrl, this.extraParams, this.intervalDescription, @@ -5640,13 +5697,19 @@ public Builder setIntervalDescription(String intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions + .PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions + .TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -5735,7 +5798,7 @@ public static class Affirm { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -5769,7 +5832,7 @@ public static class Affirm { SetupFutureUsage setupFutureUsage; private Affirm( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, SetupFutureUsage setupFutureUsage) { this.captureMethod = captureMethod; @@ -5782,15 +5845,16 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.captureMethod, this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Affirm build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Affirm( + this.captureMethod, this.extraParams, this.setupFutureUsage); } /** @@ -5802,7 +5866,8 @@ public Affirm build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentConfirmParams.PaymentMethodOptions.Affirm.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -5869,7 +5934,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Affirm.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5912,7 +5979,7 @@ public static class AfterpayClearpay { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -5955,7 +6022,7 @@ public static class AfterpayClearpay { SetupFutureUsage setupFutureUsage; private AfterpayClearpay( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, String reference, SetupFutureUsage setupFutureUsage) { @@ -5970,7 +6037,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -5979,8 +6046,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay( + public PaymentIntentConfirmParams.PaymentMethodOptions.AfterpayClearpay build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.AfterpayClearpay( this.captureMethod, this.extraParams, this.reference, this.setupFutureUsage); } @@ -5993,7 +6060,9 @@ public AfterpayClearpay build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentConfirmParams.PaymentMethodOptions.AfterpayClearpay.CaptureMethod + captureMethod) { this.captureMethod = captureMethod; return this; } @@ -6073,7 +6142,9 @@ public Builder setReference(String reference) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.AfterpayClearpay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6135,9 +6206,9 @@ public static class Alipay { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private Alipay(Map extraParams, EnumParam setupFutureUsage) { + private Alipay(Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -6149,11 +6220,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Alipay build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Alipay( + this.extraParams, this.setupFutureUsage); } /** @@ -6204,7 +6276,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Alipay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6282,9 +6356,10 @@ public static class AuBecsDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private AuBecsDebit(Map extraParams, EnumParam setupFutureUsage) { + private AuBecsDebit( + Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -6296,11 +6371,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.AuBecsDebit build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.AuBecsDebit( + this.extraParams, this.setupFutureUsage); } /** @@ -6351,7 +6427,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.AuBecsDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6432,9 +6510,10 @@ public static class BacsDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private BacsDebit(Map extraParams, EnumParam setupFutureUsage) { + private BacsDebit( + Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -6446,11 +6525,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.BacsDebit build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.BacsDebit( + this.extraParams, this.setupFutureUsage); } /** @@ -6501,7 +6581,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.BacsDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6588,12 +6670,12 @@ public static class Bancontact { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Bancontact( Map extraParams, PreferredLanguage preferredLanguage, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.preferredLanguage = preferredLanguage; this.setupFutureUsage = setupFutureUsage; @@ -6608,11 +6690,12 @@ public static class Builder { private PreferredLanguage preferredLanguage; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams, this.preferredLanguage, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Bancontact build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Bancontact( + this.extraParams, this.preferredLanguage, this.setupFutureUsage); } /** @@ -6647,7 +6730,9 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Bancontact authorization page that the customer is redirected * to. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + PaymentIntentConfirmParams.PaymentMethodOptions.Bancontact.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -6672,7 +6757,9 @@ public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Bancontact.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6773,8 +6860,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.code, this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodOptions.Blik build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Blik( + this.code, this.extraParams); } /** @@ -6855,10 +6943,12 @@ public static class Boleto { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Boleto( - Long expiresAfterDays, Map extraParams, EnumParam setupFutureUsage) { + Long expiresAfterDays, + Map extraParams, + ApiRequestParams.EnumParam setupFutureUsage) { this.expiresAfterDays = expiresAfterDays; this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; @@ -6873,11 +6963,12 @@ public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.expiresAfterDays, this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Boleto build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Boleto( + this.expiresAfterDays, this.extraParams, this.setupFutureUsage); } /** @@ -6938,7 +7029,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Boleto.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7000,7 +7093,7 @@ public static class Card { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * A single-use {@code cvc_update} Token that represents a card CVC value. When provided, the @@ -7081,7 +7174,7 @@ public static class Card { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** * Provides information about a card payment that customers see on their statements. @@ -7104,7 +7197,7 @@ public static class Card { Object statementDescriptorSuffixKanji; private Card( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, String cvcToken, Map extraParams, Installments installments, @@ -7112,7 +7205,7 @@ private Card( Boolean moto, Network network, RequestThreeDSecure requestThreeDSecure, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, Object statementDescriptorSuffixKana, Object statementDescriptorSuffixKanji) { this.captureMethod = captureMethod; @@ -7133,7 +7226,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private String cvcToken; @@ -7149,15 +7242,15 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private Object statementDescriptorSuffixKana; private Object statementDescriptorSuffixKanji; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public PaymentIntentConfirmParams.PaymentMethodOptions.Card build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Card( this.captureMethod, this.cvcToken, this.extraParams, @@ -7180,7 +7273,8 @@ public Card build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -7243,13 +7337,15 @@ public Builder putAllExtraParam(Map map) { *

For more information, see the installments integration guide. */ - public Builder setInstallments(Installments installments) { + public Builder setInstallments( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments installments) { this.installments = installments; return this; } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -7268,7 +7364,8 @@ public Builder setMoto(Boolean moto) { * Selected network to process this PaymentIntent on. Depends on the available networks of * the card attached to the PaymentIntent. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -7284,7 +7381,9 @@ public Builder setNetwork(Network network) { * Secure for more information on how this configuration interacts with Radar and our * SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -7309,7 +7408,9 @@ public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7434,8 +7535,9 @@ public static class Builder { private Object plan; /** Finalize and obtain parameter instance from this builder. */ - public Installments build() { - return new Installments(this.enabled, this.extraParams, this.plan); + public PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments( + this.enabled, this.extraParams, this.plan); } /** @@ -7482,7 +7584,8 @@ public Builder putAllExtraParam(Map map) { * The selected installment plan to use for this payment attempt. This parameter can only * be provided during confirmation. */ - public Builder setPlan(Plan plan) { + public Builder setPlan( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments.Plan plan) { this.plan = plan; return this; } @@ -7548,8 +7651,9 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Plan build() { - return new Plan(this.count, this.extraParams, this.interval, this.type); + public PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments.Plan build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments.Plan( + this.count, this.extraParams, this.interval, this.type); } /** @@ -7595,13 +7699,16 @@ public Builder putAllExtraParam(Map map) { * For {@code fixed_count} installment plans, this is the interval between installment * payments your customer will make to their credit card. One of {@code month}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments.Plan.Interval + interval) { this.interval = interval; return this; } /** Type of installment plan, one of {@code fixed_count}. */ - public Builder setType(Type type) { + public Builder setType( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments.Plan.Type type) { this.type = type; return this; } @@ -7700,7 +7807,8 @@ public static class MandateOptions { /** Specifies the type of mandates supported. Possible values are {@code india}. */ @SerializedName("supported_types") - List supportedTypes; + List + supportedTypes; private MandateOptions( Long amount, @@ -7712,7 +7820,8 @@ private MandateOptions( Long intervalCount, String reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.description = description; @@ -7748,11 +7857,13 @@ public static class Builder { private Long startDate; - private List supportedTypes; + private List< + PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.SupportedType> + supportedTypes; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions( this.amount, this.amountType, this.description, @@ -7776,7 +7887,9 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.AmountType + amountType) { this.amountType = amountType; return this; } @@ -7833,7 +7946,9 @@ public Builder putAllExtraParam(Map map) { * Specifies payment frequency. One of {@code day}, {@code week}, {@code month}, {@code * year}, or {@code sporadic}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.Interval + interval) { this.interval = interval; return this; } @@ -7871,7 +7986,9 @@ public Builder setStartDate(Long startDate) { * PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addSupportedType(SupportedType element) { + public Builder addSupportedType( + PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.SupportedType + element) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -7886,7 +8003,11 @@ public Builder addSupportedType(SupportedType element) { * PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addAllSupportedType(List elements) { + public Builder addAllSupportedType( + List< + PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions + .SupportedType> + elements) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -8083,8 +8204,8 @@ public static class Builder { private Boolean requestIncrementalAuthorizationSupport; /** Finalize and obtain parameter instance from this builder. */ - public CardPresent build() { - return new CardPresent( + public PaymentIntentConfirmParams.PaymentMethodOptions.CardPresent build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.CardPresent( this.extraParams, this.requestExtendedAuthorization, this.requestIncrementalAuthorizationSupport); @@ -8216,8 +8337,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance( + public PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance( this.bankTransfer, this.extraParams, this.fundingType, this.setupFutureUsage); } @@ -8225,7 +8346,9 @@ public CustomerBalance build() { * Configuration for the bank transfer funding type, if the {@code funding_type} is set to * {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer + bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -8264,7 +8387,9 @@ public Builder putAllExtraParam(Map map) { * The funding method type to be used when there are not enough funds in the customer * balance. Permitted values include: {@code bank_transfer}. */ - public Builder setFundingType(FundingType fundingType) { + public Builder setFundingType( + PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.FundingType + fundingType) { this.fundingType = fundingType; return this; } @@ -8289,7 +8414,9 @@ public Builder setFundingType(FundingType fundingType) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -8318,7 +8445,10 @@ public static class BankTransfer { * spei}. */ @SerializedName("requested_address_types") - List requestedAddressTypes; + List< + PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes; /** * The list of bank transfer types that this PaymentIntent is allowed to use for funding @@ -8331,7 +8461,10 @@ public static class BankTransfer { private BankTransfer( EuBankTransfer euBankTransfer, Map extraParams, - List requestedAddressTypes, + List< + PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes, Type type) { this.euBankTransfer = euBankTransfer; this.extraParams = extraParams; @@ -8348,17 +8481,24 @@ public static class Builder { private Map extraParams; - private List requestedAddressTypes; + private List< + PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes; private Type type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer( + public PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer + build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer( this.euBankTransfer, this.extraParams, this.requestedAddressTypes, this.type); } - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -8400,7 +8540,10 @@ public Builder putAllExtraParam(Map map) { * PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addRequestedAddressType(RequestedAddressType element) { + public Builder addRequestedAddressType( + PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType + element) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -8415,7 +8558,11 @@ public Builder addRequestedAddressType(RequestedAddressType element) { * PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addAllRequestedAddressType(List elements) { + public Builder addAllRequestedAddressType( + List< + PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + elements) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -8428,7 +8575,9 @@ public Builder addAllRequestedAddressType(List elements) { * Permitted values include: {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code * jp_bank_transfer}, or {@code mx_bank_transfer}. */ - public Builder setType(Type type) { + public Builder setType( + PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer.Type + type) { this.type = type; return this; } @@ -8468,8 +8617,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer + build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer(this.country, this.extraParams); } /** @@ -8632,8 +8784,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Eps build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Eps( + this.extraParams, this.setupFutureUsage); } /** @@ -8684,7 +8837,8 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Eps.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -8751,8 +8905,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Fpx build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Fpx( + this.extraParams, this.setupFutureUsage); } /** @@ -8803,7 +8958,8 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Fpx.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -8870,8 +9026,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Giropay build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Giropay( + this.extraParams, this.setupFutureUsage); } /** @@ -8922,7 +9079,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Giropay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -8989,8 +9148,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Grabpay build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Grabpay( + this.extraParams, this.setupFutureUsage); } /** @@ -9041,7 +9201,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Grabpay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9091,9 +9253,9 @@ public static class Ideal { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private Ideal(Map extraParams, EnumParam setupFutureUsage) { + private Ideal(Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -9105,11 +9267,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Ideal build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Ideal( + this.extraParams, this.setupFutureUsage); } /** @@ -9160,7 +9323,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Ideal.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9230,8 +9395,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodOptions.InteracPresent build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.InteracPresent( + this.extraParams); } /** @@ -9278,7 +9444,7 @@ public static class Klarna { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -9316,7 +9482,7 @@ public static class Klarna { SetupFutureUsage setupFutureUsage; private Klarna( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, PreferredLocale preferredLocale, SetupFutureUsage setupFutureUsage) { @@ -9331,7 +9497,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -9340,8 +9506,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna( + public PaymentIntentConfirmParams.PaymentMethodOptions.Klarna build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Klarna( this.captureMethod, this.extraParams, this.preferredLocale, this.setupFutureUsage); } @@ -9354,7 +9520,8 @@ public Klarna build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -9404,7 +9571,9 @@ public Builder putAllExtraParam(Map map) { /** * Preferred language of the Klarna authorization page that the customer is redirected to. */ - public Builder setPreferredLocale(PreferredLocale preferredLocale) { + public Builder setPreferredLocale( + PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.PreferredLocale + preferredLocale) { this.preferredLocale = preferredLocale; return this; } @@ -9429,7 +9598,9 @@ public Builder setPreferredLocale(PreferredLocale preferredLocale) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9686,8 +9857,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini( + public PaymentIntentConfirmParams.PaymentMethodOptions.Konbini build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Konbini( this.confirmationNumber, this.expiresAfterDays, this.expiresAt, @@ -9803,7 +9974,9 @@ public Builder setProductDescription(String productDescription) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Konbini.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9834,7 +10007,7 @@ public static class Link { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -9869,13 +10042,13 @@ public static class Link { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Link( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, String persistentToken, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.captureMethod = captureMethod; this.extraParams = extraParams; this.persistentToken = persistentToken; @@ -9887,17 +10060,17 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; private String persistentToken; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link( + public PaymentIntentConfirmParams.PaymentMethodOptions.Link build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Link( this.captureMethod, this.extraParams, this.persistentToken, this.setupFutureUsage); } @@ -9910,7 +10083,8 @@ public Link build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentConfirmParams.PaymentMethodOptions.Link.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -9983,7 +10157,9 @@ public Builder setPersistentToken(String persistentToken) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Link.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10104,8 +10280,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.expiresAfterDays, this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Oxxo build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Oxxo( + this.expiresAfterDays, this.extraParams, this.setupFutureUsage); } /** @@ -10166,7 +10343,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Oxxo.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10243,8 +10422,9 @@ public static class Builder { private Boolean tosShownAndAccepted; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); + public PaymentIntentConfirmParams.PaymentMethodOptions.P24 build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.P24( + this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); } /** @@ -10295,7 +10475,8 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.P24.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10368,8 +10549,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Paynow build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Paynow( + this.extraParams, this.setupFutureUsage); } /** @@ -10420,7 +10602,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Paynow.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10482,8 +10666,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pix build() { - return new Pix(this.expiresAfterSeconds, this.expiresAt, this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodOptions.Pix build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Pix( + this.expiresAfterSeconds, this.expiresAt, this.extraParams); } /** @@ -10582,8 +10767,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Promptpay build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Promptpay( + this.extraParams, this.setupFutureUsage); } /** @@ -10634,7 +10820,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Promptpay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10688,12 +10876,12 @@ public static class SepaDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private SepaDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; this.setupFutureUsage = setupFutureUsage; @@ -10708,11 +10896,12 @@ public static class Builder { private MandateOptions mandateOptions; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.mandateOptions, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.SepaDebit build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.SepaDebit( + this.extraParams, this.mandateOptions, this.setupFutureUsage); } /** @@ -10744,7 +10933,9 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + PaymentIntentConfirmParams.PaymentMethodOptions.SepaDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -10769,7 +10960,9 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.SepaDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10824,8 +11017,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams); + public PaymentIntentConfirmParams.PaymentMethodOptions.SepaDebit.MandateOptions build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.SepaDebit.MandateOptions( + this.extraParams); } /** @@ -10892,7 +11086,7 @@ public static class Sofort { /** Language shown to the payer on redirect. */ @SerializedName("preferred_language") - EnumParam preferredLanguage; + ApiRequestParams.EnumParam preferredLanguage; /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -10914,12 +11108,12 @@ public static class Sofort { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Sofort( Map extraParams, - EnumParam preferredLanguage, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam preferredLanguage, + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.preferredLanguage = preferredLanguage; this.setupFutureUsage = setupFutureUsage; @@ -10932,13 +11126,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam preferredLanguage; + private ApiRequestParams.EnumParam preferredLanguage; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.extraParams, this.preferredLanguage, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.Sofort build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Sofort( + this.extraParams, this.preferredLanguage, this.setupFutureUsage); } /** @@ -10970,7 +11165,9 @@ public Builder putAllExtraParam(Map map) { } /** Language shown to the payer on redirect. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + PaymentIntentConfirmParams.PaymentMethodOptions.Sofort.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -11001,7 +11198,9 @@ public Builder setPreferredLanguage(EmptyParam preferredLanguage) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Sofort.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -11117,7 +11316,7 @@ public static class UsBankAccount { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -11127,7 +11326,7 @@ private UsBankAccount( Map extraParams, FinancialConnections financialConnections, Networks networks, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.financialConnections = financialConnections; @@ -11147,13 +11346,13 @@ public static class Builder { private Networks networks; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.networks, @@ -11192,13 +11391,16 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Additional fields for network related functions. */ - public Builder setNetworks(Networks networks) { + public Builder setNetworks( + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks networks) { this.networks = networks; return this; } @@ -11223,7 +11425,9 @@ public Builder setNetworks(Networks networks) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -11254,7 +11458,9 @@ public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -11278,7 +11484,10 @@ public static class FinancialConnections { * {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; /** * For webview integrations only. Upon completing OAuth login in the native browser, the @@ -11288,7 +11497,12 @@ public static class FinancialConnections { String returnUrl; private FinancialConnections( - Map extraParams, List permissions, String returnUrl) { + Map extraParams, + List< + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions, + String returnUrl) { this.extraParams = extraParams; this.permissions = permissions; this.returnUrl = returnUrl; @@ -11301,13 +11515,18 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; private String returnUrl; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions, this.returnUrl); + public PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions, this.returnUrl); } /** @@ -11346,7 +11565,10 @@ public Builder putAllExtraParam(Map map) { * PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -11361,7 +11583,11 @@ public Builder addPermission(Permission element) { * PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -11415,9 +11641,13 @@ public static class Networks { /** Triggers validations to run across the selected networks. */ @SerializedName("requested") - List requested; + List + requested; - private Networks(Map extraParams, List requested) { + private Networks( + Map extraParams, + List + requested) { this.extraParams = extraParams; this.requested = requested; } @@ -11429,11 +11659,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List requested; + private List< + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks.Requested> + requested; /** Finalize and obtain parameter instance from this builder. */ - public Networks build() { - return new Networks(this.extraParams, this.requested); + public PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks( + this.extraParams, this.requested); } /** @@ -11472,7 +11705,9 @@ public Builder putAllExtraParam(Map map) { * PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for * the field documentation. */ - public Builder addRequested(Requested element) { + public Builder addRequested( + PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks.Requested + element) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -11486,7 +11721,9 @@ public Builder addRequested(Requested element) { * PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for * the field documentation. */ - public Builder addAllRequested(List elements) { + public Builder addAllRequested( + List + elements) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -11614,8 +11851,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.appId, this.client, this.extraParams, this.setupFutureUsage); + public PaymentIntentConfirmParams.PaymentMethodOptions.WechatPay build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.WechatPay( + this.appId, this.client, this.extraParams, this.setupFutureUsage); } /** The app ID registered with WeChat Pay. Only required when client is ios or android. */ @@ -11625,7 +11863,8 @@ public Builder setAppId(String appId) { } /** The client type that the end customer will pay from. */ - public Builder setClient(Client client) { + public Builder setClient( + PaymentIntentConfirmParams.PaymentMethodOptions.WechatPay.Client client) { this.client = client; return this; } @@ -11678,7 +11917,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.WechatPay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -11750,8 +11991,8 @@ public static class Builder { private String session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public PaymentIntentConfirmParams.RadarOptions build() { + return new PaymentIntentConfirmParams.RadarOptions(this.extraParams, this.session); } /** @@ -11860,8 +12101,8 @@ public static class Builder { private String trackingNumber; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping( + public PaymentIntentConfirmParams.Shipping build() { + return new PaymentIntentConfirmParams.Shipping( this.address, this.carrier, this.extraParams, @@ -11871,7 +12112,7 @@ public Shipping build() { } /** Shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(PaymentIntentConfirmParams.Shipping.Address address) { this.address = address; return this; } @@ -12005,8 +12246,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public PaymentIntentConfirmParams.Shipping.Address build() { + return new PaymentIntentConfirmParams.Shipping.Address( this.city, this.country, this.extraParams, diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index f3dbba2257e..450b51ca88a 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -471,13 +470,14 @@ public Builder setApplicationFeeAmount(Long applicationFeeAmount) { * When enabled, this PaymentIntent will accept payment methods that you have enabled in the * Dashboard and are compatible with this PaymentIntent's other parameters. */ - public Builder setAutomaticPaymentMethods(AutomaticPaymentMethods automaticPaymentMethods) { + public Builder setAutomaticPaymentMethods( + PaymentIntentCreateParams.AutomaticPaymentMethods automaticPaymentMethods) { this.automaticPaymentMethods = automaticPaymentMethods; return this; } /** Controls when the funds will be captured from the customer's account. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod(PaymentIntentCreateParams.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -495,7 +495,8 @@ public Builder setConfirm(Boolean confirm) { return this; } - public Builder setConfirmationMethod(ConfirmationMethod confirmationMethod) { + public Builder setConfirmationMethod( + PaymentIntentCreateParams.ConfirmationMethod confirmationMethod) { this.confirmationMethod = confirmationMethod; return this; } @@ -613,7 +614,7 @@ public Builder setMandate(String mandate) { * href="https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm">{@code * confirm=true}. */ - public Builder setMandateData(MandateData mandateData) { + public Builder setMandateData(PaymentIntentCreateParams.MandateData mandateData) { this.mandateData = mandateData; return this; } @@ -667,7 +668,7 @@ public Builder setOffSession(Boolean offSession) { * href="https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm">{@code * confirm=true}. */ - public Builder setOffSession(OffSession offSession) { + public Builder setOffSession(PaymentIntentCreateParams.OffSession offSession) { this.offSession = offSession; return this; } @@ -703,13 +704,15 @@ public Builder setPaymentMethod(String paymentMethod) { * href="https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method">payment_method * property on the PaymentIntent. */ - public Builder setPaymentMethodData(PaymentMethodData paymentMethodData) { + public Builder setPaymentMethodData( + PaymentIntentCreateParams.PaymentMethodData paymentMethodData) { this.paymentMethodData = paymentMethodData; return this; } /** Payment-method-specific configuration for this PaymentIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + PaymentIntentCreateParams.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -744,7 +747,7 @@ public Builder addAllPaymentMethodType(List elements) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions(PaymentIntentCreateParams.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -785,13 +788,14 @@ public Builder setReturnUrl(String returnUrl) { * optimize your payment flow and comply with regional legislation and network rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } /** Shipping information for this PaymentIntent. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(PaymentIntentCreateParams.Shipping shipping) { this.shipping = shipping; return this; } @@ -822,7 +826,7 @@ public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) { * href="https://stripe.com/docs/payments/connected-accounts">use case for connected * accounts. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(PaymentIntentCreateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -877,8 +881,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticPaymentMethods build() { - return new AutomaticPaymentMethods(this.enabled, this.extraParams); + public PaymentIntentCreateParams.AutomaticPaymentMethods build() { + return new PaymentIntentCreateParams.AutomaticPaymentMethods( + this.enabled, this.extraParams); } /** Whether this feature is enabled. */ @@ -946,12 +951,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateData build() { - return new MandateData(this.customerAcceptance, this.extraParams); + public PaymentIntentCreateParams.MandateData build() { + return new PaymentIntentCreateParams.MandateData(this.customerAcceptance, this.extraParams); } /** This hash contains details about the customer acceptance of the Mandate. */ - public Builder setCustomerAcceptance(CustomerAcceptance customerAcceptance) { + public Builder setCustomerAcceptance( + PaymentIntentCreateParams.MandateData.CustomerAcceptance customerAcceptance) { this.customerAcceptance = customerAcceptance; return this; } @@ -1048,8 +1054,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public CustomerAcceptance build() { - return new CustomerAcceptance( + public PaymentIntentCreateParams.MandateData.CustomerAcceptance build() { + return new PaymentIntentCreateParams.MandateData.CustomerAcceptance( this.acceptedAt, this.extraParams, this.offline, this.online, this.type); } @@ -1091,7 +1097,8 @@ public Builder putAllExtraParam(Map map) { * If this is a Mandate accepted offline, this hash contains details about the offline * acceptance. */ - public Builder setOffline(Offline offline) { + public Builder setOffline( + PaymentIntentCreateParams.MandateData.CustomerAcceptance.Offline offline) { this.offline = offline; return this; } @@ -1100,7 +1107,8 @@ public Builder setOffline(Offline offline) { * If this is a Mandate accepted online, this hash contains details about the online * acceptance. */ - public Builder setOnline(Online online) { + public Builder setOnline( + PaymentIntentCreateParams.MandateData.CustomerAcceptance.Online online) { this.online = online; return this; } @@ -1109,7 +1117,7 @@ public Builder setOnline(Online online) { * The type of customer acceptance information included with the Mandate. One of {@code * online} or {@code offline}. */ - public Builder setType(Type type) { + public Builder setType(PaymentIntentCreateParams.MandateData.CustomerAcceptance.Type type) { this.type = type; return this; } @@ -1139,8 +1147,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Offline build() { - return new Offline(this.extraParams); + public PaymentIntentCreateParams.MandateData.CustomerAcceptance.Offline build() { + return new PaymentIntentCreateParams.MandateData.CustomerAcceptance.Offline( + this.extraParams); } /** @@ -1213,8 +1222,9 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public Online build() { - return new Online(this.extraParams, this.ipAddress, this.userAgent); + public PaymentIntentCreateParams.MandateData.CustomerAcceptance.Online build() { + return new PaymentIntentCreateParams.MandateData.CustomerAcceptance.Online( + this.extraParams, this.ipAddress, this.userAgent); } /** @@ -1657,8 +1667,8 @@ public static class Builder { private WechatPay wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodData build() { - return new PaymentMethodData( + public PaymentIntentCreateParams.PaymentMethodData build() { + return new PaymentIntentCreateParams.PaymentMethodData( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -1698,7 +1708,7 @@ public PaymentMethodData build() { * If this is an {@code acss_debit} PaymentMethod, this hash contains details about the ACSS * Debit payment method. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(PaymentIntentCreateParams.PaymentMethodData.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -1707,7 +1717,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is an {@code affirm} PaymentMethod, this hash contains details about the Affirm * payment method. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(PaymentIntentCreateParams.PaymentMethodData.Affirm affirm) { this.affirm = affirm; return this; } @@ -1716,7 +1726,8 @@ public Builder setAffirm(Affirm affirm) { * If this is an {@code AfterpayClearpay} PaymentMethod, this hash contains details about the * AfterpayClearpay payment method. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + PaymentIntentCreateParams.PaymentMethodData.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -1725,7 +1736,7 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If this is an {@code Alipay} PaymentMethod, this hash contains details about the Alipay * payment method. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(PaymentIntentCreateParams.PaymentMethodData.Alipay alipay) { this.alipay = alipay; return this; } @@ -1734,7 +1745,8 @@ public Builder setAlipay(Alipay alipay) { * If this is an {@code au_becs_debit} PaymentMethod, this hash contains details about the * bank account. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + PaymentIntentCreateParams.PaymentMethodData.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -1743,7 +1755,7 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs * Direct Debit bank account. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(PaymentIntentCreateParams.PaymentMethodData.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -1752,7 +1764,8 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this hash contains details about the * Bancontact payment method. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + PaymentIntentCreateParams.PaymentMethodData.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -1761,7 +1774,8 @@ public Builder setBancontact(Bancontact bancontact) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails( + PaymentIntentCreateParams.PaymentMethodData.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -1770,7 +1784,7 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(PaymentIntentCreateParams.PaymentMethodData.Blik blik) { this.blik = blik; return this; } @@ -1779,7 +1793,7 @@ public Builder setBlik(Blik blik) { * If this is a {@code boleto} PaymentMethod, this hash contains details about the Boleto * payment method. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(PaymentIntentCreateParams.PaymentMethodData.Boleto boleto) { this.boleto = boleto; return this; } @@ -1788,7 +1802,8 @@ public Builder setBoleto(Boleto boleto) { * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + PaymentIntentCreateParams.PaymentMethodData.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -1797,7 +1812,7 @@ public Builder setCustomerBalance(CustomerBalance customerBalance) { * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment * method. */ - public Builder setEps(Eps eps) { + public Builder setEps(PaymentIntentCreateParams.PaymentMethodData.Eps eps) { this.eps = eps; return this; } @@ -1833,7 +1848,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code fpx} PaymentMethod, this hash contains details about the FPX payment * method. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(PaymentIntentCreateParams.PaymentMethodData.Fpx fpx) { this.fpx = fpx; return this; } @@ -1842,7 +1857,7 @@ public Builder setFpx(Fpx fpx) { * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(PaymentIntentCreateParams.PaymentMethodData.Giropay giropay) { this.giropay = giropay; return this; } @@ -1851,7 +1866,7 @@ public Builder setGiropay(Giropay giropay) { * If this is a {@code grabpay} PaymentMethod, this hash contains details about the GrabPay * payment method. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(PaymentIntentCreateParams.PaymentMethodData.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -1860,7 +1875,7 @@ public Builder setGrabpay(Grabpay grabpay) { * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL * payment method. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(PaymentIntentCreateParams.PaymentMethodData.Ideal ideal) { this.ideal = ideal; return this; } @@ -1869,7 +1884,8 @@ public Builder setIdeal(Ideal ideal) { * If this is an {@code interac_present} PaymentMethod, this hash contains details about the * Interac Present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + PaymentIntentCreateParams.PaymentMethodData.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -1878,7 +1894,7 @@ public Builder setInteracPresent(InteracPresent interacPresent) { * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna * payment method. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(PaymentIntentCreateParams.PaymentMethodData.Klarna klarna) { this.klarna = klarna; return this; } @@ -1887,7 +1903,7 @@ public Builder setKlarna(Klarna klarna) { * If this is a {@code konbini} PaymentMethod, this hash contains details about the Konbini * payment method. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(PaymentIntentCreateParams.PaymentMethodData.Konbini konbini) { this.konbini = konbini; return this; } @@ -1896,7 +1912,7 @@ public Builder setKonbini(Konbini konbini) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(PaymentIntentCreateParams.PaymentMethodData.Link link) { this.link = link; return this; } @@ -1932,7 +1948,7 @@ public Builder putAllMetadata(Map map) { * If this is an {@code oxxo} PaymentMethod, this hash contains details about the OXXO payment * method. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(PaymentIntentCreateParams.PaymentMethodData.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -1941,7 +1957,7 @@ public Builder setOxxo(Oxxo oxxo) { * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment * method. */ - public Builder setP24(P24 p24) { + public Builder setP24(PaymentIntentCreateParams.PaymentMethodData.P24 p24) { this.p24 = p24; return this; } @@ -1950,7 +1966,7 @@ public Builder setP24(P24 p24) { * If this is a {@code paynow} PaymentMethod, this hash contains details about the PayNow * payment method. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(PaymentIntentCreateParams.PaymentMethodData.Paynow paynow) { this.paynow = paynow; return this; } @@ -1959,7 +1975,7 @@ public Builder setPaynow(Paynow paynow) { * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. */ - public Builder setPix(Pix pix) { + public Builder setPix(PaymentIntentCreateParams.PaymentMethodData.Pix pix) { this.pix = pix; return this; } @@ -1968,7 +1984,7 @@ public Builder setPix(Pix pix) { * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay(PaymentIntentCreateParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1977,7 +1993,8 @@ public Builder setPromptpay(Promptpay promptpay) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions( + PaymentIntentCreateParams.PaymentMethodData.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -1986,7 +2003,7 @@ public Builder setRadarOptions(RadarOptions radarOptions) { * If this is a {@code sepa_debit} PaymentMethod, this hash contains details about the SEPA * debit bank account. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(PaymentIntentCreateParams.PaymentMethodData.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -1995,7 +2012,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code sofort} PaymentMethod, this hash contains details about the SOFORT * payment method. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(PaymentIntentCreateParams.PaymentMethodData.Sofort sofort) { this.sofort = sofort; return this; } @@ -2005,7 +2022,7 @@ public Builder setSofort(Sofort sofort) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(PaymentIntentCreateParams.PaymentMethodData.Type type) { this.type = type; return this; } @@ -2014,7 +2031,8 @@ public Builder setType(Type type) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + PaymentIntentCreateParams.PaymentMethodData.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -2023,7 +2041,7 @@ public Builder setUsBankAccount(UsBankAccount usBankAccount) { * If this is an {@code wechat_pay} PaymentMethod, this hash contains details about the * wechat_pay payment method. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay(PaymentIntentCreateParams.PaymentMethodData.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -2077,8 +2095,8 @@ public static class Builder { private String transitNumber; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public PaymentIntentCreateParams.PaymentMethodData.AcssDebit build() { + return new PaymentIntentCreateParams.PaymentMethodData.AcssDebit( this.accountNumber, this.extraParams, this.institutionNumber, this.transitNumber); } @@ -2153,8 +2171,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Affirm build() { + return new PaymentIntentCreateParams.PaymentMethodData.Affirm(this.extraParams); } /** @@ -2210,8 +2228,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.AfterpayClearpay build() { + return new PaymentIntentCreateParams.PaymentMethodData.AfterpayClearpay(this.extraParams); } /** @@ -2267,8 +2285,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Alipay build() { + return new PaymentIntentCreateParams.PaymentMethodData.Alipay(this.extraParams); } /** @@ -2338,8 +2356,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.accountNumber, this.bsbNumber, this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.AuBecsDebit build() { + return new PaymentIntentCreateParams.PaymentMethodData.AuBecsDebit( + this.accountNumber, this.bsbNumber, this.extraParams); } /** The account number for the bank account. */ @@ -2421,8 +2440,9 @@ public static class Builder { private String sortCode; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.accountNumber, this.extraParams, this.sortCode); + public PaymentIntentCreateParams.PaymentMethodData.BacsDebit build() { + return new PaymentIntentCreateParams.PaymentMethodData.BacsDebit( + this.accountNumber, this.extraParams, this.sortCode); } /** Account number of the bank account that the funds will be debited from. */ @@ -2490,8 +2510,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Bancontact build() { + return new PaymentIntentCreateParams.PaymentMethodData.Bancontact(this.extraParams); } /** @@ -2580,13 +2600,14 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public PaymentIntentCreateParams.PaymentMethodData.BillingDetails build() { + return new PaymentIntentCreateParams.PaymentMethodData.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress( + PaymentIntentCreateParams.PaymentMethodData.BillingDetails.Address address) { this.address = address; return this; } @@ -2726,8 +2747,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public PaymentIntentCreateParams.PaymentMethodData.BillingDetails.Address build() { + return new PaymentIntentCreateParams.PaymentMethodData.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -2832,8 +2853,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Blik build() { + return new PaymentIntentCreateParams.PaymentMethodData.Blik(this.extraParams); } /** @@ -2898,8 +2919,9 @@ public static class Builder { private String taxId; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.extraParams, this.taxId); + public PaymentIntentCreateParams.PaymentMethodData.Boleto build() { + return new PaymentIntentCreateParams.PaymentMethodData.Boleto( + this.extraParams, this.taxId); } /** @@ -2964,8 +2986,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.CustomerBalance build() { + return new PaymentIntentCreateParams.PaymentMethodData.CustomerBalance(this.extraParams); } /** @@ -3028,12 +3050,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.bank, this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Eps build() { + return new PaymentIntentCreateParams.PaymentMethodData.Eps(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentCreateParams.PaymentMethodData.Eps.Bank bank) { this.bank = bank; return this; } @@ -3198,18 +3220,20 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.accountHolderType, this.bank, this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Fpx build() { + return new PaymentIntentCreateParams.PaymentMethodData.Fpx( + this.accountHolderType, this.bank, this.extraParams); } /** Account holder type for FPX transaction. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + PaymentIntentCreateParams.PaymentMethodData.Fpx.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentCreateParams.PaymentMethodData.Fpx.Bank bank) { this.bank = bank; return this; } @@ -3354,8 +3378,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Giropay build() { + return new PaymentIntentCreateParams.PaymentMethodData.Giropay(this.extraParams); } /** @@ -3411,8 +3435,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Grabpay build() { + return new PaymentIntentCreateParams.PaymentMethodData.Grabpay(this.extraParams); } /** @@ -3475,12 +3499,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.bank, this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Ideal build() { + return new PaymentIntentCreateParams.PaymentMethodData.Ideal(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentCreateParams.PaymentMethodData.Ideal.Bank bank) { this.bank = bank; return this; } @@ -3586,8 +3610,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.InteracPresent build() { + return new PaymentIntentCreateParams.PaymentMethodData.InteracPresent(this.extraParams); } /** @@ -3650,12 +3674,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.dob, this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Klarna build() { + return new PaymentIntentCreateParams.PaymentMethodData.Klarna(this.dob, this.extraParams); } /** Customer's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(PaymentIntentCreateParams.PaymentMethodData.Klarna.Dob dob) { this.dob = dob; return this; } @@ -3734,8 +3758,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public PaymentIntentCreateParams.PaymentMethodData.Klarna.Dob build() { + return new PaymentIntentCreateParams.PaymentMethodData.Klarna.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -3810,8 +3835,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Konbini build() { + return new PaymentIntentCreateParams.PaymentMethodData.Konbini(this.extraParams); } /** @@ -3867,8 +3892,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Link build() { + return new PaymentIntentCreateParams.PaymentMethodData.Link(this.extraParams); } /** @@ -3924,8 +3949,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Oxxo build() { + return new PaymentIntentCreateParams.PaymentMethodData.Oxxo(this.extraParams); } /** @@ -3988,12 +4013,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.bank, this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.P24 build() { + return new PaymentIntentCreateParams.PaymentMethodData.P24(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentCreateParams.PaymentMethodData.P24.Bank bank) { this.bank = bank; return this; } @@ -4135,8 +4160,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Paynow build() { + return new PaymentIntentCreateParams.PaymentMethodData.Paynow(this.extraParams); } /** @@ -4192,8 +4217,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pix build() { - return new Pix(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Pix build() { + return new PaymentIntentCreateParams.PaymentMethodData.Pix(this.extraParams); } /** @@ -4249,8 +4274,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Promptpay build() { + return new PaymentIntentCreateParams.PaymentMethodData.Promptpay(this.extraParams); } /** @@ -4317,8 +4342,9 @@ public static class Builder { private String session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public PaymentIntentCreateParams.PaymentMethodData.RadarOptions build() { + return new PaymentIntentCreateParams.PaymentMethodData.RadarOptions( + this.extraParams, this.session); } /** @@ -4391,8 +4417,9 @@ public static class Builder { private String iban; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.iban); + public PaymentIntentCreateParams.PaymentMethodData.SepaDebit build() { + return new PaymentIntentCreateParams.PaymentMethodData.SepaDebit( + this.extraParams, this.iban); } /** @@ -4461,12 +4488,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.country, this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.Sofort build() { + return new PaymentIntentCreateParams.PaymentMethodData.Sofort( + this.country, this.extraParams); } /** Two-letter ISO code representing the country the bank account is located in. */ - public Builder setCountry(Country country) { + public Builder setCountry( + PaymentIntentCreateParams.PaymentMethodData.Sofort.Country country) { this.country = country; return this; } @@ -4592,8 +4621,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public PaymentIntentCreateParams.PaymentMethodData.UsBankAccount build() { + return new PaymentIntentCreateParams.PaymentMethodData.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -4603,7 +4632,9 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + PaymentIntentCreateParams.PaymentMethodData.UsBankAccount.AccountHolderType + accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -4615,7 +4646,8 @@ public Builder setAccountNumber(String accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + PaymentIntentCreateParams.PaymentMethodData.UsBankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -4715,8 +4747,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodData.WechatPay build() { + return new PaymentIntentCreateParams.PaymentMethodData.WechatPay(this.extraParams); } /** @@ -5191,8 +5223,8 @@ public static class Builder { private Object wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public PaymentIntentCreateParams.PaymentMethodOptions build() { + return new PaymentIntentCreateParams.PaymentMethodOptions( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -5230,7 +5262,8 @@ public PaymentMethodOptions build() { * If this is a {@code acss_debit} PaymentMethod, this sub-hash contains details about the * ACSS Debit payment method options. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -5248,7 +5281,7 @@ public Builder setAcssDebit(EmptyParam acssDebit) { * If this is an {@code affirm} PaymentMethod, this sub-hash contains details about the Affirm * payment method options. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(PaymentIntentCreateParams.PaymentMethodOptions.Affirm affirm) { this.affirm = affirm; return this; } @@ -5266,7 +5299,8 @@ public Builder setAffirm(EmptyParam affirm) { * If this is a {@code afterpay_clearpay} PaymentMethod, this sub-hash contains details about * the Afterpay Clearpay payment method options. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + PaymentIntentCreateParams.PaymentMethodOptions.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -5284,7 +5318,7 @@ public Builder setAfterpayClearpay(EmptyParam afterpayClearpay) { * If this is a {@code alipay} PaymentMethod, this sub-hash contains details about the Alipay * payment method options. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(PaymentIntentCreateParams.PaymentMethodOptions.Alipay alipay) { this.alipay = alipay; return this; } @@ -5302,7 +5336,8 @@ public Builder setAlipay(EmptyParam alipay) { * If this is a {@code au_becs_debit} PaymentMethod, this sub-hash contains details about the * AU BECS Direct Debit payment method options. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + PaymentIntentCreateParams.PaymentMethodOptions.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -5320,7 +5355,8 @@ public Builder setAuBecsDebit(EmptyParam auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this sub-hash contains details about the * BACS Debit payment method options. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit( + PaymentIntentCreateParams.PaymentMethodOptions.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -5338,7 +5374,8 @@ public Builder setBacsDebit(EmptyParam bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the * Bancontact payment method options. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + PaymentIntentCreateParams.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -5356,7 +5393,7 @@ public Builder setBancontact(EmptyParam bancontact) { * If this is a {@code blik} PaymentMethod, this sub-hash contains details about the BLIK * payment method options. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(PaymentIntentCreateParams.PaymentMethodOptions.Blik blik) { this.blik = blik; return this; } @@ -5374,7 +5411,7 @@ public Builder setBlik(EmptyParam blik) { * If this is a {@code boleto} PaymentMethod, this sub-hash contains details about the Boleto * payment method options. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(PaymentIntentCreateParams.PaymentMethodOptions.Boleto boleto) { this.boleto = boleto; return this; } @@ -5389,7 +5426,7 @@ public Builder setBoleto(EmptyParam boleto) { } /** Configuration for any card payments attempted on this PaymentIntent. */ - public Builder setCard(Card card) { + public Builder setCard(PaymentIntentCreateParams.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -5404,7 +5441,8 @@ public Builder setCard(EmptyParam card) { * If this is a {@code card_present} PaymentMethod, this sub-hash contains details about the * Card Present payment method options. */ - public Builder setCardPresent(CardPresent cardPresent) { + public Builder setCardPresent( + PaymentIntentCreateParams.PaymentMethodOptions.CardPresent cardPresent) { this.cardPresent = cardPresent; return this; } @@ -5422,7 +5460,8 @@ public Builder setCardPresent(EmptyParam cardPresent) { * If this is a {@code customer balance} PaymentMethod, this sub-hash contains details about * the customer balance payment method options. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -5440,7 +5479,7 @@ public Builder setCustomerBalance(EmptyParam customerBalance) { * If this is a {@code eps} PaymentMethod, this sub-hash contains details about the EPS * payment method options. */ - public Builder setEps(Eps eps) { + public Builder setEps(PaymentIntentCreateParams.PaymentMethodOptions.Eps eps) { this.eps = eps; return this; } @@ -5485,7 +5524,7 @@ public Builder putAllExtraParam(Map map) { * If this is a {@code fpx} PaymentMethod, this sub-hash contains details about the FPX * payment method options. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(PaymentIntentCreateParams.PaymentMethodOptions.Fpx fpx) { this.fpx = fpx; return this; } @@ -5503,7 +5542,7 @@ public Builder setFpx(EmptyParam fpx) { * If this is a {@code giropay} PaymentMethod, this sub-hash contains details about the * Giropay payment method options. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(PaymentIntentCreateParams.PaymentMethodOptions.Giropay giropay) { this.giropay = giropay; return this; } @@ -5521,7 +5560,7 @@ public Builder setGiropay(EmptyParam giropay) { * If this is a {@code grabpay} PaymentMethod, this sub-hash contains details about the * Grabpay payment method options. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(PaymentIntentCreateParams.PaymentMethodOptions.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -5539,7 +5578,7 @@ public Builder setGrabpay(EmptyParam grabpay) { * If this is a {@code ideal} PaymentMethod, this sub-hash contains details about the Ideal * payment method options. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(PaymentIntentCreateParams.PaymentMethodOptions.Ideal ideal) { this.ideal = ideal; return this; } @@ -5557,7 +5596,8 @@ public Builder setIdeal(EmptyParam ideal) { * If this is a {@code interac_present} PaymentMethod, this sub-hash contains details about * the Card Present payment method options. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + PaymentIntentCreateParams.PaymentMethodOptions.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -5575,7 +5615,7 @@ public Builder setInteracPresent(EmptyParam interacPresent) { * If this is a {@code klarna} PaymentMethod, this sub-hash contains details about the Klarna * payment method options. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(PaymentIntentCreateParams.PaymentMethodOptions.Klarna klarna) { this.klarna = klarna; return this; } @@ -5593,7 +5633,7 @@ public Builder setKlarna(EmptyParam klarna) { * If this is a {@code konbini} PaymentMethod, this sub-hash contains details about the * Konbini payment method options. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(PaymentIntentCreateParams.PaymentMethodOptions.Konbini konbini) { this.konbini = konbini; return this; } @@ -5611,7 +5651,7 @@ public Builder setKonbini(EmptyParam konbini) { * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. */ - public Builder setLink(Link link) { + public Builder setLink(PaymentIntentCreateParams.PaymentMethodOptions.Link link) { this.link = link; return this; } @@ -5629,7 +5669,7 @@ public Builder setLink(EmptyParam link) { * If this is a {@code oxxo} PaymentMethod, this sub-hash contains details about the OXXO * payment method options. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(PaymentIntentCreateParams.PaymentMethodOptions.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -5647,7 +5687,7 @@ public Builder setOxxo(EmptyParam oxxo) { * If this is a {@code p24} PaymentMethod, this sub-hash contains details about the Przelewy24 * payment method options. */ - public Builder setP24(P24 p24) { + public Builder setP24(PaymentIntentCreateParams.PaymentMethodOptions.P24 p24) { this.p24 = p24; return this; } @@ -5665,7 +5705,7 @@ public Builder setP24(EmptyParam p24) { * If this is a {@code paynow} PaymentMethod, this sub-hash contains details about the PayNow * payment method options. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(PaymentIntentCreateParams.PaymentMethodOptions.Paynow paynow) { this.paynow = paynow; return this; } @@ -5683,7 +5723,7 @@ public Builder setPaynow(EmptyParam paynow) { * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix * payment method options. */ - public Builder setPix(Pix pix) { + public Builder setPix(PaymentIntentCreateParams.PaymentMethodOptions.Pix pix) { this.pix = pix; return this; } @@ -5701,7 +5741,8 @@ public Builder setPix(EmptyParam pix) { * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay( + PaymentIntentCreateParams.PaymentMethodOptions.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -5719,7 +5760,8 @@ public Builder setPromptpay(EmptyParam promptpay) { * If this is a {@code sepa_debit} PaymentIntent, this sub-hash contains details about the * SEPA Debit payment method options. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + PaymentIntentCreateParams.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -5737,7 +5779,7 @@ public Builder setSepaDebit(EmptyParam sepaDebit) { * If this is a {@code sofort} PaymentMethod, this sub-hash contains details about the SOFORT * payment method options. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(PaymentIntentCreateParams.PaymentMethodOptions.Sofort sofort) { this.sofort = sofort; return this; } @@ -5755,7 +5797,8 @@ public Builder setSofort(EmptyParam sofort) { * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about * the US bank account payment method options. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -5773,7 +5816,8 @@ public Builder setUsBankAccount(EmptyParam usBankAccount) { * If this is a {@code wechat_pay} PaymentMethod, this sub-hash contains details about the * WeChat Pay payment method options. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay( + PaymentIntentCreateParams.PaymentMethodOptions.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -5823,7 +5867,7 @@ public static class AcssDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -5832,7 +5876,7 @@ public static class AcssDebit { private AcssDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; @@ -5849,13 +5893,13 @@ public static class Builder { private MandateOptions mandateOptions; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit( this.extraParams, this.mandateOptions, this.setupFutureUsage, @@ -5891,7 +5935,9 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5916,7 +5962,9 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5947,7 +5995,9 @@ public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -6018,8 +6068,8 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions( this.customMandateUrl, this.extraParams, this.intervalDescription, @@ -6089,13 +6139,19 @@ public Builder setIntervalDescription(String intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions + .PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions + .TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -6184,7 +6240,7 @@ public static class Affirm { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -6218,7 +6274,7 @@ public static class Affirm { SetupFutureUsage setupFutureUsage; private Affirm( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, SetupFutureUsage setupFutureUsage) { this.captureMethod = captureMethod; @@ -6231,15 +6287,16 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.captureMethod, this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Affirm build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Affirm( + this.captureMethod, this.extraParams, this.setupFutureUsage); } /** @@ -6251,7 +6308,8 @@ public Affirm build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentCreateParams.PaymentMethodOptions.Affirm.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -6318,7 +6376,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Affirm.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6361,7 +6421,7 @@ public static class AfterpayClearpay { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -6404,7 +6464,7 @@ public static class AfterpayClearpay { SetupFutureUsage setupFutureUsage; private AfterpayClearpay( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, String reference, SetupFutureUsage setupFutureUsage) { @@ -6419,7 +6479,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -6428,8 +6488,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay( + public PaymentIntentCreateParams.PaymentMethodOptions.AfterpayClearpay build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.AfterpayClearpay( this.captureMethod, this.extraParams, this.reference, this.setupFutureUsage); } @@ -6442,7 +6502,9 @@ public AfterpayClearpay build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentCreateParams.PaymentMethodOptions.AfterpayClearpay.CaptureMethod + captureMethod) { this.captureMethod = captureMethod; return this; } @@ -6522,7 +6584,9 @@ public Builder setReference(String reference) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.AfterpayClearpay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6584,9 +6648,9 @@ public static class Alipay { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private Alipay(Map extraParams, EnumParam setupFutureUsage) { + private Alipay(Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -6598,11 +6662,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Alipay build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Alipay( + this.extraParams, this.setupFutureUsage); } /** @@ -6653,7 +6718,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Alipay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6731,9 +6798,10 @@ public static class AuBecsDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private AuBecsDebit(Map extraParams, EnumParam setupFutureUsage) { + private AuBecsDebit( + Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -6745,11 +6813,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.AuBecsDebit build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.AuBecsDebit( + this.extraParams, this.setupFutureUsage); } /** @@ -6800,7 +6869,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.AuBecsDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6881,9 +6952,10 @@ public static class BacsDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private BacsDebit(Map extraParams, EnumParam setupFutureUsage) { + private BacsDebit( + Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -6895,11 +6967,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.BacsDebit build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.BacsDebit( + this.extraParams, this.setupFutureUsage); } /** @@ -6950,7 +7023,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.BacsDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7037,12 +7112,12 @@ public static class Bancontact { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Bancontact( Map extraParams, PreferredLanguage preferredLanguage, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.preferredLanguage = preferredLanguage; this.setupFutureUsage = setupFutureUsage; @@ -7057,11 +7132,12 @@ public static class Builder { private PreferredLanguage preferredLanguage; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams, this.preferredLanguage, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Bancontact build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Bancontact( + this.extraParams, this.preferredLanguage, this.setupFutureUsage); } /** @@ -7096,7 +7172,9 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Bancontact authorization page that the customer is redirected * to. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + PaymentIntentCreateParams.PaymentMethodOptions.Bancontact.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -7121,7 +7199,9 @@ public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Bancontact.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7222,8 +7302,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.code, this.extraParams); + public PaymentIntentCreateParams.PaymentMethodOptions.Blik build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Blik( + this.code, this.extraParams); } /** @@ -7304,10 +7385,12 @@ public static class Boleto { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Boleto( - Long expiresAfterDays, Map extraParams, EnumParam setupFutureUsage) { + Long expiresAfterDays, + Map extraParams, + ApiRequestParams.EnumParam setupFutureUsage) { this.expiresAfterDays = expiresAfterDays; this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; @@ -7322,11 +7405,12 @@ public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.expiresAfterDays, this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Boleto build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Boleto( + this.expiresAfterDays, this.extraParams, this.setupFutureUsage); } /** @@ -7387,7 +7471,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Boleto.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7449,7 +7535,7 @@ public static class Card { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * A single-use {@code cvc_update} Token that represents a card CVC value. When provided, the @@ -7530,7 +7616,7 @@ public static class Card { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** * Provides information about a card payment that customers see on their statements. @@ -7553,7 +7639,7 @@ public static class Card { Object statementDescriptorSuffixKanji; private Card( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, String cvcToken, Map extraParams, Installments installments, @@ -7561,7 +7647,7 @@ private Card( Boolean moto, Network network, RequestThreeDSecure requestThreeDSecure, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, Object statementDescriptorSuffixKana, Object statementDescriptorSuffixKanji) { this.captureMethod = captureMethod; @@ -7582,7 +7668,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private String cvcToken; @@ -7598,15 +7684,15 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private Object statementDescriptorSuffixKana; private Object statementDescriptorSuffixKanji; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public PaymentIntentCreateParams.PaymentMethodOptions.Card build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Card( this.captureMethod, this.cvcToken, this.extraParams, @@ -7629,7 +7715,8 @@ public Card build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentCreateParams.PaymentMethodOptions.Card.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -7692,13 +7779,15 @@ public Builder putAllExtraParam(Map map) { *

For more information, see the installments integration guide. */ - public Builder setInstallments(Installments installments) { + public Builder setInstallments( + PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments installments) { this.installments = installments; return this; } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + PaymentIntentCreateParams.PaymentMethodOptions.Card.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -7717,7 +7806,8 @@ public Builder setMoto(Boolean moto) { * Selected network to process this PaymentIntent on. Depends on the available networks of * the card attached to the PaymentIntent. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + PaymentIntentCreateParams.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -7733,7 +7823,9 @@ public Builder setNetwork(Network network) { * Secure for more information on how this configuration interacts with Radar and our * SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + PaymentIntentCreateParams.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -7758,7 +7850,8 @@ public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Card.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7883,8 +7976,9 @@ public static class Builder { private Object plan; /** Finalize and obtain parameter instance from this builder. */ - public Installments build() { - return new Installments(this.enabled, this.extraParams, this.plan); + public PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments( + this.enabled, this.extraParams, this.plan); } /** @@ -7931,7 +8025,8 @@ public Builder putAllExtraParam(Map map) { * The selected installment plan to use for this payment attempt. This parameter can only * be provided during confirmation. */ - public Builder setPlan(Plan plan) { + public Builder setPlan( + PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments.Plan plan) { this.plan = plan; return this; } @@ -7997,8 +8092,9 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Plan build() { - return new Plan(this.count, this.extraParams, this.interval, this.type); + public PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments.Plan build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments.Plan( + this.count, this.extraParams, this.interval, this.type); } /** @@ -8044,13 +8140,16 @@ public Builder putAllExtraParam(Map map) { * For {@code fixed_count} installment plans, this is the interval between installment * payments your customer will make to their credit card. One of {@code month}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments.Plan.Interval + interval) { this.interval = interval; return this; } /** Type of installment plan, one of {@code fixed_count}. */ - public Builder setType(Type type) { + public Builder setType( + PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments.Plan.Type type) { this.type = type; return this; } @@ -8149,7 +8248,8 @@ public static class MandateOptions { /** Specifies the type of mandates supported. Possible values are {@code india}. */ @SerializedName("supported_types") - List supportedTypes; + List + supportedTypes; private MandateOptions( Long amount, @@ -8161,7 +8261,8 @@ private MandateOptions( Long intervalCount, String reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.description = description; @@ -8197,11 +8298,13 @@ public static class Builder { private Long startDate; - private List supportedTypes; + private List< + PaymentIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType> + supportedTypes; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public PaymentIntentCreateParams.PaymentMethodOptions.Card.MandateOptions build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Card.MandateOptions( this.amount, this.amountType, this.description, @@ -8225,7 +8328,9 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + PaymentIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.AmountType + amountType) { this.amountType = amountType; return this; } @@ -8282,7 +8387,9 @@ public Builder putAllExtraParam(Map map) { * Specifies payment frequency. One of {@code day}, {@code week}, {@code month}, {@code * year}, or {@code sporadic}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + PaymentIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.Interval + interval) { this.interval = interval; return this; } @@ -8320,7 +8427,9 @@ public Builder setStartDate(Long startDate) { * PaymentIntentCreateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addSupportedType(SupportedType element) { + public Builder addSupportedType( + PaymentIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType + element) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -8335,7 +8444,9 @@ public Builder addSupportedType(SupportedType element) { * PaymentIntentCreateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addAllSupportedType(List elements) { + public Builder addAllSupportedType( + List + elements) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -8532,8 +8643,8 @@ public static class Builder { private Boolean requestIncrementalAuthorizationSupport; /** Finalize and obtain parameter instance from this builder. */ - public CardPresent build() { - return new CardPresent( + public PaymentIntentCreateParams.PaymentMethodOptions.CardPresent build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.CardPresent( this.extraParams, this.requestExtendedAuthorization, this.requestIncrementalAuthorizationSupport); @@ -8665,8 +8776,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance( + public PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance( this.bankTransfer, this.extraParams, this.fundingType, this.setupFutureUsage); } @@ -8674,7 +8785,9 @@ public CustomerBalance build() { * Configuration for the bank transfer funding type, if the {@code funding_type} is set to * {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -8713,7 +8826,9 @@ public Builder putAllExtraParam(Map map) { * The funding method type to be used when there are not enough funds in the customer * balance. Permitted values include: {@code bank_transfer}. */ - public Builder setFundingType(FundingType fundingType) { + public Builder setFundingType( + PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.FundingType + fundingType) { this.fundingType = fundingType; return this; } @@ -8738,7 +8853,9 @@ public Builder setFundingType(FundingType fundingType) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -8767,7 +8884,10 @@ public static class BankTransfer { * spei}. */ @SerializedName("requested_address_types") - List requestedAddressTypes; + List< + PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes; /** * The list of bank transfer types that this PaymentIntent is allowed to use for funding @@ -8780,7 +8900,10 @@ public static class BankTransfer { private BankTransfer( EuBankTransfer euBankTransfer, Map extraParams, - List requestedAddressTypes, + List< + PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes, Type type) { this.euBankTransfer = euBankTransfer; this.extraParams = extraParams; @@ -8797,17 +8920,24 @@ public static class Builder { private Map extraParams; - private List requestedAddressTypes; + private List< + PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes; private Type type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer( + public PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer( this.euBankTransfer, this.extraParams, this.requestedAddressTypes, this.type); } - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -8849,7 +8979,10 @@ public Builder putAllExtraParam(Map map) { * PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addRequestedAddressType(RequestedAddressType element) { + public Builder addRequestedAddressType( + PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType + element) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -8864,7 +8997,11 @@ public Builder addRequestedAddressType(RequestedAddressType element) { * PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addAllRequestedAddressType(List elements) { + public Builder addAllRequestedAddressType( + List< + PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + elements) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -8877,7 +9014,9 @@ public Builder addAllRequestedAddressType(List elements) { * Permitted values include: {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code * jp_bank_transfer}, or {@code mx_bank_transfer}. */ - public Builder setType(Type type) { + public Builder setType( + PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.Type + type) { this.type = type; return this; } @@ -8917,8 +9056,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer + build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer(this.country, this.extraParams); } /** @@ -9081,8 +9223,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Eps build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Eps( + this.extraParams, this.setupFutureUsage); } /** @@ -9133,7 +9276,8 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Eps.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9200,8 +9344,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Fpx build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Fpx( + this.extraParams, this.setupFutureUsage); } /** @@ -9252,7 +9397,8 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Fpx.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9319,8 +9465,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Giropay build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Giropay( + this.extraParams, this.setupFutureUsage); } /** @@ -9371,7 +9518,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Giropay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9438,8 +9587,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Grabpay build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Grabpay( + this.extraParams, this.setupFutureUsage); } /** @@ -9490,7 +9640,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Grabpay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9540,9 +9692,9 @@ public static class Ideal { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private Ideal(Map extraParams, EnumParam setupFutureUsage) { + private Ideal(Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -9554,11 +9706,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Ideal build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Ideal( + this.extraParams, this.setupFutureUsage); } /** @@ -9609,7 +9762,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Ideal.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9679,8 +9834,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodOptions.InteracPresent build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.InteracPresent( + this.extraParams); } /** @@ -9727,7 +9883,7 @@ public static class Klarna { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -9765,7 +9921,7 @@ public static class Klarna { SetupFutureUsage setupFutureUsage; private Klarna( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, PreferredLocale preferredLocale, SetupFutureUsage setupFutureUsage) { @@ -9780,7 +9936,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -9789,8 +9945,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna( + public PaymentIntentCreateParams.PaymentMethodOptions.Klarna build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Klarna( this.captureMethod, this.extraParams, this.preferredLocale, this.setupFutureUsage); } @@ -9803,7 +9959,8 @@ public Klarna build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentCreateParams.PaymentMethodOptions.Klarna.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -9853,7 +10010,8 @@ public Builder putAllExtraParam(Map map) { /** * Preferred language of the Klarna authorization page that the customer is redirected to. */ - public Builder setPreferredLocale(PreferredLocale preferredLocale) { + public Builder setPreferredLocale( + PaymentIntentCreateParams.PaymentMethodOptions.Klarna.PreferredLocale preferredLocale) { this.preferredLocale = preferredLocale; return this; } @@ -9878,7 +10036,9 @@ public Builder setPreferredLocale(PreferredLocale preferredLocale) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Klarna.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10135,8 +10295,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini( + public PaymentIntentCreateParams.PaymentMethodOptions.Konbini build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Konbini( this.confirmationNumber, this.expiresAfterDays, this.expiresAt, @@ -10252,7 +10412,9 @@ public Builder setProductDescription(String productDescription) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Konbini.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10283,7 +10445,7 @@ public static class Link { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -10318,13 +10480,13 @@ public static class Link { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Link( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, String persistentToken, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.captureMethod = captureMethod; this.extraParams = extraParams; this.persistentToken = persistentToken; @@ -10336,17 +10498,17 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; private String persistentToken; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link( + public PaymentIntentCreateParams.PaymentMethodOptions.Link build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Link( this.captureMethod, this.extraParams, this.persistentToken, this.setupFutureUsage); } @@ -10359,7 +10521,8 @@ public Link build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentCreateParams.PaymentMethodOptions.Link.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -10432,7 +10595,8 @@ public Builder setPersistentToken(String persistentToken) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Link.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10553,8 +10717,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.expiresAfterDays, this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Oxxo build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Oxxo( + this.expiresAfterDays, this.extraParams, this.setupFutureUsage); } /** @@ -10615,7 +10780,8 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Oxxo.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10692,8 +10858,9 @@ public static class Builder { private Boolean tosShownAndAccepted; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); + public PaymentIntentCreateParams.PaymentMethodOptions.P24 build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.P24( + this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); } /** @@ -10744,7 +10911,8 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.P24.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10817,8 +10985,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Paynow build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Paynow( + this.extraParams, this.setupFutureUsage); } /** @@ -10869,7 +11038,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Paynow.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10931,8 +11102,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pix build() { - return new Pix(this.expiresAfterSeconds, this.expiresAt, this.extraParams); + public PaymentIntentCreateParams.PaymentMethodOptions.Pix build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Pix( + this.expiresAfterSeconds, this.expiresAt, this.extraParams); } /** @@ -11031,8 +11203,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Promptpay build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Promptpay( + this.extraParams, this.setupFutureUsage); } /** @@ -11083,7 +11256,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Promptpay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -11137,12 +11312,12 @@ public static class SepaDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private SepaDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; this.setupFutureUsage = setupFutureUsage; @@ -11157,11 +11332,12 @@ public static class Builder { private MandateOptions mandateOptions; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.mandateOptions, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.SepaDebit build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.SepaDebit( + this.extraParams, this.mandateOptions, this.setupFutureUsage); } /** @@ -11193,7 +11369,9 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + PaymentIntentCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -11218,7 +11396,9 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.SepaDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -11273,8 +11453,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams); + public PaymentIntentCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions( + this.extraParams); } /** @@ -11341,7 +11522,7 @@ public static class Sofort { /** Language shown to the payer on redirect. */ @SerializedName("preferred_language") - EnumParam preferredLanguage; + ApiRequestParams.EnumParam preferredLanguage; /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -11363,12 +11544,12 @@ public static class Sofort { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Sofort( Map extraParams, - EnumParam preferredLanguage, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam preferredLanguage, + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.preferredLanguage = preferredLanguage; this.setupFutureUsage = setupFutureUsage; @@ -11381,13 +11562,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam preferredLanguage; + private ApiRequestParams.EnumParam preferredLanguage; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.extraParams, this.preferredLanguage, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.Sofort build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Sofort( + this.extraParams, this.preferredLanguage, this.setupFutureUsage); } /** @@ -11419,7 +11601,9 @@ public Builder putAllExtraParam(Map map) { } /** Language shown to the payer on redirect. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + PaymentIntentCreateParams.PaymentMethodOptions.Sofort.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -11450,7 +11634,9 @@ public Builder setPreferredLanguage(EmptyParam preferredLanguage) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Sofort.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -11566,7 +11752,7 @@ public static class UsBankAccount { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -11576,7 +11762,7 @@ private UsBankAccount( Map extraParams, FinancialConnections financialConnections, Networks networks, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.financialConnections = financialConnections; @@ -11596,13 +11782,13 @@ public static class Builder { private Networks networks; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.networks, @@ -11639,13 +11825,16 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Additional fields for network related functions. */ - public Builder setNetworks(Networks networks) { + public Builder setNetworks( + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks networks) { this.networks = networks; return this; } @@ -11670,7 +11859,9 @@ public Builder setNetworks(Networks networks) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -11701,7 +11892,9 @@ public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -11725,7 +11918,10 @@ public static class FinancialConnections { * {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; /** * For webview integrations only. Upon completing OAuth login in the native browser, the @@ -11735,7 +11931,12 @@ public static class FinancialConnections { String returnUrl; private FinancialConnections( - Map extraParams, List permissions, String returnUrl) { + Map extraParams, + List< + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions, + String returnUrl) { this.extraParams = extraParams; this.permissions = permissions; this.returnUrl = returnUrl; @@ -11748,13 +11949,18 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; private String returnUrl; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions, this.returnUrl); + public PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions, this.returnUrl); } /** @@ -11793,7 +11999,10 @@ public Builder putAllExtraParam(Map map) { * PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -11808,7 +12017,11 @@ public Builder addPermission(Permission element) { * PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -11862,9 +12075,13 @@ public static class Networks { /** Triggers validations to run across the selected networks. */ @SerializedName("requested") - List requested; + List + requested; - private Networks(Map extraParams, List requested) { + private Networks( + Map extraParams, + List + requested) { this.extraParams = extraParams; this.requested = requested; } @@ -11876,11 +12093,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List requested; + private List< + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested> + requested; /** Finalize and obtain parameter instance from this builder. */ - public Networks build() { - return new Networks(this.extraParams, this.requested); + public PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks( + this.extraParams, this.requested); } /** @@ -11919,7 +12139,9 @@ public Builder putAllExtraParam(Map map) { * PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for * the field documentation. */ - public Builder addRequested(Requested element) { + public Builder addRequested( + PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested + element) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -11933,7 +12155,9 @@ public Builder addRequested(Requested element) { * PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for * the field documentation. */ - public Builder addAllRequested(List elements) { + public Builder addAllRequested( + List + elements) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -12061,8 +12285,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.appId, this.client, this.extraParams, this.setupFutureUsage); + public PaymentIntentCreateParams.PaymentMethodOptions.WechatPay build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.WechatPay( + this.appId, this.client, this.extraParams, this.setupFutureUsage); } /** The app ID registered with WeChat Pay. Only required when client is ios or android. */ @@ -12072,7 +12297,8 @@ public Builder setAppId(String appId) { } /** The client type that the end customer will pay from. */ - public Builder setClient(Client client) { + public Builder setClient( + PaymentIntentCreateParams.PaymentMethodOptions.WechatPay.Client client) { this.client = client; return this; } @@ -12125,7 +12351,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.WechatPay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -12197,8 +12425,8 @@ public static class Builder { private String session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public PaymentIntentCreateParams.RadarOptions build() { + return new PaymentIntentCreateParams.RadarOptions(this.extraParams, this.session); } /** @@ -12306,8 +12534,8 @@ public static class Builder { private String trackingNumber; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping( + public PaymentIntentCreateParams.Shipping build() { + return new PaymentIntentCreateParams.Shipping( this.address, this.carrier, this.extraParams, @@ -12317,7 +12545,7 @@ public Shipping build() { } /** Shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(PaymentIntentCreateParams.Shipping.Address address) { this.address = address; return this; } @@ -12451,8 +12679,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public PaymentIntentCreateParams.Shipping.Address build() { + return new PaymentIntentCreateParams.Shipping.Address( this.city, this.country, this.extraParams, @@ -12581,8 +12809,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.destination, this.extraParams); + public PaymentIntentCreateParams.TransferData build() { + return new PaymentIntentCreateParams.TransferData( + this.amount, this.destination, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java index 27e7a262d28..e45a7d6e868 100644 --- a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java @@ -54,6 +54,13 @@ public class PaymentIntentIncrementAuthorizationParams extends ApiRequestParams @SerializedName("metadata") Map metadata; + /** + * For non-card charges, you can use this value as the complete description that appears on your + * customers’ statements. Must contain at least one letter, maximum 22 characters. + */ + @SerializedName("statement_descriptor") + String statementDescriptor; + /** * The parameters used to automatically create a Transfer when the payment is captured. For more * information, see the PaymentIntents expand, Map extraParams, Map metadata, + String statementDescriptor, TransferData transferData) { this.amount = amount; this.applicationFeeAmount = applicationFeeAmount; @@ -76,6 +84,7 @@ private PaymentIntentIncrementAuthorizationParams( this.expand = expand; this.extraParams = extraParams; this.metadata = metadata; + this.statementDescriptor = statementDescriptor; this.transferData = transferData; } @@ -96,6 +105,8 @@ public static class Builder { private Map metadata; + private String statementDescriptor; + private TransferData transferData; /** Finalize and obtain parameter instance from this builder. */ @@ -107,6 +118,7 @@ public PaymentIntentIncrementAuthorizationParams build() { this.expand, this.extraParams, this.metadata, + this.statementDescriptor, this.transferData); } @@ -216,13 +228,23 @@ public Builder putAllMetadata(Map map) { return this; } + /** + * For non-card charges, you can use this value as the complete description that appears on your + * customers’ statements. Must contain at least one letter, maximum 22 characters. + */ + public Builder setStatementDescriptor(String statementDescriptor) { + this.statementDescriptor = statementDescriptor; + return this; + } + /** * The parameters used to automatically create a Transfer when the payment is captured. For more * information, see the PaymentIntents use case for connected * accounts. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + PaymentIntentIncrementAuthorizationParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -258,8 +280,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.extraParams); + public PaymentIntentIncrementAuthorizationParams.TransferData build() { + return new PaymentIntentIncrementAuthorizationParams.TransferData( + this.amount, this.extraParams); } /** The amount that will be transferred automatically when a charge succeeds. */ diff --git a/src/main/java/com/stripe/param/PaymentIntentListParams.java b/src/main/java/com/stripe/param/PaymentIntentListParams.java index f2e6b453edb..3b46deac77f 100644 --- a/src/main/java/com/stripe/param/PaymentIntentListParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentListParams.java @@ -113,7 +113,7 @@ public PaymentIntentListParams build() { * with an integer Unix timestamp, or it can be a dictionary with a number of different query * options. */ - public Builder setCreated(Created created) { + public Builder setCreated(PaymentIntentListParams.Created created) { this.created = created; return this; } @@ -269,8 +269,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public PaymentIntentListParams.Created build() { + return new PaymentIntentListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 679c49f2842..d8d03a8081e 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -140,7 +139,7 @@ public class PaymentIntentUpdateParams extends ApiRequestParams { * publishable key, you may only update the value from {@code on_session} to {@code off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Shipping information for this PaymentIntent. */ @SerializedName("shipping") @@ -193,7 +192,7 @@ private PaymentIntentUpdateParams( PaymentMethodOptions paymentMethodOptions, List paymentMethodTypes, Object receiptEmail, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, Object shipping, Object statementDescriptor, Object statementDescriptorSuffix, @@ -254,7 +253,7 @@ public static class Builder { private Object receiptEmail; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private Object shipping; @@ -330,7 +329,7 @@ public Builder setApplicationFeeAmount(EmptyParam applicationFeeAmount) { } /** Controls when the funds will be captured from the customer's account. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod(PaymentIntentUpdateParams.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -525,13 +524,15 @@ public Builder setPaymentMethod(EmptyParam paymentMethod) { * href="https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method">payment_method * property on the PaymentIntent. */ - public Builder setPaymentMethodData(PaymentMethodData paymentMethodData) { + public Builder setPaymentMethodData( + PaymentIntentUpdateParams.PaymentMethodData paymentMethodData) { this.paymentMethodData = paymentMethodData; return this; } /** Payment-method-specific configuration for this PaymentIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + PaymentIntentUpdateParams.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -600,7 +601,8 @@ public Builder setReceiptEmail(EmptyParam receiptEmail) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -629,7 +631,7 @@ public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { } /** Shipping information for this PaymentIntent. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(PaymentIntentUpdateParams.Shipping shipping) { this.shipping = shipping; return this; } @@ -686,7 +688,7 @@ public Builder setStatementDescriptorSuffix(EmptyParam statementDescriptorSuffix * href="https://stripe.com/docs/payments/connected-accounts">use case for connected * accounts. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(PaymentIntentUpdateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -1093,8 +1095,8 @@ public static class Builder { private WechatPay wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodData build() { - return new PaymentMethodData( + public PaymentIntentUpdateParams.PaymentMethodData build() { + return new PaymentIntentUpdateParams.PaymentMethodData( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -1134,7 +1136,7 @@ public PaymentMethodData build() { * If this is an {@code acss_debit} PaymentMethod, this hash contains details about the ACSS * Debit payment method. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(PaymentIntentUpdateParams.PaymentMethodData.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -1143,7 +1145,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is an {@code affirm} PaymentMethod, this hash contains details about the Affirm * payment method. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(PaymentIntentUpdateParams.PaymentMethodData.Affirm affirm) { this.affirm = affirm; return this; } @@ -1152,7 +1154,8 @@ public Builder setAffirm(Affirm affirm) { * If this is an {@code AfterpayClearpay} PaymentMethod, this hash contains details about the * AfterpayClearpay payment method. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + PaymentIntentUpdateParams.PaymentMethodData.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -1161,7 +1164,7 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If this is an {@code Alipay} PaymentMethod, this hash contains details about the Alipay * payment method. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(PaymentIntentUpdateParams.PaymentMethodData.Alipay alipay) { this.alipay = alipay; return this; } @@ -1170,7 +1173,8 @@ public Builder setAlipay(Alipay alipay) { * If this is an {@code au_becs_debit} PaymentMethod, this hash contains details about the * bank account. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + PaymentIntentUpdateParams.PaymentMethodData.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -1179,7 +1183,7 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs * Direct Debit bank account. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(PaymentIntentUpdateParams.PaymentMethodData.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -1188,7 +1192,8 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this hash contains details about the * Bancontact payment method. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + PaymentIntentUpdateParams.PaymentMethodData.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -1197,7 +1202,8 @@ public Builder setBancontact(Bancontact bancontact) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails( + PaymentIntentUpdateParams.PaymentMethodData.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -1206,7 +1212,7 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(PaymentIntentUpdateParams.PaymentMethodData.Blik blik) { this.blik = blik; return this; } @@ -1215,7 +1221,7 @@ public Builder setBlik(Blik blik) { * If this is a {@code boleto} PaymentMethod, this hash contains details about the Boleto * payment method. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(PaymentIntentUpdateParams.PaymentMethodData.Boleto boleto) { this.boleto = boleto; return this; } @@ -1224,7 +1230,8 @@ public Builder setBoleto(Boleto boleto) { * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + PaymentIntentUpdateParams.PaymentMethodData.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -1233,7 +1240,7 @@ public Builder setCustomerBalance(CustomerBalance customerBalance) { * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment * method. */ - public Builder setEps(Eps eps) { + public Builder setEps(PaymentIntentUpdateParams.PaymentMethodData.Eps eps) { this.eps = eps; return this; } @@ -1269,7 +1276,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code fpx} PaymentMethod, this hash contains details about the FPX payment * method. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(PaymentIntentUpdateParams.PaymentMethodData.Fpx fpx) { this.fpx = fpx; return this; } @@ -1278,7 +1285,7 @@ public Builder setFpx(Fpx fpx) { * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(PaymentIntentUpdateParams.PaymentMethodData.Giropay giropay) { this.giropay = giropay; return this; } @@ -1287,7 +1294,7 @@ public Builder setGiropay(Giropay giropay) { * If this is a {@code grabpay} PaymentMethod, this hash contains details about the GrabPay * payment method. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(PaymentIntentUpdateParams.PaymentMethodData.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -1296,7 +1303,7 @@ public Builder setGrabpay(Grabpay grabpay) { * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL * payment method. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(PaymentIntentUpdateParams.PaymentMethodData.Ideal ideal) { this.ideal = ideal; return this; } @@ -1305,7 +1312,8 @@ public Builder setIdeal(Ideal ideal) { * If this is an {@code interac_present} PaymentMethod, this hash contains details about the * Interac Present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + PaymentIntentUpdateParams.PaymentMethodData.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -1314,7 +1322,7 @@ public Builder setInteracPresent(InteracPresent interacPresent) { * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna * payment method. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(PaymentIntentUpdateParams.PaymentMethodData.Klarna klarna) { this.klarna = klarna; return this; } @@ -1323,7 +1331,7 @@ public Builder setKlarna(Klarna klarna) { * If this is a {@code konbini} PaymentMethod, this hash contains details about the Konbini * payment method. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(PaymentIntentUpdateParams.PaymentMethodData.Konbini konbini) { this.konbini = konbini; return this; } @@ -1332,7 +1340,7 @@ public Builder setKonbini(Konbini konbini) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(PaymentIntentUpdateParams.PaymentMethodData.Link link) { this.link = link; return this; } @@ -1368,7 +1376,7 @@ public Builder putAllMetadata(Map map) { * If this is an {@code oxxo} PaymentMethod, this hash contains details about the OXXO payment * method. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(PaymentIntentUpdateParams.PaymentMethodData.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -1377,7 +1385,7 @@ public Builder setOxxo(Oxxo oxxo) { * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment * method. */ - public Builder setP24(P24 p24) { + public Builder setP24(PaymentIntentUpdateParams.PaymentMethodData.P24 p24) { this.p24 = p24; return this; } @@ -1386,7 +1394,7 @@ public Builder setP24(P24 p24) { * If this is a {@code paynow} PaymentMethod, this hash contains details about the PayNow * payment method. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(PaymentIntentUpdateParams.PaymentMethodData.Paynow paynow) { this.paynow = paynow; return this; } @@ -1395,7 +1403,7 @@ public Builder setPaynow(Paynow paynow) { * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. */ - public Builder setPix(Pix pix) { + public Builder setPix(PaymentIntentUpdateParams.PaymentMethodData.Pix pix) { this.pix = pix; return this; } @@ -1404,7 +1412,7 @@ public Builder setPix(Pix pix) { * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay(PaymentIntentUpdateParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1413,7 +1421,8 @@ public Builder setPromptpay(Promptpay promptpay) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions( + PaymentIntentUpdateParams.PaymentMethodData.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -1422,7 +1431,7 @@ public Builder setRadarOptions(RadarOptions radarOptions) { * If this is a {@code sepa_debit} PaymentMethod, this hash contains details about the SEPA * debit bank account. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(PaymentIntentUpdateParams.PaymentMethodData.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -1431,7 +1440,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code sofort} PaymentMethod, this hash contains details about the SOFORT * payment method. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(PaymentIntentUpdateParams.PaymentMethodData.Sofort sofort) { this.sofort = sofort; return this; } @@ -1441,7 +1450,7 @@ public Builder setSofort(Sofort sofort) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(PaymentIntentUpdateParams.PaymentMethodData.Type type) { this.type = type; return this; } @@ -1450,7 +1459,8 @@ public Builder setType(Type type) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + PaymentIntentUpdateParams.PaymentMethodData.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -1459,7 +1469,7 @@ public Builder setUsBankAccount(UsBankAccount usBankAccount) { * If this is an {@code wechat_pay} PaymentMethod, this hash contains details about the * wechat_pay payment method. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay(PaymentIntentUpdateParams.PaymentMethodData.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -1513,8 +1523,8 @@ public static class Builder { private Object transitNumber; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public PaymentIntentUpdateParams.PaymentMethodData.AcssDebit build() { + return new PaymentIntentUpdateParams.PaymentMethodData.AcssDebit( this.accountNumber, this.extraParams, this.institutionNumber, this.transitNumber); } @@ -1607,8 +1617,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Affirm build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Affirm(this.extraParams); } /** @@ -1664,8 +1674,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.AfterpayClearpay build() { + return new PaymentIntentUpdateParams.PaymentMethodData.AfterpayClearpay(this.extraParams); } /** @@ -1721,8 +1731,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Alipay build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Alipay(this.extraParams); } /** @@ -1792,8 +1802,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.accountNumber, this.bsbNumber, this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.AuBecsDebit build() { + return new PaymentIntentUpdateParams.PaymentMethodData.AuBecsDebit( + this.accountNumber, this.bsbNumber, this.extraParams); } /** The account number for the bank account. */ @@ -1887,8 +1898,9 @@ public static class Builder { private Object sortCode; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.accountNumber, this.extraParams, this.sortCode); + public PaymentIntentUpdateParams.PaymentMethodData.BacsDebit build() { + return new PaymentIntentUpdateParams.PaymentMethodData.BacsDebit( + this.accountNumber, this.extraParams, this.sortCode); } /** Account number of the bank account that the funds will be debited from. */ @@ -1968,8 +1980,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Bancontact build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Bancontact(this.extraParams); } /** @@ -2058,13 +2070,14 @@ public static class Builder { private Object phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public PaymentIntentUpdateParams.PaymentMethodData.BillingDetails build() { + return new PaymentIntentUpdateParams.PaymentMethodData.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress( + PaymentIntentUpdateParams.PaymentMethodData.BillingDetails.Address address) { this.address = address; return this; } @@ -2216,8 +2229,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public PaymentIntentUpdateParams.PaymentMethodData.BillingDetails.Address build() { + return new PaymentIntentUpdateParams.PaymentMethodData.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -2361,8 +2374,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Blik build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Blik(this.extraParams); } /** @@ -2427,8 +2440,9 @@ public static class Builder { private Object taxId; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.extraParams, this.taxId); + public PaymentIntentUpdateParams.PaymentMethodData.Boleto build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Boleto( + this.extraParams, this.taxId); } /** @@ -2502,8 +2516,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.CustomerBalance build() { + return new PaymentIntentUpdateParams.PaymentMethodData.CustomerBalance(this.extraParams); } /** @@ -2566,12 +2580,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.bank, this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Eps build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Eps(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentUpdateParams.PaymentMethodData.Eps.Bank bank) { this.bank = bank; return this; } @@ -2736,18 +2750,20 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.accountHolderType, this.bank, this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Fpx build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Fpx( + this.accountHolderType, this.bank, this.extraParams); } /** Account holder type for FPX transaction. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + PaymentIntentUpdateParams.PaymentMethodData.Fpx.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentUpdateParams.PaymentMethodData.Fpx.Bank bank) { this.bank = bank; return this; } @@ -2892,8 +2908,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Giropay build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Giropay(this.extraParams); } /** @@ -2949,8 +2965,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Grabpay build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Grabpay(this.extraParams); } /** @@ -3013,12 +3029,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.bank, this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Ideal build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Ideal(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentUpdateParams.PaymentMethodData.Ideal.Bank bank) { this.bank = bank; return this; } @@ -3124,8 +3140,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.InteracPresent build() { + return new PaymentIntentUpdateParams.PaymentMethodData.InteracPresent(this.extraParams); } /** @@ -3188,12 +3204,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.dob, this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Klarna build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Klarna(this.dob, this.extraParams); } /** Customer's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(PaymentIntentUpdateParams.PaymentMethodData.Klarna.Dob dob) { this.dob = dob; return this; } @@ -3272,8 +3288,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public PaymentIntentUpdateParams.PaymentMethodData.Klarna.Dob build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Klarna.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -3348,8 +3365,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Konbini build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Konbini(this.extraParams); } /** @@ -3405,8 +3422,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Link build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Link(this.extraParams); } /** @@ -3462,8 +3479,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Oxxo build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Oxxo(this.extraParams); } /** @@ -3526,12 +3543,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.bank, this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.P24 build() { + return new PaymentIntentUpdateParams.PaymentMethodData.P24(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentIntentUpdateParams.PaymentMethodData.P24.Bank bank) { this.bank = bank; return this; } @@ -3673,8 +3690,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Paynow build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Paynow(this.extraParams); } /** @@ -3730,8 +3747,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pix build() { - return new Pix(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Pix build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Pix(this.extraParams); } /** @@ -3787,8 +3804,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Promptpay build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Promptpay(this.extraParams); } /** @@ -3855,8 +3872,9 @@ public static class Builder { private Object session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public PaymentIntentUpdateParams.PaymentMethodData.RadarOptions build() { + return new PaymentIntentUpdateParams.PaymentMethodData.RadarOptions( + this.extraParams, this.session); } /** @@ -3939,8 +3957,9 @@ public static class Builder { private Object iban; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.iban); + public PaymentIntentUpdateParams.PaymentMethodData.SepaDebit build() { + return new PaymentIntentUpdateParams.PaymentMethodData.SepaDebit( + this.extraParams, this.iban); } /** @@ -4015,12 +4034,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.country, this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.Sofort build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Sofort( + this.country, this.extraParams); } /** Two-letter ISO code representing the country the bank account is located in. */ - public Builder setCountry(Country country) { + public Builder setCountry( + PaymentIntentUpdateParams.PaymentMethodData.Sofort.Country country) { this.country = country; return this; } @@ -4146,8 +4167,8 @@ public static class Builder { private Object routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public PaymentIntentUpdateParams.PaymentMethodData.UsBankAccount build() { + return new PaymentIntentUpdateParams.PaymentMethodData.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -4157,7 +4178,9 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + PaymentIntentUpdateParams.PaymentMethodData.UsBankAccount.AccountHolderType + accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -4175,7 +4198,8 @@ public Builder setAccountNumber(EmptyParam accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + PaymentIntentUpdateParams.PaymentMethodData.UsBankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -4287,8 +4311,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodData.WechatPay build() { + return new PaymentIntentUpdateParams.PaymentMethodData.WechatPay(this.extraParams); } /** @@ -4763,8 +4787,8 @@ public static class Builder { private Object wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public PaymentIntentUpdateParams.PaymentMethodOptions build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -4802,7 +4826,8 @@ public PaymentMethodOptions build() { * If this is a {@code acss_debit} PaymentMethod, this sub-hash contains details about the * ACSS Debit payment method options. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -4820,7 +4845,7 @@ public Builder setAcssDebit(EmptyParam acssDebit) { * If this is an {@code affirm} PaymentMethod, this sub-hash contains details about the Affirm * payment method options. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(PaymentIntentUpdateParams.PaymentMethodOptions.Affirm affirm) { this.affirm = affirm; return this; } @@ -4838,7 +4863,8 @@ public Builder setAffirm(EmptyParam affirm) { * If this is a {@code afterpay_clearpay} PaymentMethod, this sub-hash contains details about * the Afterpay Clearpay payment method options. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + PaymentIntentUpdateParams.PaymentMethodOptions.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -4856,7 +4882,7 @@ public Builder setAfterpayClearpay(EmptyParam afterpayClearpay) { * If this is a {@code alipay} PaymentMethod, this sub-hash contains details about the Alipay * payment method options. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(PaymentIntentUpdateParams.PaymentMethodOptions.Alipay alipay) { this.alipay = alipay; return this; } @@ -4874,7 +4900,8 @@ public Builder setAlipay(EmptyParam alipay) { * If this is a {@code au_becs_debit} PaymentMethod, this sub-hash contains details about the * AU BECS Direct Debit payment method options. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + PaymentIntentUpdateParams.PaymentMethodOptions.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -4892,7 +4919,8 @@ public Builder setAuBecsDebit(EmptyParam auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this sub-hash contains details about the * BACS Debit payment method options. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit( + PaymentIntentUpdateParams.PaymentMethodOptions.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -4910,7 +4938,8 @@ public Builder setBacsDebit(EmptyParam bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the * Bancontact payment method options. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + PaymentIntentUpdateParams.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -4928,7 +4957,7 @@ public Builder setBancontact(EmptyParam bancontact) { * If this is a {@code blik} PaymentMethod, this sub-hash contains details about the BLIK * payment method options. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(PaymentIntentUpdateParams.PaymentMethodOptions.Blik blik) { this.blik = blik; return this; } @@ -4946,7 +4975,7 @@ public Builder setBlik(EmptyParam blik) { * If this is a {@code boleto} PaymentMethod, this sub-hash contains details about the Boleto * payment method options. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(PaymentIntentUpdateParams.PaymentMethodOptions.Boleto boleto) { this.boleto = boleto; return this; } @@ -4961,7 +4990,7 @@ public Builder setBoleto(EmptyParam boleto) { } /** Configuration for any card payments attempted on this PaymentIntent. */ - public Builder setCard(Card card) { + public Builder setCard(PaymentIntentUpdateParams.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -4976,7 +5005,8 @@ public Builder setCard(EmptyParam card) { * If this is a {@code card_present} PaymentMethod, this sub-hash contains details about the * Card Present payment method options. */ - public Builder setCardPresent(CardPresent cardPresent) { + public Builder setCardPresent( + PaymentIntentUpdateParams.PaymentMethodOptions.CardPresent cardPresent) { this.cardPresent = cardPresent; return this; } @@ -4994,7 +5024,8 @@ public Builder setCardPresent(EmptyParam cardPresent) { * If this is a {@code customer balance} PaymentMethod, this sub-hash contains details about * the customer balance payment method options. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -5012,7 +5043,7 @@ public Builder setCustomerBalance(EmptyParam customerBalance) { * If this is a {@code eps} PaymentMethod, this sub-hash contains details about the EPS * payment method options. */ - public Builder setEps(Eps eps) { + public Builder setEps(PaymentIntentUpdateParams.PaymentMethodOptions.Eps eps) { this.eps = eps; return this; } @@ -5057,7 +5088,7 @@ public Builder putAllExtraParam(Map map) { * If this is a {@code fpx} PaymentMethod, this sub-hash contains details about the FPX * payment method options. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(PaymentIntentUpdateParams.PaymentMethodOptions.Fpx fpx) { this.fpx = fpx; return this; } @@ -5075,7 +5106,7 @@ public Builder setFpx(EmptyParam fpx) { * If this is a {@code giropay} PaymentMethod, this sub-hash contains details about the * Giropay payment method options. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(PaymentIntentUpdateParams.PaymentMethodOptions.Giropay giropay) { this.giropay = giropay; return this; } @@ -5093,7 +5124,7 @@ public Builder setGiropay(EmptyParam giropay) { * If this is a {@code grabpay} PaymentMethod, this sub-hash contains details about the * Grabpay payment method options. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(PaymentIntentUpdateParams.PaymentMethodOptions.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -5111,7 +5142,7 @@ public Builder setGrabpay(EmptyParam grabpay) { * If this is a {@code ideal} PaymentMethod, this sub-hash contains details about the Ideal * payment method options. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(PaymentIntentUpdateParams.PaymentMethodOptions.Ideal ideal) { this.ideal = ideal; return this; } @@ -5129,7 +5160,8 @@ public Builder setIdeal(EmptyParam ideal) { * If this is a {@code interac_present} PaymentMethod, this sub-hash contains details about * the Card Present payment method options. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + PaymentIntentUpdateParams.PaymentMethodOptions.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -5147,7 +5179,7 @@ public Builder setInteracPresent(EmptyParam interacPresent) { * If this is a {@code klarna} PaymentMethod, this sub-hash contains details about the Klarna * payment method options. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(PaymentIntentUpdateParams.PaymentMethodOptions.Klarna klarna) { this.klarna = klarna; return this; } @@ -5165,7 +5197,7 @@ public Builder setKlarna(EmptyParam klarna) { * If this is a {@code konbini} PaymentMethod, this sub-hash contains details about the * Konbini payment method options. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(PaymentIntentUpdateParams.PaymentMethodOptions.Konbini konbini) { this.konbini = konbini; return this; } @@ -5183,7 +5215,7 @@ public Builder setKonbini(EmptyParam konbini) { * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. */ - public Builder setLink(Link link) { + public Builder setLink(PaymentIntentUpdateParams.PaymentMethodOptions.Link link) { this.link = link; return this; } @@ -5201,7 +5233,7 @@ public Builder setLink(EmptyParam link) { * If this is a {@code oxxo} PaymentMethod, this sub-hash contains details about the OXXO * payment method options. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(PaymentIntentUpdateParams.PaymentMethodOptions.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -5219,7 +5251,7 @@ public Builder setOxxo(EmptyParam oxxo) { * If this is a {@code p24} PaymentMethod, this sub-hash contains details about the Przelewy24 * payment method options. */ - public Builder setP24(P24 p24) { + public Builder setP24(PaymentIntentUpdateParams.PaymentMethodOptions.P24 p24) { this.p24 = p24; return this; } @@ -5237,7 +5269,7 @@ public Builder setP24(EmptyParam p24) { * If this is a {@code paynow} PaymentMethod, this sub-hash contains details about the PayNow * payment method options. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(PaymentIntentUpdateParams.PaymentMethodOptions.Paynow paynow) { this.paynow = paynow; return this; } @@ -5255,7 +5287,7 @@ public Builder setPaynow(EmptyParam paynow) { * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix * payment method options. */ - public Builder setPix(Pix pix) { + public Builder setPix(PaymentIntentUpdateParams.PaymentMethodOptions.Pix pix) { this.pix = pix; return this; } @@ -5273,7 +5305,8 @@ public Builder setPix(EmptyParam pix) { * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay( + PaymentIntentUpdateParams.PaymentMethodOptions.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -5291,7 +5324,8 @@ public Builder setPromptpay(EmptyParam promptpay) { * If this is a {@code sepa_debit} PaymentIntent, this sub-hash contains details about the * SEPA Debit payment method options. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + PaymentIntentUpdateParams.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -5309,7 +5343,7 @@ public Builder setSepaDebit(EmptyParam sepaDebit) { * If this is a {@code sofort} PaymentMethod, this sub-hash contains details about the SOFORT * payment method options. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(PaymentIntentUpdateParams.PaymentMethodOptions.Sofort sofort) { this.sofort = sofort; return this; } @@ -5327,7 +5361,8 @@ public Builder setSofort(EmptyParam sofort) { * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about * the US bank account payment method options. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -5345,7 +5380,8 @@ public Builder setUsBankAccount(EmptyParam usBankAccount) { * If this is a {@code wechat_pay} PaymentMethod, this sub-hash contains details about the * WeChat Pay payment method options. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay( + PaymentIntentUpdateParams.PaymentMethodOptions.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -5395,7 +5431,7 @@ public static class AcssDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -5404,7 +5440,7 @@ public static class AcssDebit { private AcssDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; @@ -5421,13 +5457,13 @@ public static class Builder { private MandateOptions mandateOptions; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit( this.extraParams, this.mandateOptions, this.setupFutureUsage, @@ -5463,7 +5499,9 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5488,7 +5526,9 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5519,7 +5559,9 @@ public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -5590,8 +5632,8 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions( this.customMandateUrl, this.extraParams, this.intervalDescription, @@ -5670,13 +5712,19 @@ public Builder setIntervalDescription(EmptyParam intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions + .PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions + .TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -5765,7 +5813,7 @@ public static class Affirm { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -5799,7 +5847,7 @@ public static class Affirm { SetupFutureUsage setupFutureUsage; private Affirm( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, SetupFutureUsage setupFutureUsage) { this.captureMethod = captureMethod; @@ -5812,15 +5860,16 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.captureMethod, this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Affirm build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Affirm( + this.captureMethod, this.extraParams, this.setupFutureUsage); } /** @@ -5832,7 +5881,8 @@ public Affirm build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentUpdateParams.PaymentMethodOptions.Affirm.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -5899,7 +5949,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Affirm.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5942,7 +5994,7 @@ public static class AfterpayClearpay { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -5985,7 +6037,7 @@ public static class AfterpayClearpay { SetupFutureUsage setupFutureUsage; private AfterpayClearpay( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, Object reference, SetupFutureUsage setupFutureUsage) { @@ -6000,7 +6052,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -6009,8 +6061,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay( + public PaymentIntentUpdateParams.PaymentMethodOptions.AfterpayClearpay build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.AfterpayClearpay( this.captureMethod, this.extraParams, this.reference, this.setupFutureUsage); } @@ -6023,7 +6075,9 @@ public AfterpayClearpay build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentUpdateParams.PaymentMethodOptions.AfterpayClearpay.CaptureMethod + captureMethod) { this.captureMethod = captureMethod; return this; } @@ -6114,7 +6168,9 @@ public Builder setReference(EmptyParam reference) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.AfterpayClearpay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6176,9 +6232,9 @@ public static class Alipay { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private Alipay(Map extraParams, EnumParam setupFutureUsage) { + private Alipay(Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -6190,11 +6246,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Alipay build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Alipay( + this.extraParams, this.setupFutureUsage); } /** @@ -6245,7 +6302,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Alipay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6323,9 +6382,10 @@ public static class AuBecsDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private AuBecsDebit(Map extraParams, EnumParam setupFutureUsage) { + private AuBecsDebit( + Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -6337,11 +6397,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.AuBecsDebit build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.AuBecsDebit( + this.extraParams, this.setupFutureUsage); } /** @@ -6392,7 +6453,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.AuBecsDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6473,9 +6536,10 @@ public static class BacsDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private BacsDebit(Map extraParams, EnumParam setupFutureUsage) { + private BacsDebit( + Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -6487,11 +6551,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.BacsDebit build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.BacsDebit( + this.extraParams, this.setupFutureUsage); } /** @@ -6542,7 +6607,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.BacsDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6629,12 +6696,12 @@ public static class Bancontact { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Bancontact( Map extraParams, PreferredLanguage preferredLanguage, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.preferredLanguage = preferredLanguage; this.setupFutureUsage = setupFutureUsage; @@ -6649,11 +6716,12 @@ public static class Builder { private PreferredLanguage preferredLanguage; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams, this.preferredLanguage, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Bancontact build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Bancontact( + this.extraParams, this.preferredLanguage, this.setupFutureUsage); } /** @@ -6688,7 +6756,9 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Bancontact authorization page that the customer is redirected * to. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + PaymentIntentUpdateParams.PaymentMethodOptions.Bancontact.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -6713,7 +6783,9 @@ public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Bancontact.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6814,8 +6886,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.code, this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodOptions.Blik build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Blik( + this.code, this.extraParams); } /** @@ -6905,10 +6978,12 @@ public static class Boleto { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Boleto( - Long expiresAfterDays, Map extraParams, EnumParam setupFutureUsage) { + Long expiresAfterDays, + Map extraParams, + ApiRequestParams.EnumParam setupFutureUsage) { this.expiresAfterDays = expiresAfterDays; this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; @@ -6923,11 +6998,12 @@ public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.expiresAfterDays, this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Boleto build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Boleto( + this.expiresAfterDays, this.extraParams, this.setupFutureUsage); } /** @@ -6988,7 +7064,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Boleto.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7050,7 +7128,7 @@ public static class Card { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * A single-use {@code cvc_update} Token that represents a card CVC value. When provided, the @@ -7131,7 +7209,7 @@ public static class Card { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** * Provides information about a card payment that customers see on their statements. @@ -7154,7 +7232,7 @@ public static class Card { Object statementDescriptorSuffixKanji; private Card( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Object cvcToken, Map extraParams, Installments installments, @@ -7162,7 +7240,7 @@ private Card( Boolean moto, Network network, RequestThreeDSecure requestThreeDSecure, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, Object statementDescriptorSuffixKana, Object statementDescriptorSuffixKanji) { this.captureMethod = captureMethod; @@ -7183,7 +7261,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Object cvcToken; @@ -7199,15 +7277,15 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private Object statementDescriptorSuffixKana; private Object statementDescriptorSuffixKanji; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public PaymentIntentUpdateParams.PaymentMethodOptions.Card build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Card( this.captureMethod, this.cvcToken, this.extraParams, @@ -7230,7 +7308,8 @@ public Card build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -7303,13 +7382,15 @@ public Builder putAllExtraParam(Map map) { *

For more information, see the installments integration guide. */ - public Builder setInstallments(Installments installments) { + public Builder setInstallments( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.Installments installments) { this.installments = installments; return this; } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -7328,7 +7409,8 @@ public Builder setMoto(Boolean moto) { * Selected network to process this PaymentIntent on. Depends on the available networks of * the card attached to the PaymentIntent. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -7344,7 +7426,9 @@ public Builder setNetwork(Network network) { * Secure for more information on how this configuration interacts with Radar and our * SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -7369,7 +7453,8 @@ public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7494,8 +7579,9 @@ public static class Builder { private Object plan; /** Finalize and obtain parameter instance from this builder. */ - public Installments build() { - return new Installments(this.enabled, this.extraParams, this.plan); + public PaymentIntentUpdateParams.PaymentMethodOptions.Card.Installments build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Card.Installments( + this.enabled, this.extraParams, this.plan); } /** @@ -7542,7 +7628,8 @@ public Builder putAllExtraParam(Map map) { * The selected installment plan to use for this payment attempt. This parameter can only * be provided during confirmation. */ - public Builder setPlan(Plan plan) { + public Builder setPlan( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.Installments.Plan plan) { this.plan = plan; return this; } @@ -7608,8 +7695,9 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Plan build() { - return new Plan(this.count, this.extraParams, this.interval, this.type); + public PaymentIntentUpdateParams.PaymentMethodOptions.Card.Installments.Plan build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Card.Installments.Plan( + this.count, this.extraParams, this.interval, this.type); } /** @@ -7655,13 +7743,16 @@ public Builder putAllExtraParam(Map map) { * For {@code fixed_count} installment plans, this is the interval between installment * payments your customer will make to their credit card. One of {@code month}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.Installments.Plan.Interval + interval) { this.interval = interval; return this; } /** Type of installment plan, one of {@code fixed_count}. */ - public Builder setType(Type type) { + public Builder setType( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.Installments.Plan.Type type) { this.type = type; return this; } @@ -7760,7 +7851,8 @@ public static class MandateOptions { /** Specifies the type of mandates supported. Possible values are {@code india}. */ @SerializedName("supported_types") - List supportedTypes; + List + supportedTypes; private MandateOptions( Long amount, @@ -7772,7 +7864,8 @@ private MandateOptions( Long intervalCount, Object reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.description = description; @@ -7808,11 +7901,13 @@ public static class Builder { private Long startDate; - private List supportedTypes; + private List< + PaymentIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType> + supportedTypes; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public PaymentIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions( this.amount, this.amountType, this.description, @@ -7836,7 +7931,9 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.AmountType + amountType) { this.amountType = amountType; return this; } @@ -7902,7 +7999,9 @@ public Builder putAllExtraParam(Map map) { * Specifies payment frequency. One of {@code day}, {@code week}, {@code month}, {@code * year}, or {@code sporadic}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.Interval + interval) { this.interval = interval; return this; } @@ -7946,7 +8045,9 @@ public Builder setStartDate(Long startDate) { * PaymentIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addSupportedType(SupportedType element) { + public Builder addSupportedType( + PaymentIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType + element) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -7961,7 +8062,9 @@ public Builder addSupportedType(SupportedType element) { * PaymentIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addAllSupportedType(List elements) { + public Builder addAllSupportedType( + List + elements) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -8158,8 +8261,8 @@ public static class Builder { private Boolean requestIncrementalAuthorizationSupport; /** Finalize and obtain parameter instance from this builder. */ - public CardPresent build() { - return new CardPresent( + public PaymentIntentUpdateParams.PaymentMethodOptions.CardPresent build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.CardPresent( this.extraParams, this.requestExtendedAuthorization, this.requestIncrementalAuthorizationSupport); @@ -8291,8 +8394,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance( + public PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance( this.bankTransfer, this.extraParams, this.fundingType, this.setupFutureUsage); } @@ -8300,7 +8403,9 @@ public CustomerBalance build() { * Configuration for the bank transfer funding type, if the {@code funding_type} is set to * {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -8339,7 +8444,9 @@ public Builder putAllExtraParam(Map map) { * The funding method type to be used when there are not enough funds in the customer * balance. Permitted values include: {@code bank_transfer}. */ - public Builder setFundingType(FundingType fundingType) { + public Builder setFundingType( + PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.FundingType + fundingType) { this.fundingType = fundingType; return this; } @@ -8364,7 +8471,9 @@ public Builder setFundingType(FundingType fundingType) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -8393,7 +8502,10 @@ public static class BankTransfer { * spei}. */ @SerializedName("requested_address_types") - List requestedAddressTypes; + List< + PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes; /** * The list of bank transfer types that this PaymentIntent is allowed to use for funding @@ -8406,7 +8518,10 @@ public static class BankTransfer { private BankTransfer( EuBankTransfer euBankTransfer, Map extraParams, - List requestedAddressTypes, + List< + PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes, Type type) { this.euBankTransfer = euBankTransfer; this.extraParams = extraParams; @@ -8423,17 +8538,24 @@ public static class Builder { private Map extraParams; - private List requestedAddressTypes; + private List< + PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes; private Type type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer( + public PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer( this.euBankTransfer, this.extraParams, this.requestedAddressTypes, this.type); } - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -8475,7 +8597,10 @@ public Builder putAllExtraParam(Map map) { * PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addRequestedAddressType(RequestedAddressType element) { + public Builder addRequestedAddressType( + PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType + element) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -8490,7 +8615,11 @@ public Builder addRequestedAddressType(RequestedAddressType element) { * PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addAllRequestedAddressType(List elements) { + public Builder addAllRequestedAddressType( + List< + PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + elements) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -8503,7 +8632,9 @@ public Builder addAllRequestedAddressType(List elements) { * Permitted values include: {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code * jp_bank_transfer}, or {@code mx_bank_transfer}. */ - public Builder setType(Type type) { + public Builder setType( + PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.Type + type) { this.type = type; return this; } @@ -8543,8 +8674,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer + build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer(this.country, this.extraParams); } /** @@ -8716,8 +8850,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Eps build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Eps( + this.extraParams, this.setupFutureUsage); } /** @@ -8768,7 +8903,8 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Eps.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -8835,8 +8971,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Fpx build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Fpx( + this.extraParams, this.setupFutureUsage); } /** @@ -8887,7 +9024,8 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Fpx.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -8954,8 +9092,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Giropay build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Giropay( + this.extraParams, this.setupFutureUsage); } /** @@ -9006,7 +9145,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Giropay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9073,8 +9214,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Grabpay build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Grabpay( + this.extraParams, this.setupFutureUsage); } /** @@ -9125,7 +9267,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Grabpay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9175,9 +9319,9 @@ public static class Ideal { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private Ideal(Map extraParams, EnumParam setupFutureUsage) { + private Ideal(Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -9189,11 +9333,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Ideal build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Ideal( + this.extraParams, this.setupFutureUsage); } /** @@ -9244,7 +9389,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Ideal.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9314,8 +9461,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodOptions.InteracPresent build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.InteracPresent( + this.extraParams); } /** @@ -9362,7 +9510,7 @@ public static class Klarna { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -9400,7 +9548,7 @@ public static class Klarna { SetupFutureUsage setupFutureUsage; private Klarna( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, PreferredLocale preferredLocale, SetupFutureUsage setupFutureUsage) { @@ -9415,7 +9563,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -9424,8 +9572,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna( + public PaymentIntentUpdateParams.PaymentMethodOptions.Klarna build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Klarna( this.captureMethod, this.extraParams, this.preferredLocale, this.setupFutureUsage); } @@ -9438,7 +9586,8 @@ public Klarna build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -9488,7 +9637,8 @@ public Builder putAllExtraParam(Map map) { /** * Preferred language of the Klarna authorization page that the customer is redirected to. */ - public Builder setPreferredLocale(PreferredLocale preferredLocale) { + public Builder setPreferredLocale( + PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.PreferredLocale preferredLocale) { this.preferredLocale = preferredLocale; return this; } @@ -9513,7 +9663,9 @@ public Builder setPreferredLocale(PreferredLocale preferredLocale) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9770,8 +9922,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini( + public PaymentIntentUpdateParams.PaymentMethodOptions.Konbini build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Konbini( this.confirmationNumber, this.expiresAfterDays, this.expiresAt, @@ -9906,7 +10058,9 @@ public Builder setProductDescription(EmptyParam productDescription) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Konbini.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -9937,7 +10091,7 @@ public static class Link { * for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -9972,13 +10126,13 @@ public static class Link { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Link( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, Object persistentToken, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.captureMethod = captureMethod; this.extraParams = extraParams; this.persistentToken = persistentToken; @@ -9990,17 +10144,17 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; private Object persistentToken; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link( + public PaymentIntentUpdateParams.PaymentMethodOptions.Link build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Link( this.captureMethod, this.extraParams, this.persistentToken, this.setupFutureUsage); } @@ -10013,7 +10167,8 @@ public Link build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentIntentUpdateParams.PaymentMethodOptions.Link.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -10092,7 +10247,8 @@ public Builder setPersistentToken(EmptyParam persistentToken) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Link.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10213,8 +10369,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.expiresAfterDays, this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Oxxo build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Oxxo( + this.expiresAfterDays, this.extraParams, this.setupFutureUsage); } /** @@ -10275,7 +10432,8 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Oxxo.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10352,8 +10510,9 @@ public static class Builder { private Boolean tosShownAndAccepted; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); + public PaymentIntentUpdateParams.PaymentMethodOptions.P24 build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.P24( + this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); } /** @@ -10404,7 +10563,8 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.P24.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10477,8 +10637,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Paynow build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Paynow( + this.extraParams, this.setupFutureUsage); } /** @@ -10529,7 +10690,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Paynow.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10591,8 +10754,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pix build() { - return new Pix(this.expiresAfterSeconds, this.expiresAt, this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodOptions.Pix build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Pix( + this.expiresAfterSeconds, this.expiresAt, this.extraParams); } /** @@ -10691,8 +10855,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Promptpay build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Promptpay( + this.extraParams, this.setupFutureUsage); } /** @@ -10743,7 +10908,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Promptpay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10797,12 +10964,12 @@ public static class SepaDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private SepaDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; this.setupFutureUsage = setupFutureUsage; @@ -10817,11 +10984,12 @@ public static class Builder { private MandateOptions mandateOptions; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.mandateOptions, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.SepaDebit build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.SepaDebit( + this.extraParams, this.mandateOptions, this.setupFutureUsage); } /** @@ -10853,7 +11021,9 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + PaymentIntentUpdateParams.PaymentMethodOptions.SepaDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -10878,7 +11048,9 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.SepaDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -10933,8 +11105,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams); + public PaymentIntentUpdateParams.PaymentMethodOptions.SepaDebit.MandateOptions build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.SepaDebit.MandateOptions( + this.extraParams); } /** @@ -11001,7 +11174,7 @@ public static class Sofort { /** Language shown to the payer on redirect. */ @SerializedName("preferred_language") - EnumParam preferredLanguage; + ApiRequestParams.EnumParam preferredLanguage; /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -11023,12 +11196,12 @@ public static class Sofort { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Sofort( Map extraParams, - EnumParam preferredLanguage, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam preferredLanguage, + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.preferredLanguage = preferredLanguage; this.setupFutureUsage = setupFutureUsage; @@ -11041,13 +11214,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam preferredLanguage; + private ApiRequestParams.EnumParam preferredLanguage; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.extraParams, this.preferredLanguage, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.Sofort build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Sofort( + this.extraParams, this.preferredLanguage, this.setupFutureUsage); } /** @@ -11079,7 +11253,9 @@ public Builder putAllExtraParam(Map map) { } /** Language shown to the payer on redirect. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + PaymentIntentUpdateParams.PaymentMethodOptions.Sofort.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -11110,7 +11286,9 @@ public Builder setPreferredLanguage(EmptyParam preferredLanguage) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Sofort.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -11226,7 +11404,7 @@ public static class UsBankAccount { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -11236,7 +11414,7 @@ private UsBankAccount( Map extraParams, FinancialConnections financialConnections, Networks networks, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.financialConnections = financialConnections; @@ -11256,13 +11434,13 @@ public static class Builder { private Networks networks; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.networks, @@ -11299,13 +11477,16 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Additional fields for network related functions. */ - public Builder setNetworks(Networks networks) { + public Builder setNetworks( + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks networks) { this.networks = networks; return this; } @@ -11330,7 +11511,9 @@ public Builder setNetworks(Networks networks) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -11361,7 +11544,9 @@ public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -11385,7 +11570,10 @@ public static class FinancialConnections { * {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; /** * For webview integrations only. Upon completing OAuth login in the native browser, the @@ -11395,7 +11583,12 @@ public static class FinancialConnections { Object returnUrl; private FinancialConnections( - Map extraParams, List permissions, Object returnUrl) { + Map extraParams, + List< + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions, + Object returnUrl) { this.extraParams = extraParams; this.permissions = permissions; this.returnUrl = returnUrl; @@ -11408,13 +11601,18 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; private Object returnUrl; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions, this.returnUrl); + public PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions, this.returnUrl); } /** @@ -11453,7 +11651,10 @@ public Builder putAllExtraParam(Map map) { * PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -11468,7 +11669,11 @@ public Builder addPermission(Permission element) { * PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -11531,9 +11736,13 @@ public static class Networks { /** Triggers validations to run across the selected networks. */ @SerializedName("requested") - List requested; + List + requested; - private Networks(Map extraParams, List requested) { + private Networks( + Map extraParams, + List + requested) { this.extraParams = extraParams; this.requested = requested; } @@ -11545,11 +11754,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List requested; + private List< + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested> + requested; /** Finalize and obtain parameter instance from this builder. */ - public Networks build() { - return new Networks(this.extraParams, this.requested); + public PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks( + this.extraParams, this.requested); } /** @@ -11588,7 +11800,9 @@ public Builder putAllExtraParam(Map map) { * PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for * the field documentation. */ - public Builder addRequested(Requested element) { + public Builder addRequested( + PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested + element) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -11602,7 +11816,9 @@ public Builder addRequested(Requested element) { * PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for * the field documentation. */ - public Builder addAllRequested(List elements) { + public Builder addAllRequested( + List + elements) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -11730,8 +11946,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.appId, this.client, this.extraParams, this.setupFutureUsage); + public PaymentIntentUpdateParams.PaymentMethodOptions.WechatPay build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.WechatPay( + this.appId, this.client, this.extraParams, this.setupFutureUsage); } /** The app ID registered with WeChat Pay. Only required when client is ios or android. */ @@ -11747,7 +11964,8 @@ public Builder setAppId(EmptyParam appId) { } /** The client type that the end customer will pay from. */ - public Builder setClient(Client client) { + public Builder setClient( + PaymentIntentUpdateParams.PaymentMethodOptions.WechatPay.Client client) { this.client = client; return this; } @@ -11800,7 +12018,9 @@ public Builder putAllExtraParam(Map map) { * publishable key, you may only update the value from {@code on_session} to {@code * off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.WechatPay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -11905,8 +12125,8 @@ public static class Builder { private Object trackingNumber; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping( + public PaymentIntentUpdateParams.Shipping build() { + return new PaymentIntentUpdateParams.Shipping( this.address, this.carrier, this.extraParams, @@ -11916,7 +12136,7 @@ public Shipping build() { } /** Shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(PaymentIntentUpdateParams.Shipping.Address address) { this.address = address; return this; } @@ -12077,8 +12297,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public PaymentIntentUpdateParams.Shipping.Address build() { + return new PaymentIntentUpdateParams.Shipping.Address( this.city, this.country, this.extraParams, @@ -12227,8 +12447,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.extraParams); + public PaymentIntentUpdateParams.TransferData build() { + return new PaymentIntentUpdateParams.TransferData(this.amount, this.extraParams); } /** The amount that will be transferred automatically when a charge succeeds. */ diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 3d4abfdf3ce..d236dc39fa4 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -83,7 +83,7 @@ public class PaymentLinkCreateParams extends ApiRequestParams { * Up to 20 line items are supported. */ @SerializedName("line_items") - List lineItems; + List lineItems; /** * Set of key-value pairs that you can attach @@ -130,7 +130,7 @@ public class PaymentLinkCreateParams extends ApiRequestParams { * href="https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support">supported). */ @SerializedName("payment_method_types") - List paymentMethodTypes; + List paymentMethodTypes; /** * Controls phone number collection settings during checkout. @@ -150,7 +150,7 @@ public class PaymentLinkCreateParams extends ApiRequestParams { * payment link. */ @SerializedName("shipping_options") - List shippingOptions; + List shippingOptions; /** * Describes the type of transaction being performed in order to customize relevant text on the @@ -191,15 +191,15 @@ private PaymentLinkCreateParams( CustomerCreation customerCreation, List expand, Map extraParams, - List lineItems, + List lineItems, Map metadata, String onBehalfOf, PaymentIntentData paymentIntentData, PaymentMethodCollection paymentMethodCollection, - List paymentMethodTypes, + List paymentMethodTypes, PhoneNumberCollection phoneNumberCollection, ShippingAddressCollection shippingAddressCollection, - List shippingOptions, + List shippingOptions, SubmitType submitType, SubscriptionData subscriptionData, TaxIdCollection taxIdCollection, @@ -257,7 +257,7 @@ public static class Builder { private Map extraParams; - private List lineItems; + private List lineItems; private Map metadata; @@ -267,13 +267,13 @@ public static class Builder { private PaymentMethodCollection paymentMethodCollection; - private List paymentMethodTypes; + private List paymentMethodTypes; private PhoneNumberCollection phoneNumberCollection; private ShippingAddressCollection shippingAddressCollection; - private List shippingOptions; + private List shippingOptions; private SubmitType submitType; @@ -313,7 +313,7 @@ public PaymentLinkCreateParams build() { } /** Behavior after the purchase is complete. */ - public Builder setAfterCompletion(AfterCompletion afterCompletion) { + public Builder setAfterCompletion(PaymentLinkCreateParams.AfterCompletion afterCompletion) { this.afterCompletion = afterCompletion; return this; } @@ -346,19 +346,21 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { } /** Configuration for automatic tax collection. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(PaymentLinkCreateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } /** Configuration for collecting the customer's billing address. */ - public Builder setBillingAddressCollection(BillingAddressCollection billingAddressCollection) { + public Builder setBillingAddressCollection( + PaymentLinkCreateParams.BillingAddressCollection billingAddressCollection) { this.billingAddressCollection = billingAddressCollection; return this; } /** Configure fields to gather active consent from customers. */ - public Builder setConsentCollection(ConsentCollection consentCollection) { + public Builder setConsentCollection( + PaymentLinkCreateParams.ConsentCollection consentCollection) { this.consentCollection = consentCollection; return this; } @@ -378,7 +380,7 @@ public Builder setCurrency(String currency) { * sessions created by this payment link create a Customer. */ - public Builder setCustomerCreation(CustomerCreation customerCreation) { + public Builder setCustomerCreation(PaymentLinkCreateParams.CustomerCreation customerCreation) { this.customerCreation = customerCreation; return this; } @@ -440,7 +442,7 @@ public Builder putAllExtraParam(Map map) { * and subsequent calls adds additional elements to the original list. See {@link * PaymentLinkCreateParams#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(PaymentLinkCreateParams.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -453,7 +455,7 @@ public Builder addLineItem(LineItem element) { * and subsequent calls adds additional elements to the original list. See {@link * PaymentLinkCreateParams#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -497,7 +499,8 @@ public Builder setOnBehalfOf(String onBehalfOf) { * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code * payment} mode. */ - public Builder setPaymentIntentData(PaymentIntentData paymentIntentData) { + public Builder setPaymentIntentData( + PaymentLinkCreateParams.PaymentIntentData paymentIntentData) { this.paymentIntentData = paymentIntentData; return this; } @@ -513,7 +516,8 @@ public Builder setPaymentIntentData(PaymentIntentData paymentIntentData) { * guide on configuring * subscriptions with a free trial. */ - public Builder setPaymentMethodCollection(PaymentMethodCollection paymentMethodCollection) { + public Builder setPaymentMethodCollection( + PaymentLinkCreateParams.PaymentMethodCollection paymentMethodCollection) { this.paymentMethodCollection = paymentMethodCollection; return this; } @@ -523,7 +527,7 @@ public Builder setPaymentMethodCollection(PaymentMethodCollection paymentMethodC * call, and subsequent calls adds additional elements to the original list. See {@link * PaymentLinkCreateParams#paymentMethodTypes} for the field documentation. */ - public Builder addPaymentMethodType(PaymentMethodType element) { + public Builder addPaymentMethodType(PaymentLinkCreateParams.PaymentMethodType element) { if (this.paymentMethodTypes == null) { this.paymentMethodTypes = new ArrayList<>(); } @@ -536,7 +540,8 @@ public Builder addPaymentMethodType(PaymentMethodType element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link PaymentLinkCreateParams#paymentMethodTypes} for the field documentation. */ - public Builder addAllPaymentMethodType(List elements) { + public Builder addAllPaymentMethodType( + List elements) { if (this.paymentMethodTypes == null) { this.paymentMethodTypes = new ArrayList<>(); } @@ -549,14 +554,15 @@ public Builder addAllPaymentMethodType(List elements) { * *

We recommend that you review your privacy policy and check with your legal contacts. */ - public Builder setPhoneNumberCollection(PhoneNumberCollection phoneNumberCollection) { + public Builder setPhoneNumberCollection( + PaymentLinkCreateParams.PhoneNumberCollection phoneNumberCollection) { this.phoneNumberCollection = phoneNumberCollection; return this; } /** Configuration for collecting the customer's shipping address. */ public Builder setShippingAddressCollection( - ShippingAddressCollection shippingAddressCollection) { + PaymentLinkCreateParams.ShippingAddressCollection shippingAddressCollection) { this.shippingAddressCollection = shippingAddressCollection; return this; } @@ -566,7 +572,7 @@ public Builder setShippingAddressCollection( * call, and subsequent calls adds additional elements to the original list. See {@link * PaymentLinkCreateParams#shippingOptions} for the field documentation. */ - public Builder addShippingOption(ShippingOption element) { + public Builder addShippingOption(PaymentLinkCreateParams.ShippingOption element) { if (this.shippingOptions == null) { this.shippingOptions = new ArrayList<>(); } @@ -579,7 +585,7 @@ public Builder addShippingOption(ShippingOption element) { * call, and subsequent calls adds additional elements to the original list. See {@link * PaymentLinkCreateParams#shippingOptions} for the field documentation. */ - public Builder addAllShippingOption(List elements) { + public Builder addAllShippingOption(List elements) { if (this.shippingOptions == null) { this.shippingOptions = new ArrayList<>(); } @@ -593,7 +599,7 @@ public Builder addAllShippingOption(List elements) { * href="https://stripe.com/docs/api/payment_links/payment_links/object#url">url property * (example: {@code donate.stripe.com}). */ - public Builder setSubmitType(SubmitType submitType) { + public Builder setSubmitType(PaymentLinkCreateParams.SubmitType submitType) { this.submitType = submitType; return this; } @@ -602,13 +608,13 @@ public Builder setSubmitType(SubmitType submitType) { * When creating a subscription, the specified configuration data will be used. There must be at * least one line item with a recurring price to use {@code subscription_data}. */ - public Builder setSubscriptionData(SubscriptionData subscriptionData) { + public Builder setSubscriptionData(PaymentLinkCreateParams.SubscriptionData subscriptionData) { this.subscriptionData = subscriptionData; return this; } /** Controls tax ID collection during checkout. */ - public Builder setTaxIdCollection(TaxIdCollection taxIdCollection) { + public Builder setTaxIdCollection(PaymentLinkCreateParams.TaxIdCollection taxIdCollection) { this.taxIdCollection = taxIdCollection; return this; } @@ -617,7 +623,7 @@ public Builder setTaxIdCollection(TaxIdCollection taxIdCollection) { * The account (if any) the payments will be attributed to for tax reporting, and where funds * from each payment will be transferred to. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(PaymentLinkCreateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -674,8 +680,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public AfterCompletion build() { - return new AfterCompletion( + public PaymentLinkCreateParams.AfterCompletion build() { + return new PaymentLinkCreateParams.AfterCompletion( this.extraParams, this.hostedConfirmation, this.redirect, this.type); } @@ -707,13 +713,14 @@ public Builder putAllExtraParam(Map map) { } /** Configuration when {@code type=hosted_confirmation}. */ - public Builder setHostedConfirmation(HostedConfirmation hostedConfirmation) { + public Builder setHostedConfirmation( + PaymentLinkCreateParams.AfterCompletion.HostedConfirmation hostedConfirmation) { this.hostedConfirmation = hostedConfirmation; return this; } /** Configuration when {@code type=redirect}. */ - public Builder setRedirect(Redirect redirect) { + public Builder setRedirect(PaymentLinkCreateParams.AfterCompletion.Redirect redirect) { this.redirect = redirect; return this; } @@ -722,7 +729,7 @@ public Builder setRedirect(Redirect redirect) { * The specified behavior after the purchase is complete. Either {@code redirect} or {@code * hosted_confirmation}. */ - public Builder setType(Type type) { + public Builder setType(PaymentLinkCreateParams.AfterCompletion.Type type) { this.type = type; return this; } @@ -758,8 +765,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public HostedConfirmation build() { - return new HostedConfirmation(this.customMessage, this.extraParams); + public PaymentLinkCreateParams.AfterCompletion.HostedConfirmation build() { + return new PaymentLinkCreateParams.AfterCompletion.HostedConfirmation( + this.customMessage, this.extraParams); } /** A custom message to display to the customer after the purchase is complete. */ @@ -833,8 +841,8 @@ public static class Builder { private String url; /** Finalize and obtain parameter instance from this builder. */ - public Redirect build() { - return new Redirect(this.extraParams, this.url); + public PaymentLinkCreateParams.AfterCompletion.Redirect build() { + return new PaymentLinkCreateParams.AfterCompletion.Redirect(this.extraParams, this.url); } /** @@ -924,8 +932,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public PaymentLinkCreateParams.AutomaticTax build() { + return new PaymentLinkCreateParams.AutomaticTax(this.enabled, this.extraParams); } /** If {@code true}, tax will be calculated automatically using the customer's location. */ @@ -982,9 +990,19 @@ public static class ConsentCollection { @SerializedName("promotions") Promotions promotions; - private ConsentCollection(Map extraParams, Promotions promotions) { + /** + * If set to {@code required}, it requires customers to check a terms of service checkbox before + * being able to pay. There must be a valid terms of service URL set in your Dashboard settings. + */ + @SerializedName("terms_of_service") + TermsOfService termsOfService; + + private ConsentCollection( + Map extraParams, Promotions promotions, TermsOfService termsOfService) { this.extraParams = extraParams; this.promotions = promotions; + this.termsOfService = termsOfService; } public static Builder builder() { @@ -996,9 +1014,12 @@ public static class Builder { private Promotions promotions; + private TermsOfService termsOfService; + /** Finalize and obtain parameter instance from this builder. */ - public ConsentCollection build() { - return new ConsentCollection(this.extraParams, this.promotions); + public PaymentLinkCreateParams.ConsentCollection build() { + return new PaymentLinkCreateParams.ConsentCollection( + this.extraParams, this.promotions, this.termsOfService); } /** @@ -1034,10 +1055,22 @@ public Builder putAllExtraParam(Map map) { * into promotional communication from the merchant depending on the customer's locale. Only * available to US merchants. */ - public Builder setPromotions(Promotions promotions) { + public Builder setPromotions( + PaymentLinkCreateParams.ConsentCollection.Promotions promotions) { this.promotions = promotions; return this; } + + /** + * If set to {@code required}, it requires customers to check a terms of service checkbox + * before being able to pay. There must be a valid terms of service URL set in your Dashboard settings. + */ + public Builder setTermsOfService( + PaymentLinkCreateParams.ConsentCollection.TermsOfService termsOfService) { + this.termsOfService = termsOfService; + return this; + } } public enum Promotions implements ApiRequestParams.EnumParam { @@ -1054,6 +1087,21 @@ public enum Promotions implements ApiRequestParams.EnumParam { this.value = value; } } + + public enum TermsOfService implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("required") + REQUIRED("required"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TermsOfService(String value) { + this.value = value; + } + } } @Getter @@ -1110,15 +1158,17 @@ public static class Builder { private Long quantity; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem(this.adjustableQuantity, this.extraParams, this.price, this.quantity); + public PaymentLinkCreateParams.LineItem build() { + return new PaymentLinkCreateParams.LineItem( + this.adjustableQuantity, this.extraParams, this.price, this.quantity); } /** * When set, provides configuration for this item’s quantity to be adjusted by the customer * during checkout. */ - public Builder setAdjustableQuantity(AdjustableQuantity adjustableQuantity) { + public Builder setAdjustableQuantity( + PaymentLinkCreateParams.LineItem.AdjustableQuantity adjustableQuantity) { this.adjustableQuantity = adjustableQuantity; return this; } @@ -1217,8 +1267,9 @@ public static class Builder { private Long minimum; /** Finalize and obtain parameter instance from this builder. */ - public AdjustableQuantity build() { - return new AdjustableQuantity(this.enabled, this.extraParams, this.maximum, this.minimum); + public PaymentLinkCreateParams.LineItem.AdjustableQuantity build() { + return new PaymentLinkCreateParams.LineItem.AdjustableQuantity( + this.enabled, this.extraParams, this.maximum, this.minimum); } /** Set to true if the quantity can be adjusted to any non-negative Integer. */ @@ -1337,12 +1388,14 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public PaymentIntentData build() { - return new PaymentIntentData(this.captureMethod, this.extraParams, this.setupFutureUsage); + public PaymentLinkCreateParams.PaymentIntentData build() { + return new PaymentLinkCreateParams.PaymentIntentData( + this.captureMethod, this.extraParams, this.setupFutureUsage); } /** Controls when the funds will be captured from the customer's account. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + PaymentLinkCreateParams.PaymentIntentData.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -1396,7 +1449,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + PaymentLinkCreateParams.PaymentIntentData.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -1463,8 +1517,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PhoneNumberCollection build() { - return new PhoneNumberCollection(this.enabled, this.extraParams); + public PaymentLinkCreateParams.PhoneNumberCollection build() { + return new PaymentLinkCreateParams.PhoneNumberCollection(this.enabled, this.extraParams); } /** Set to {@code true} to enable phone number collection. */ @@ -1510,7 +1564,7 @@ public static class ShippingAddressCollection { * KP, MH, FM, NF, MP, PW, SD, SY, UM, VI}. */ @SerializedName("allowed_countries") - List allowedCountries; + List allowedCountries; /** * Map of extra parameters for custom features not available in this client library. The content @@ -1522,7 +1576,8 @@ public static class ShippingAddressCollection { Map extraParams; private ShippingAddressCollection( - List allowedCountries, Map extraParams) { + List allowedCountries, + Map extraParams) { this.allowedCountries = allowedCountries; this.extraParams = extraParams; } @@ -1532,13 +1587,15 @@ public static Builder builder() { } public static class Builder { - private List allowedCountries; + private List + allowedCountries; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public ShippingAddressCollection build() { - return new ShippingAddressCollection(this.allowedCountries, this.extraParams); + public PaymentLinkCreateParams.ShippingAddressCollection build() { + return new PaymentLinkCreateParams.ShippingAddressCollection( + this.allowedCountries, this.extraParams); } /** @@ -1547,7 +1604,8 @@ public ShippingAddressCollection build() { * PaymentLinkCreateParams.ShippingAddressCollection#allowedCountries} for the field * documentation. */ - public Builder addAllowedCountry(AllowedCountry element) { + public Builder addAllowedCountry( + PaymentLinkCreateParams.ShippingAddressCollection.AllowedCountry element) { if (this.allowedCountries == null) { this.allowedCountries = new ArrayList<>(); } @@ -1561,7 +1619,8 @@ public Builder addAllowedCountry(AllowedCountry element) { * {@link PaymentLinkCreateParams.ShippingAddressCollection#allowedCountries} for the field * documentation. */ - public Builder addAllAllowedCountry(List elements) { + public Builder addAllAllowedCountry( + List elements) { if (this.allowedCountries == null) { this.allowedCountries = new ArrayList<>(); } @@ -2348,8 +2407,8 @@ public static class Builder { private String shippingRate; /** Finalize and obtain parameter instance from this builder. */ - public ShippingOption build() { - return new ShippingOption(this.extraParams, this.shippingRate); + public PaymentLinkCreateParams.ShippingOption build() { + return new PaymentLinkCreateParams.ShippingOption(this.extraParams, this.shippingRate); } /** @@ -2430,8 +2489,9 @@ public static class Builder { private Long trialPeriodDays; /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionData build() { - return new SubscriptionData(this.description, this.extraParams, this.trialPeriodDays); + public PaymentLinkCreateParams.SubscriptionData build() { + return new PaymentLinkCreateParams.SubscriptionData( + this.description, this.extraParams, this.trialPeriodDays); } /** @@ -2511,8 +2571,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TaxIdCollection build() { - return new TaxIdCollection(this.enabled, this.extraParams); + public PaymentLinkCreateParams.TaxIdCollection build() { + return new PaymentLinkCreateParams.TaxIdCollection(this.enabled, this.extraParams); } /** Set to {@code true} to enable tax ID collection. */ @@ -2591,8 +2651,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.destination, this.extraParams); + public PaymentLinkCreateParams.TransferData build() { + return new PaymentLinkCreateParams.TransferData( + this.amount, this.destination, this.extraParams); } /** The amount that will be transferred automatically when a charge succeeds. */ diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index 650fc8d5373..8a52f7c7fc3 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -61,7 +61,7 @@ public class PaymentLinkUpdateParams extends ApiRequestParams { * Up to 20 line items are supported. */ @SerializedName("line_items") - List lineItems; + List lineItems; /** * Set of key-value pairs that you can attach @@ -110,7 +110,7 @@ private PaymentLinkUpdateParams( CustomerCreation customerCreation, List expand, Map extraParams, - List lineItems, + List lineItems, Map metadata, PaymentMethodCollection paymentMethodCollection, Object paymentMethodTypes, @@ -151,7 +151,7 @@ public static class Builder { private Map extraParams; - private List lineItems; + private List lineItems; private Map metadata; @@ -189,7 +189,7 @@ public Builder setActive(Boolean active) { } /** Behavior after the purchase is complete. */ - public Builder setAfterCompletion(AfterCompletion afterCompletion) { + public Builder setAfterCompletion(PaymentLinkUpdateParams.AfterCompletion afterCompletion) { this.afterCompletion = afterCompletion; return this; } @@ -201,13 +201,14 @@ public Builder setAllowPromotionCodes(Boolean allowPromotionCodes) { } /** Configuration for automatic tax collection. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(PaymentLinkUpdateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } /** Configuration for collecting the customer's billing address. */ - public Builder setBillingAddressCollection(BillingAddressCollection billingAddressCollection) { + public Builder setBillingAddressCollection( + PaymentLinkUpdateParams.BillingAddressCollection billingAddressCollection) { this.billingAddressCollection = billingAddressCollection; return this; } @@ -217,7 +218,7 @@ public Builder setBillingAddressCollection(BillingAddressCollection billingAddre * sessions created by this payment link create a Customer. */ - public Builder setCustomerCreation(CustomerCreation customerCreation) { + public Builder setCustomerCreation(PaymentLinkUpdateParams.CustomerCreation customerCreation) { this.customerCreation = customerCreation; return this; } @@ -279,7 +280,7 @@ public Builder putAllExtraParam(Map map) { * and subsequent calls adds additional elements to the original list. See {@link * PaymentLinkUpdateParams#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(PaymentLinkUpdateParams.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -292,7 +293,7 @@ public Builder addLineItem(LineItem element) { * and subsequent calls adds additional elements to the original list. See {@link * PaymentLinkUpdateParams#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -337,7 +338,8 @@ public Builder putAllMetadata(Map map) { * guide on configuring * subscriptions with a free trial. */ - public Builder setPaymentMethodCollection(PaymentMethodCollection paymentMethodCollection) { + public Builder setPaymentMethodCollection( + PaymentLinkUpdateParams.PaymentMethodCollection paymentMethodCollection) { this.paymentMethodCollection = paymentMethodCollection; return this; } @@ -348,7 +350,7 @@ public Builder setPaymentMethodCollection(PaymentMethodCollection paymentMethodC * PaymentLinkUpdateParams#paymentMethodTypes} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addPaymentMethodType(PaymentMethodType element) { + public Builder addPaymentMethodType(PaymentLinkUpdateParams.PaymentMethodType element) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); } @@ -362,7 +364,8 @@ public Builder addPaymentMethodType(PaymentMethodType element) { * {@link PaymentLinkUpdateParams#paymentMethodTypes} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllPaymentMethodType(List elements) { + public Builder addAllPaymentMethodType( + List elements) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); } @@ -385,14 +388,15 @@ public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) { * automatic payment methods that use your payment method settings. */ - public Builder setPaymentMethodTypes(List paymentMethodTypes) { + public Builder setPaymentMethodTypes( + List paymentMethodTypes) { this.paymentMethodTypes = paymentMethodTypes; return this; } /** Configuration for collecting the customer's shipping address. */ public Builder setShippingAddressCollection( - ShippingAddressCollection shippingAddressCollection) { + PaymentLinkUpdateParams.ShippingAddressCollection shippingAddressCollection) { this.shippingAddressCollection = shippingAddressCollection; return this; } @@ -455,8 +459,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public AfterCompletion build() { - return new AfterCompletion( + public PaymentLinkUpdateParams.AfterCompletion build() { + return new PaymentLinkUpdateParams.AfterCompletion( this.extraParams, this.hostedConfirmation, this.redirect, this.type); } @@ -488,13 +492,14 @@ public Builder putAllExtraParam(Map map) { } /** Configuration when {@code type=hosted_confirmation}. */ - public Builder setHostedConfirmation(HostedConfirmation hostedConfirmation) { + public Builder setHostedConfirmation( + PaymentLinkUpdateParams.AfterCompletion.HostedConfirmation hostedConfirmation) { this.hostedConfirmation = hostedConfirmation; return this; } /** Configuration when {@code type=redirect}. */ - public Builder setRedirect(Redirect redirect) { + public Builder setRedirect(PaymentLinkUpdateParams.AfterCompletion.Redirect redirect) { this.redirect = redirect; return this; } @@ -503,7 +508,7 @@ public Builder setRedirect(Redirect redirect) { * The specified behavior after the purchase is complete. Either {@code redirect} or {@code * hosted_confirmation}. */ - public Builder setType(Type type) { + public Builder setType(PaymentLinkUpdateParams.AfterCompletion.Type type) { this.type = type; return this; } @@ -539,8 +544,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public HostedConfirmation build() { - return new HostedConfirmation(this.customMessage, this.extraParams); + public PaymentLinkUpdateParams.AfterCompletion.HostedConfirmation build() { + return new PaymentLinkUpdateParams.AfterCompletion.HostedConfirmation( + this.customMessage, this.extraParams); } /** A custom message to display to the customer after the purchase is complete. */ @@ -620,8 +626,8 @@ public static class Builder { private Object url; /** Finalize and obtain parameter instance from this builder. */ - public Redirect build() { - return new Redirect(this.extraParams, this.url); + public PaymentLinkUpdateParams.AfterCompletion.Redirect build() { + return new PaymentLinkUpdateParams.AfterCompletion.Redirect(this.extraParams, this.url); } /** @@ -722,8 +728,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public PaymentLinkUpdateParams.AutomaticTax build() { + return new PaymentLinkUpdateParams.AutomaticTax(this.enabled, this.extraParams); } /** If {@code true}, tax will be calculated automatically using the customer's location. */ @@ -811,15 +817,17 @@ public static class Builder { private Long quantity; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem(this.adjustableQuantity, this.extraParams, this.id, this.quantity); + public PaymentLinkUpdateParams.LineItem build() { + return new PaymentLinkUpdateParams.LineItem( + this.adjustableQuantity, this.extraParams, this.id, this.quantity); } /** * When set, provides configuration for this item’s quantity to be adjusted by the customer * during checkout. */ - public Builder setAdjustableQuantity(AdjustableQuantity adjustableQuantity) { + public Builder setAdjustableQuantity( + PaymentLinkUpdateParams.LineItem.AdjustableQuantity adjustableQuantity) { this.adjustableQuantity = adjustableQuantity; return this; } @@ -921,8 +929,9 @@ public static class Builder { private Long minimum; /** Finalize and obtain parameter instance from this builder. */ - public AdjustableQuantity build() { - return new AdjustableQuantity(this.enabled, this.extraParams, this.maximum, this.minimum); + public PaymentLinkUpdateParams.LineItem.AdjustableQuantity build() { + return new PaymentLinkUpdateParams.LineItem.AdjustableQuantity( + this.enabled, this.extraParams, this.maximum, this.minimum); } /** Set to true if the quantity can be adjusted to any non-negative Integer. */ @@ -989,7 +998,7 @@ public static class ShippingAddressCollection { * KP, MH, FM, NF, MP, PW, SD, SY, UM, VI}. */ @SerializedName("allowed_countries") - List allowedCountries; + List allowedCountries; /** * Map of extra parameters for custom features not available in this client library. The content @@ -1001,7 +1010,8 @@ public static class ShippingAddressCollection { Map extraParams; private ShippingAddressCollection( - List allowedCountries, Map extraParams) { + List allowedCountries, + Map extraParams) { this.allowedCountries = allowedCountries; this.extraParams = extraParams; } @@ -1011,13 +1021,15 @@ public static Builder builder() { } public static class Builder { - private List allowedCountries; + private List + allowedCountries; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public ShippingAddressCollection build() { - return new ShippingAddressCollection(this.allowedCountries, this.extraParams); + public PaymentLinkUpdateParams.ShippingAddressCollection build() { + return new PaymentLinkUpdateParams.ShippingAddressCollection( + this.allowedCountries, this.extraParams); } /** @@ -1026,7 +1038,8 @@ public ShippingAddressCollection build() { * PaymentLinkUpdateParams.ShippingAddressCollection#allowedCountries} for the field * documentation. */ - public Builder addAllowedCountry(AllowedCountry element) { + public Builder addAllowedCountry( + PaymentLinkUpdateParams.ShippingAddressCollection.AllowedCountry element) { if (this.allowedCountries == null) { this.allowedCountries = new ArrayList<>(); } @@ -1040,7 +1053,8 @@ public Builder addAllowedCountry(AllowedCountry element) { * {@link PaymentLinkUpdateParams.ShippingAddressCollection#allowedCountries} for the field * documentation. */ - public Builder addAllAllowedCountry(List elements) { + public Builder addAllAllowedCountry( + List elements) { if (this.allowedCountries == null) { this.allowedCountries = new ArrayList<>(); } diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index 02240cc4094..d1aa8ed47b3 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -472,7 +472,7 @@ public PaymentMethodCreateParams build() { * If this is an {@code acss_debit} PaymentMethod, this hash contains details about the ACSS * Debit payment method. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(PaymentMethodCreateParams.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -481,7 +481,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is an {@code affirm} PaymentMethod, this hash contains details about the Affirm * payment method. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(PaymentMethodCreateParams.Affirm affirm) { this.affirm = affirm; return this; } @@ -490,7 +490,8 @@ public Builder setAffirm(Affirm affirm) { * If this is an {@code AfterpayClearpay} PaymentMethod, this hash contains details about the * AfterpayClearpay payment method. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + PaymentMethodCreateParams.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -499,7 +500,7 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If this is an {@code Alipay} PaymentMethod, this hash contains details about the Alipay * payment method. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(PaymentMethodCreateParams.Alipay alipay) { this.alipay = alipay; return this; } @@ -508,7 +509,7 @@ public Builder setAlipay(Alipay alipay) { * If this is an {@code au_becs_debit} PaymentMethod, this hash contains details about the bank * account. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit(PaymentMethodCreateParams.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -517,7 +518,7 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs * Direct Debit bank account. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(PaymentMethodCreateParams.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -526,7 +527,7 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this hash contains details about the * Bancontact payment method. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact(PaymentMethodCreateParams.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -535,7 +536,7 @@ public Builder setBancontact(Bancontact bancontact) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails(PaymentMethodCreateParams.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -544,7 +545,7 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(PaymentMethodCreateParams.Blik blik) { this.blik = blik; return this; } @@ -553,7 +554,7 @@ public Builder setBlik(Blik blik) { * If this is a {@code boleto} PaymentMethod, this hash contains details about the Boleto * payment method. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(PaymentMethodCreateParams.Boleto boleto) { this.boleto = boleto; return this; } @@ -566,7 +567,7 @@ public Builder setBoleto(Boleto boleto) { * href="https://stripe.com/docs/security#validating-pci-compliance">PCI compliance. We * strongly recommend using Stripe.js instead of interacting with this API directly. */ - public Builder setCard(CardDetails card) { + public Builder setCard(PaymentMethodCreateParams.CardDetails card) { this.card = card; return this; } @@ -579,7 +580,7 @@ public Builder setCard(CardDetails card) { * href="https://stripe.com/docs/security#validating-pci-compliance">PCI compliance. We * strongly recommend using Stripe.js instead of interacting with this API directly. */ - public Builder setCard(Token card) { + public Builder setCard(PaymentMethodCreateParams.Token card) { this.card = card; return this; } @@ -594,7 +595,7 @@ public Builder setCustomer(String customer) { * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance(PaymentMethodCreateParams.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -603,7 +604,7 @@ public Builder setCustomerBalance(CustomerBalance customerBalance) { * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment * method. */ - public Builder setEps(Eps eps) { + public Builder setEps(PaymentMethodCreateParams.Eps eps) { this.eps = eps; return this; } @@ -664,7 +665,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code fpx} PaymentMethod, this hash contains details about the FPX payment * method. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(PaymentMethodCreateParams.Fpx fpx) { this.fpx = fpx; return this; } @@ -673,7 +674,7 @@ public Builder setFpx(Fpx fpx) { * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(PaymentMethodCreateParams.Giropay giropay) { this.giropay = giropay; return this; } @@ -682,7 +683,7 @@ public Builder setGiropay(Giropay giropay) { * If this is a {@code grabpay} PaymentMethod, this hash contains details about the GrabPay * payment method. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(PaymentMethodCreateParams.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -691,7 +692,7 @@ public Builder setGrabpay(Grabpay grabpay) { * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL payment * method. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(PaymentMethodCreateParams.Ideal ideal) { this.ideal = ideal; return this; } @@ -700,7 +701,7 @@ public Builder setIdeal(Ideal ideal) { * If this is an {@code interac_present} PaymentMethod, this hash contains details about the * Interac Present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent(PaymentMethodCreateParams.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -709,7 +710,7 @@ public Builder setInteracPresent(InteracPresent interacPresent) { * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna * payment method. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(PaymentMethodCreateParams.Klarna klarna) { this.klarna = klarna; return this; } @@ -718,7 +719,7 @@ public Builder setKlarna(Klarna klarna) { * If this is a {@code konbini} PaymentMethod, this hash contains details about the Konbini * payment method. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(PaymentMethodCreateParams.Konbini konbini) { this.konbini = konbini; return this; } @@ -727,7 +728,7 @@ public Builder setKonbini(Konbini konbini) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(PaymentMethodCreateParams.Link link) { this.link = link; return this; } @@ -762,7 +763,7 @@ public Builder putAllMetadata(Map map) { * If this is an {@code oxxo} PaymentMethod, this hash contains details about the OXXO payment * method. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(PaymentMethodCreateParams.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -771,7 +772,7 @@ public Builder setOxxo(Oxxo oxxo) { * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment * method. */ - public Builder setP24(P24 p24) { + public Builder setP24(PaymentMethodCreateParams.P24 p24) { this.p24 = p24; return this; } @@ -786,7 +787,7 @@ public Builder setPaymentMethod(String paymentMethod) { * If this is a {@code paynow} PaymentMethod, this hash contains details about the PayNow * payment method. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(PaymentMethodCreateParams.Paynow paynow) { this.paynow = paynow; return this; } @@ -795,7 +796,7 @@ public Builder setPaynow(Paynow paynow) { * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. */ - public Builder setPix(Pix pix) { + public Builder setPix(PaymentMethodCreateParams.Pix pix) { this.pix = pix; return this; } @@ -804,7 +805,7 @@ public Builder setPix(Pix pix) { * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay(PaymentMethodCreateParams.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -813,7 +814,7 @@ public Builder setPromptpay(Promptpay promptpay) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions(PaymentMethodCreateParams.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -822,7 +823,7 @@ public Builder setRadarOptions(RadarOptions radarOptions) { * If this is a {@code sepa_debit} PaymentMethod, this hash contains details about the SEPA * debit bank account. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(PaymentMethodCreateParams.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -831,7 +832,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code sofort} PaymentMethod, this hash contains details about the SOFORT * payment method. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(PaymentMethodCreateParams.Sofort sofort) { this.sofort = sofort; return this; } @@ -841,7 +842,7 @@ public Builder setSofort(Sofort sofort) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(PaymentMethodCreateParams.Type type) { this.type = type; return this; } @@ -850,7 +851,7 @@ public Builder setType(Type type) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount(PaymentMethodCreateParams.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -859,7 +860,7 @@ public Builder setUsBankAccount(UsBankAccount usBankAccount) { * If this is an {@code wechat_pay} PaymentMethod, this hash contains details about the * wechat_pay payment method. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay(PaymentMethodCreateParams.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -913,8 +914,8 @@ public static class Builder { private String transitNumber; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public PaymentMethodCreateParams.AcssDebit build() { + return new PaymentMethodCreateParams.AcssDebit( this.accountNumber, this.extraParams, this.institutionNumber, this.transitNumber); } @@ -987,8 +988,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public PaymentMethodCreateParams.Affirm build() { + return new PaymentMethodCreateParams.Affirm(this.extraParams); } /** @@ -1042,8 +1043,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams); + public PaymentMethodCreateParams.AfterpayClearpay build() { + return new PaymentMethodCreateParams.AfterpayClearpay(this.extraParams); } /** @@ -1098,8 +1099,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams); + public PaymentMethodCreateParams.Alipay build() { + return new PaymentMethodCreateParams.Alipay(this.extraParams); } /** @@ -1167,8 +1168,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.accountNumber, this.bsbNumber, this.extraParams); + public PaymentMethodCreateParams.AuBecsDebit build() { + return new PaymentMethodCreateParams.AuBecsDebit( + this.accountNumber, this.bsbNumber, this.extraParams); } /** The account number for the bank account. */ @@ -1248,8 +1250,9 @@ public static class Builder { private String sortCode; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.accountNumber, this.extraParams, this.sortCode); + public PaymentMethodCreateParams.BacsDebit build() { + return new PaymentMethodCreateParams.BacsDebit( + this.accountNumber, this.extraParams, this.sortCode); } /** Account number of the bank account that the funds will be debited from. */ @@ -1315,8 +1318,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams); + public PaymentMethodCreateParams.Bancontact build() { + return new PaymentMethodCreateParams.Bancontact(this.extraParams); } /** @@ -1399,13 +1402,13 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public PaymentMethodCreateParams.BillingDetails build() { + return new PaymentMethodCreateParams.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress(PaymentMethodCreateParams.BillingDetails.Address address) { this.address = address; return this; } @@ -1543,8 +1546,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public PaymentMethodCreateParams.BillingDetails.Address build() { + return new PaymentMethodCreateParams.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -1647,8 +1650,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public PaymentMethodCreateParams.Blik build() { + return new PaymentMethodCreateParams.Blik(this.extraParams); } /** @@ -1711,8 +1714,8 @@ public static class Builder { private String taxId; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.extraParams, this.taxId); + public PaymentMethodCreateParams.Boleto build() { + return new PaymentMethodCreateParams.Boleto(this.extraParams, this.taxId); } /** @@ -1803,8 +1806,8 @@ public static class Builder { private String number; /** Finalize and obtain parameter instance from this builder. */ - public CardDetails build() { - return new CardDetails( + public PaymentMethodCreateParams.CardDetails build() { + return new PaymentMethodCreateParams.CardDetails( this.cvc, this.expMonth, this.expYear, this.extraParams, this.number); } @@ -1883,8 +1886,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.extraParams); + public PaymentMethodCreateParams.CustomerBalance build() { + return new PaymentMethodCreateParams.CustomerBalance(this.extraParams); } /** @@ -1946,12 +1949,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.bank, this.extraParams); + public PaymentMethodCreateParams.Eps build() { + return new PaymentMethodCreateParams.Eps(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentMethodCreateParams.Eps.Bank bank) { this.bank = bank; return this; } @@ -2114,18 +2117,20 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.accountHolderType, this.bank, this.extraParams); + public PaymentMethodCreateParams.Fpx build() { + return new PaymentMethodCreateParams.Fpx( + this.accountHolderType, this.bank, this.extraParams); } /** Account holder type for FPX transaction. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + PaymentMethodCreateParams.Fpx.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentMethodCreateParams.Fpx.Bank bank) { this.bank = bank; return this; } @@ -2268,8 +2273,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams); + public PaymentMethodCreateParams.Giropay build() { + return new PaymentMethodCreateParams.Giropay(this.extraParams); } /** @@ -2323,8 +2328,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams); + public PaymentMethodCreateParams.Grabpay build() { + return new PaymentMethodCreateParams.Grabpay(this.extraParams); } /** @@ -2385,12 +2390,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.bank, this.extraParams); + public PaymentMethodCreateParams.Ideal build() { + return new PaymentMethodCreateParams.Ideal(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentMethodCreateParams.Ideal.Bank bank) { this.bank = bank; return this; } @@ -2494,8 +2499,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public PaymentMethodCreateParams.InteracPresent build() { + return new PaymentMethodCreateParams.InteracPresent(this.extraParams); } /** @@ -2557,12 +2562,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.dob, this.extraParams); + public PaymentMethodCreateParams.Klarna build() { + return new PaymentMethodCreateParams.Klarna(this.dob, this.extraParams); } /** Customer's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(PaymentMethodCreateParams.Klarna.Dob dob) { this.dob = dob; return this; } @@ -2638,8 +2643,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public PaymentMethodCreateParams.Klarna.Dob build() { + return new PaymentMethodCreateParams.Klarna.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -2714,8 +2720,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public PaymentMethodCreateParams.Konbini build() { + return new PaymentMethodCreateParams.Konbini(this.extraParams); } /** @@ -2769,8 +2775,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public PaymentMethodCreateParams.Link build() { + return new PaymentMethodCreateParams.Link(this.extraParams); } /** @@ -2824,8 +2830,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.extraParams); + public PaymentMethodCreateParams.Oxxo build() { + return new PaymentMethodCreateParams.Oxxo(this.extraParams); } /** @@ -2886,12 +2892,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.bank, this.extraParams); + public PaymentMethodCreateParams.P24 build() { + return new PaymentMethodCreateParams.P24(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentMethodCreateParams.P24.Bank bank) { this.bank = bank; return this; } @@ -3031,8 +3037,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams); + public PaymentMethodCreateParams.Paynow build() { + return new PaymentMethodCreateParams.Paynow(this.extraParams); } /** @@ -3086,8 +3092,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pix build() { - return new Pix(this.extraParams); + public PaymentMethodCreateParams.Pix build() { + return new PaymentMethodCreateParams.Pix(this.extraParams); } /** @@ -3141,8 +3147,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams); + public PaymentMethodCreateParams.Promptpay build() { + return new PaymentMethodCreateParams.Promptpay(this.extraParams); } /** @@ -3207,8 +3213,8 @@ public static class Builder { private String session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public PaymentMethodCreateParams.RadarOptions build() { + return new PaymentMethodCreateParams.RadarOptions(this.extraParams, this.session); } /** @@ -3279,8 +3285,8 @@ public static class Builder { private String iban; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.iban); + public PaymentMethodCreateParams.SepaDebit build() { + return new PaymentMethodCreateParams.SepaDebit(this.extraParams, this.iban); } /** @@ -3347,12 +3353,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.country, this.extraParams); + public PaymentMethodCreateParams.Sofort build() { + return new PaymentMethodCreateParams.Sofort(this.country, this.extraParams); } /** Two-letter ISO code representing the country the bank account is located in. */ - public Builder setCountry(Country country) { + public Builder setCountry(PaymentMethodCreateParams.Sofort.Country country) { this.country = country; return this; } @@ -3441,8 +3447,8 @@ public static class Builder { private String token; /** Finalize and obtain parameter instance from this builder. */ - public Token build() { - return new Token(this.extraParams, this.token); + public PaymentMethodCreateParams.Token build() { + return new PaymentMethodCreateParams.Token(this.extraParams, this.token); } /** @@ -3542,8 +3548,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public PaymentMethodCreateParams.UsBankAccount build() { + return new PaymentMethodCreateParams.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -3553,7 +3559,8 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + PaymentMethodCreateParams.UsBankAccount.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -3565,7 +3572,8 @@ public Builder setAccountNumber(String accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + PaymentMethodCreateParams.UsBankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -3664,8 +3672,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.extraParams); + public PaymentMethodCreateParams.WechatPay build() { + return new PaymentMethodCreateParams.WechatPay(this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/PaymentMethodListParams.java b/src/main/java/com/stripe/param/PaymentMethodListParams.java index ea09fb6cc59..5b3acbd21d3 100644 --- a/src/main/java/com/stripe/param/PaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodListParams.java @@ -195,7 +195,7 @@ public Builder setStartingAfter(String startingAfter) { } /** A required filter on the list, based on the object {@code type} field. */ - public Builder setType(Type type) { + public Builder setType(PaymentMethodListParams.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/PaymentMethodUpdateParams.java b/src/main/java/com/stripe/param/PaymentMethodUpdateParams.java index fdfd23ad1c3..6cf7862a3c5 100644 --- a/src/main/java/com/stripe/param/PaymentMethodUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodUpdateParams.java @@ -183,7 +183,7 @@ public PaymentMethodUpdateParams build() { * This is a legacy parameter that will be removed in the future. It is a hash that does not * accept any keys. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(PaymentMethodUpdateParams.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -192,7 +192,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * This is a legacy parameter that will be removed in the future. It is a hash that does not * accept any keys. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(PaymentMethodUpdateParams.Affirm affirm) { this.affirm = affirm; return this; } @@ -201,7 +201,7 @@ public Builder setAffirm(Affirm affirm) { * This is a legacy parameter that will be removed in the future. It is a hash that does not * accept any keys. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit(PaymentMethodUpdateParams.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -210,7 +210,7 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * This is a legacy parameter that will be removed in the future. It is a hash that does not * accept any keys. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(PaymentMethodUpdateParams.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -219,7 +219,7 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails(PaymentMethodUpdateParams.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -228,13 +228,13 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * This is a legacy parameter that will be removed in the future. It is a hash that does not * accept any keys. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(PaymentMethodUpdateParams.Blik blik) { this.blik = blik; return this; } /** If this is a {@code card} PaymentMethod, this hash contains the user's card details. */ - public Builder setCard(Card card) { + public Builder setCard(PaymentMethodUpdateParams.Card card) { this.card = card; return this; } @@ -295,7 +295,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(PaymentMethodUpdateParams.Link link) { this.link = link; return this; } @@ -354,7 +354,7 @@ public Builder setMetadata(Map metadata) { * This is a legacy parameter that will be removed in the future. It is a hash that does not * accept any keys. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(PaymentMethodUpdateParams.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -363,7 +363,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount(PaymentMethodUpdateParams.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -392,8 +392,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit(this.extraParams); + public PaymentMethodUpdateParams.AcssDebit build() { + return new PaymentMethodUpdateParams.AcssDebit(this.extraParams); } /** @@ -447,8 +447,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public PaymentMethodUpdateParams.Affirm build() { + return new PaymentMethodUpdateParams.Affirm(this.extraParams); } /** @@ -502,8 +502,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.extraParams); + public PaymentMethodUpdateParams.AuBecsDebit build() { + return new PaymentMethodUpdateParams.AuBecsDebit(this.extraParams); } /** @@ -557,8 +557,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.extraParams); + public PaymentMethodUpdateParams.BacsDebit build() { + return new PaymentMethodUpdateParams.BacsDebit(this.extraParams); } /** @@ -641,13 +641,13 @@ public static class Builder { private Object phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public PaymentMethodUpdateParams.BillingDetails build() { + return new PaymentMethodUpdateParams.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress(PaymentMethodUpdateParams.BillingDetails.Address address) { this.address = address; return this; } @@ -797,8 +797,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public PaymentMethodUpdateParams.BillingDetails.Address build() { + return new PaymentMethodUpdateParams.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -940,8 +940,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public PaymentMethodUpdateParams.Blik build() { + return new PaymentMethodUpdateParams.Blik(this.extraParams); } /** @@ -1009,8 +1009,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card(this.expMonth, this.expYear, this.extraParams); + public PaymentMethodUpdateParams.Card build() { + return new PaymentMethodUpdateParams.Card(this.expMonth, this.expYear, this.extraParams); } /** Two-digit number representing the card's expiration month. */ @@ -1076,8 +1076,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public PaymentMethodUpdateParams.Link build() { + return new PaymentMethodUpdateParams.Link(this.extraParams); } /** @@ -1131,8 +1131,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams); + public PaymentMethodUpdateParams.SepaDebit build() { + return new PaymentMethodUpdateParams.SepaDebit(this.extraParams); } /** @@ -1193,12 +1193,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount(this.accountHolderType, this.extraParams); + public PaymentMethodUpdateParams.UsBankAccount build() { + return new PaymentMethodUpdateParams.UsBankAccount( + this.accountHolderType, this.extraParams); } /** Bank account type. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + PaymentMethodUpdateParams.UsBankAccount.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } diff --git a/src/main/java/com/stripe/param/PayoutCreateParams.java b/src/main/java/com/stripe/param/PayoutCreateParams.java index 268bbff0d33..f55824bfd89 100644 --- a/src/main/java/com/stripe/param/PayoutCreateParams.java +++ b/src/main/java/com/stripe/param/PayoutCreateParams.java @@ -259,7 +259,7 @@ public Builder putAllMetadata(Map map) { * href="https://stripe.com/blog/instant-payouts-for-marketplaces">Instant payouts for * marketplaces for more information.) */ - public Builder setMethod(Method method) { + public Builder setMethod(PayoutCreateParams.Method method) { this.method = method; return this; } @@ -269,7 +269,7 @@ public Builder setMethod(Method method) { * payment sources are kept separately. You can find the amounts with the balances API. One of * {@code bank_account}, {@code card}, or {@code fpx}. */ - public Builder setSourceType(SourceType sourceType) { + public Builder setSourceType(PayoutCreateParams.SourceType sourceType) { this.sourceType = sourceType; return this; } diff --git a/src/main/java/com/stripe/param/PayoutListParams.java b/src/main/java/com/stripe/param/PayoutListParams.java index a385dc86766..0ec92761abc 100644 --- a/src/main/java/com/stripe/param/PayoutListParams.java +++ b/src/main/java/com/stripe/param/PayoutListParams.java @@ -124,7 +124,7 @@ public PayoutListParams build() { this.status); } - public Builder setArrivalDate(ArrivalDate arrivalDate) { + public Builder setArrivalDate(PayoutListParams.ArrivalDate arrivalDate) { this.arrivalDate = arrivalDate; return this; } @@ -134,7 +134,7 @@ public Builder setArrivalDate(Long arrivalDate) { return this; } - public Builder setCreated(Created created) { + public Builder setCreated(PayoutListParams.Created created) { this.created = created; return this; } @@ -294,8 +294,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public ArrivalDate build() { - return new ArrivalDate(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public PayoutListParams.ArrivalDate build() { + return new PayoutListParams.ArrivalDate( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -401,8 +402,8 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public PayoutListParams.Created build() { + return new PayoutListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/PersonCollectionCreateParams.java b/src/main/java/com/stripe/param/PersonCollectionCreateParams.java index 27dfcf1da0f..02b04a4a478 100644 --- a/src/main/java/com/stripe/param/PersonCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/PersonCollectionCreateParams.java @@ -314,25 +314,25 @@ public PersonCollectionCreateParams build() { } /** The person's address. */ - public Builder setAddress(Address address) { + public Builder setAddress(PersonCollectionCreateParams.Address address) { this.address = address; return this; } /** The Kana variation of the person's address (Japan only). */ - public Builder setAddressKana(AddressKana addressKana) { + public Builder setAddressKana(PersonCollectionCreateParams.AddressKana addressKana) { this.addressKana = addressKana; return this; } /** The Kanji variation of the person's address (Japan only). */ - public Builder setAddressKanji(AddressKanji addressKanji) { + public Builder setAddressKanji(PersonCollectionCreateParams.AddressKanji addressKanji) { this.addressKanji = addressKanji; return this; } /** The person's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(PersonCollectionCreateParams.Dob dob) { this.dob = dob; return this; } @@ -344,7 +344,7 @@ public Builder setDob(EmptyParam dob) { } /** Documents that may be submitted to satisfy various informational requests. */ - public Builder setDocuments(Documents documents) { + public Builder setDocuments(PersonCollectionCreateParams.Documents documents) { this.documents = documents; return this; } @@ -608,13 +608,14 @@ public Builder setPoliticalExposure(String politicalExposure) { } /** The person's registered address. */ - public Builder setRegisteredAddress(RegisteredAddress registeredAddress) { + public Builder setRegisteredAddress( + PersonCollectionCreateParams.RegisteredAddress registeredAddress) { this.registeredAddress = registeredAddress; return this; } /** The relationship that this person has with the account's legal entity. */ - public Builder setRelationship(Relationship relationship) { + public Builder setRelationship(PersonCollectionCreateParams.Relationship relationship) { this.relationship = relationship; return this; } @@ -626,7 +627,7 @@ public Builder setSsnLast4(String ssnLast4) { } /** The person's verification status. */ - public Builder setVerification(Verification verification) { + public Builder setVerification(PersonCollectionCreateParams.Verification verification) { this.verification = verification; return this; } @@ -707,8 +708,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public PersonCollectionCreateParams.Address build() { + return new PersonCollectionCreateParams.Address( this.city, this.country, this.extraParams, @@ -868,8 +869,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKana build() { - return new AddressKana( + public PersonCollectionCreateParams.AddressKana build() { + return new PersonCollectionCreateParams.AddressKana( this.city, this.country, this.extraParams, @@ -1037,8 +1038,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKanji build() { - return new AddressKanji( + public PersonCollectionCreateParams.AddressKanji build() { + return new PersonCollectionCreateParams.AddressKanji( this.city, this.country, this.extraParams, @@ -1167,8 +1168,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public PersonCollectionCreateParams.Dob build() { + return new PersonCollectionCreateParams.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -1271,15 +1273,17 @@ public static class Builder { private Visa visa; /** Finalize and obtain parameter instance from this builder. */ - public Documents build() { - return new Documents(this.companyAuthorization, this.extraParams, this.passport, this.visa); + public PersonCollectionCreateParams.Documents build() { + return new PersonCollectionCreateParams.Documents( + this.companyAuthorization, this.extraParams, this.passport, this.visa); } /** * One or more documents that demonstrate proof that this person is authorized to represent * the company. */ - public Builder setCompanyAuthorization(CompanyAuthorization companyAuthorization) { + public Builder setCompanyAuthorization( + PersonCollectionCreateParams.Documents.CompanyAuthorization companyAuthorization) { this.companyAuthorization = companyAuthorization; return this; } @@ -1311,7 +1315,7 @@ public Builder putAllExtraParam(Map map) { } /** One or more documents showing the person's passport page with photo and personal data. */ - public Builder setPassport(Passport passport) { + public Builder setPassport(PersonCollectionCreateParams.Documents.Passport passport) { this.passport = passport; return this; } @@ -1320,7 +1324,7 @@ public Builder setPassport(Passport passport) { * One or more documents showing the person's visa required for living in the country where * they are residing. */ - public Builder setVisa(Visa visa) { + public Builder setVisa(PersonCollectionCreateParams.Documents.Visa visa) { this.visa = visa; return this; } @@ -1360,8 +1364,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyAuthorization build() { - return new CompanyAuthorization(this.extraParams, this.files); + public PersonCollectionCreateParams.Documents.CompanyAuthorization build() { + return new PersonCollectionCreateParams.Documents.CompanyAuthorization( + this.extraParams, this.files); } /** @@ -1456,8 +1461,8 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public Passport build() { - return new Passport(this.extraParams, this.files); + public PersonCollectionCreateParams.Documents.Passport build() { + return new PersonCollectionCreateParams.Documents.Passport(this.extraParams, this.files); } /** @@ -1550,8 +1555,8 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public Visa build() { - return new Visa(this.extraParams, this.files); + public PersonCollectionCreateParams.Documents.Visa build() { + return new PersonCollectionCreateParams.Documents.Visa(this.extraParams, this.files); } /** @@ -1686,8 +1691,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public RegisteredAddress build() { - return new RegisteredAddress( + public PersonCollectionCreateParams.RegisteredAddress build() { + return new PersonCollectionCreateParams.RegisteredAddress( this.city, this.country, this.extraParams, @@ -1850,8 +1855,8 @@ public static class Builder { private String title; /** Finalize and obtain parameter instance from this builder. */ - public Relationship build() { - return new Relationship( + public PersonCollectionCreateParams.Relationship build() { + return new PersonCollectionCreateParams.Relationship( this.director, this.executive, this.extraParams, @@ -1986,21 +1991,23 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Verification build() { - return new Verification(this.additionalDocument, this.document, this.extraParams); + public PersonCollectionCreateParams.Verification build() { + return new PersonCollectionCreateParams.Verification( + this.additionalDocument, this.document, this.extraParams); } /** * A document showing address, either a passport, local ID card, or utility bill from a * well-known utility company. */ - public Builder setAdditionalDocument(AdditionalDocument additionalDocument) { + public Builder setAdditionalDocument( + PersonCollectionCreateParams.Verification.AdditionalDocument additionalDocument) { this.additionalDocument = additionalDocument; return this; } /** An identifying document, either a passport or local ID card. */ - public Builder setDocument(Document document) { + public Builder setDocument(PersonCollectionCreateParams.Verification.Document document) { this.document = document; return this; } @@ -2080,8 +2087,9 @@ public static class Builder { private String front; /** Finalize and obtain parameter instance from this builder. */ - public AdditionalDocument build() { - return new AdditionalDocument(this.back, this.extraParams, this.front); + public PersonCollectionCreateParams.Verification.AdditionalDocument build() { + return new PersonCollectionCreateParams.Verification.AdditionalDocument( + this.back, this.extraParams, this.front); } /** @@ -2183,8 +2191,9 @@ public static class Builder { private String front; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document(this.back, this.extraParams, this.front); + public PersonCollectionCreateParams.Verification.Document build() { + return new PersonCollectionCreateParams.Verification.Document( + this.back, this.extraParams, this.front); } /** diff --git a/src/main/java/com/stripe/param/PersonCollectionListParams.java b/src/main/java/com/stripe/param/PersonCollectionListParams.java index 465d67ab7d5..80fc9723efe 100644 --- a/src/main/java/com/stripe/param/PersonCollectionListParams.java +++ b/src/main/java/com/stripe/param/PersonCollectionListParams.java @@ -175,7 +175,7 @@ public Builder setLimit(Long limit) { * Filters on the list of people returned based on the person's relationship to the account's * company. */ - public Builder setRelationship(Relationship relationship) { + public Builder setRelationship(PersonCollectionListParams.Relationship relationship) { this.relationship = relationship; return this; } @@ -260,8 +260,8 @@ public static class Builder { private Boolean representative; /** Finalize and obtain parameter instance from this builder. */ - public Relationship build() { - return new Relationship( + public PersonCollectionListParams.Relationship build() { + return new PersonCollectionListParams.Relationship( this.director, this.executive, this.extraParams, this.owner, this.representative); } diff --git a/src/main/java/com/stripe/param/PersonUpdateParams.java b/src/main/java/com/stripe/param/PersonUpdateParams.java index f4c2105aae6..66d6cc9e552 100644 --- a/src/main/java/com/stripe/param/PersonUpdateParams.java +++ b/src/main/java/com/stripe/param/PersonUpdateParams.java @@ -314,25 +314,25 @@ public PersonUpdateParams build() { } /** The person's address. */ - public Builder setAddress(Address address) { + public Builder setAddress(PersonUpdateParams.Address address) { this.address = address; return this; } /** The Kana variation of the person's address (Japan only). */ - public Builder setAddressKana(AddressKana addressKana) { + public Builder setAddressKana(PersonUpdateParams.AddressKana addressKana) { this.addressKana = addressKana; return this; } /** The Kanji variation of the person's address (Japan only). */ - public Builder setAddressKanji(AddressKanji addressKanji) { + public Builder setAddressKanji(PersonUpdateParams.AddressKanji addressKanji) { this.addressKanji = addressKanji; return this; } /** The person's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(PersonUpdateParams.Dob dob) { this.dob = dob; return this; } @@ -344,7 +344,7 @@ public Builder setDob(EmptyParam dob) { } /** Documents that may be submitted to satisfy various informational requests. */ - public Builder setDocuments(Documents documents) { + public Builder setDocuments(PersonUpdateParams.Documents documents) { this.documents = documents; return this; } @@ -724,13 +724,13 @@ public Builder setPoliticalExposure(EmptyParam politicalExposure) { } /** The person's registered address. */ - public Builder setRegisteredAddress(RegisteredAddress registeredAddress) { + public Builder setRegisteredAddress(PersonUpdateParams.RegisteredAddress registeredAddress) { this.registeredAddress = registeredAddress; return this; } /** The relationship that this person has with the account's legal entity. */ - public Builder setRelationship(Relationship relationship) { + public Builder setRelationship(PersonUpdateParams.Relationship relationship) { this.relationship = relationship; return this; } @@ -748,7 +748,7 @@ public Builder setSsnLast4(EmptyParam ssnLast4) { } /** The person's verification status. */ - public Builder setVerification(Verification verification) { + public Builder setVerification(PersonUpdateParams.Verification verification) { this.verification = verification; return this; } @@ -829,8 +829,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public PersonUpdateParams.Address build() { + return new PersonUpdateParams.Address( this.city, this.country, this.extraParams, @@ -1029,8 +1029,8 @@ public static class Builder { private Object town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKana build() { - return new AddressKana( + public PersonUpdateParams.AddressKana build() { + return new PersonUpdateParams.AddressKana( this.city, this.country, this.extraParams, @@ -1242,8 +1242,8 @@ public static class Builder { private Object town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKanji build() { - return new AddressKanji( + public PersonUpdateParams.AddressKanji build() { + return new PersonUpdateParams.AddressKanji( this.city, this.country, this.extraParams, @@ -1416,8 +1416,8 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public PersonUpdateParams.Dob build() { + return new PersonUpdateParams.Dob(this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -1520,15 +1520,17 @@ public static class Builder { private Visa visa; /** Finalize and obtain parameter instance from this builder. */ - public Documents build() { - return new Documents(this.companyAuthorization, this.extraParams, this.passport, this.visa); + public PersonUpdateParams.Documents build() { + return new PersonUpdateParams.Documents( + this.companyAuthorization, this.extraParams, this.passport, this.visa); } /** * One or more documents that demonstrate proof that this person is authorized to represent * the company. */ - public Builder setCompanyAuthorization(CompanyAuthorization companyAuthorization) { + public Builder setCompanyAuthorization( + PersonUpdateParams.Documents.CompanyAuthorization companyAuthorization) { this.companyAuthorization = companyAuthorization; return this; } @@ -1560,7 +1562,7 @@ public Builder putAllExtraParam(Map map) { } /** One or more documents showing the person's passport page with photo and personal data. */ - public Builder setPassport(Passport passport) { + public Builder setPassport(PersonUpdateParams.Documents.Passport passport) { this.passport = passport; return this; } @@ -1569,7 +1571,7 @@ public Builder setPassport(Passport passport) { * One or more documents showing the person's visa required for living in the country where * they are residing. */ - public Builder setVisa(Visa visa) { + public Builder setVisa(PersonUpdateParams.Documents.Visa visa) { this.visa = visa; return this; } @@ -1609,8 +1611,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyAuthorization build() { - return new CompanyAuthorization(this.extraParams, this.files); + public PersonUpdateParams.Documents.CompanyAuthorization build() { + return new PersonUpdateParams.Documents.CompanyAuthorization( + this.extraParams, this.files); } /** @@ -1703,8 +1706,8 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public Passport build() { - return new Passport(this.extraParams, this.files); + public PersonUpdateParams.Documents.Passport build() { + return new PersonUpdateParams.Documents.Passport(this.extraParams, this.files); } /** @@ -1797,8 +1800,8 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public Visa build() { - return new Visa(this.extraParams, this.files); + public PersonUpdateParams.Documents.Visa build() { + return new PersonUpdateParams.Documents.Visa(this.extraParams, this.files); } /** @@ -1933,8 +1936,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public RegisteredAddress build() { - return new RegisteredAddress( + public PersonUpdateParams.RegisteredAddress build() { + return new PersonUpdateParams.RegisteredAddress( this.city, this.country, this.extraParams, @@ -2135,8 +2138,8 @@ public static class Builder { private Object title; /** Finalize and obtain parameter instance from this builder. */ - public Relationship build() { - return new Relationship( + public PersonUpdateParams.Relationship build() { + return new PersonUpdateParams.Relationship( this.director, this.executive, this.extraParams, @@ -2276,21 +2279,23 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Verification build() { - return new Verification(this.additionalDocument, this.document, this.extraParams); + public PersonUpdateParams.Verification build() { + return new PersonUpdateParams.Verification( + this.additionalDocument, this.document, this.extraParams); } /** * A document showing address, either a passport, local ID card, or utility bill from a * well-known utility company. */ - public Builder setAdditionalDocument(AdditionalDocument additionalDocument) { + public Builder setAdditionalDocument( + PersonUpdateParams.Verification.AdditionalDocument additionalDocument) { this.additionalDocument = additionalDocument; return this; } /** An identifying document, either a passport or local ID card. */ - public Builder setDocument(Document document) { + public Builder setDocument(PersonUpdateParams.Verification.Document document) { this.document = document; return this; } @@ -2369,8 +2374,9 @@ public static class Builder { private Object front; /** Finalize and obtain parameter instance from this builder. */ - public AdditionalDocument build() { - return new AdditionalDocument(this.back, this.extraParams, this.front); + public PersonUpdateParams.Verification.AdditionalDocument build() { + return new PersonUpdateParams.Verification.AdditionalDocument( + this.back, this.extraParams, this.front); } /** @@ -2494,8 +2500,9 @@ public static class Builder { private Object front; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document(this.back, this.extraParams, this.front); + public PersonUpdateParams.Verification.Document build() { + return new PersonUpdateParams.Verification.Document( + this.back, this.extraParams, this.front); } /** diff --git a/src/main/java/com/stripe/param/PlanCreateParams.java b/src/main/java/com/stripe/param/PlanCreateParams.java index dd244ce4dad..9b7d2c53866 100644 --- a/src/main/java/com/stripe/param/PlanCreateParams.java +++ b/src/main/java/com/stripe/param/PlanCreateParams.java @@ -115,7 +115,7 @@ public class PlanCreateParams extends ApiRequestParams { * set to {@code tiered}. See also the documentation for {@code billing_scheme}. */ @SerializedName("tiers") - List tiers; + List tiers; /** * Defines if the tiering price should be {@code graduated} or {@code volume} based. In {@code @@ -164,7 +164,7 @@ private PlanCreateParams( Object metadata, String nickname, Object product, - List tiers, + List tiers, TiersMode tiersMode, TransformUsage transformUsage, Long trialPeriodDays, @@ -223,7 +223,7 @@ public static class Builder { private Object product; - private List tiers; + private List tiers; private TiersMode tiersMode; @@ -270,7 +270,7 @@ public Builder setActive(Boolean active) { * last usage record ever (across period bounds) or {@code max} which uses the usage record with * the maximum reported usage during a period. Defaults to {@code sum}. */ - public Builder setAggregateUsage(AggregateUsage aggregateUsage) { + public Builder setAggregateUsage(PlanCreateParams.AggregateUsage aggregateUsage) { this.aggregateUsage = aggregateUsage; return this; } @@ -301,7 +301,7 @@ public Builder setAmountDecimal(BigDecimal amountDecimal) { * that the unit pricing will be computed using a tiering strategy as defined using the {@code * tiers} and {@code tiers_mode} attributes. */ - public Builder setBillingScheme(BillingScheme billingScheme) { + public Builder setBillingScheme(PlanCreateParams.BillingScheme billingScheme) { this.billingScheme = billingScheme; return this; } @@ -381,7 +381,7 @@ public Builder setId(String id) { /** * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval(PlanCreateParams.Interval interval) { this.interval = interval; return this; } @@ -452,7 +452,7 @@ public Builder setNickname(String nickname) { return this; } - public Builder setProduct(Product product) { + public Builder setProduct(PlanCreateParams.Product product) { this.product = product; return this; } @@ -467,7 +467,7 @@ public Builder setProduct(String product) { * subsequent calls adds additional elements to the original list. See {@link * PlanCreateParams#tiers} for the field documentation. */ - public Builder addTier(Tier element) { + public Builder addTier(PlanCreateParams.Tier element) { if (this.tiers == null) { this.tiers = new ArrayList<>(); } @@ -480,7 +480,7 @@ public Builder addTier(Tier element) { * subsequent calls adds additional elements to the original list. See {@link * PlanCreateParams#tiers} for the field documentation. */ - public Builder addAllTier(List elements) { + public Builder addAllTier(List elements) { if (this.tiers == null) { this.tiers = new ArrayList<>(); } @@ -493,7 +493,7 @@ public Builder addAllTier(List elements) { * volume}-based tiering, the maximum quantity within a period determines the per unit price, in * {@code graduated} tiering pricing can successively change as the quantity grows. */ - public Builder setTiersMode(TiersMode tiersMode) { + public Builder setTiersMode(PlanCreateParams.TiersMode tiersMode) { this.tiersMode = tiersMode; return this; } @@ -502,7 +502,7 @@ public Builder setTiersMode(TiersMode tiersMode) { * Apply a transformation to the reported usage or set quantity before computing the billed * price. Cannot be combined with {@code tiers}. */ - public Builder setTransformUsage(TransformUsage transformUsage) { + public Builder setTransformUsage(PlanCreateParams.TransformUsage transformUsage) { this.transformUsage = transformUsage; return this; } @@ -523,7 +523,7 @@ public Builder setTrialPeriodDays(Long trialPeriodDays) { * it to a subscription. {@code metered} aggregates the total usage based on usage records. * Defaults to {@code licensed}. */ - public Builder setUsageType(UsageType usageType) { + public Builder setUsageType(PlanCreateParams.UsageType usageType) { this.usageType = usageType; return this; } @@ -628,8 +628,8 @@ public static class Builder { private String unitLabel; /** Finalize and obtain parameter instance from this builder. */ - public Product build() { - return new Product( + public PlanCreateParams.Product build() { + return new PlanCreateParams.Product( this.active, this.extraParams, this.id, @@ -821,8 +821,8 @@ public static class Builder { private Object upTo; /** Finalize and obtain parameter instance from this builder. */ - public Tier build() { - return new Tier( + public PlanCreateParams.Tier build() { + return new PlanCreateParams.Tier( this.extraParams, this.flatAmount, this.flatAmountDecimal, @@ -895,7 +895,7 @@ public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) { * Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the * previous tier adding one. Use {@code inf} to define a fallback tier. */ - public Builder setUpTo(UpTo upTo) { + public Builder setUpTo(PlanCreateParams.Tier.UpTo upTo) { this.upTo = upTo; return this; } @@ -960,8 +960,8 @@ public static class Builder { private Round round; /** Finalize and obtain parameter instance from this builder. */ - public TransformUsage build() { - return new TransformUsage(this.divideBy, this.extraParams, this.round); + public PlanCreateParams.TransformUsage build() { + return new PlanCreateParams.TransformUsage(this.divideBy, this.extraParams, this.round); } /** Divide usage by this number. */ @@ -997,7 +997,7 @@ public Builder putAllExtraParam(Map map) { } /** After division, either round the result {@code up} or {@code down}. */ - public Builder setRound(Round round) { + public Builder setRound(PlanCreateParams.TransformUsage.Round round) { this.round = round; return this; } diff --git a/src/main/java/com/stripe/param/PlanListParams.java b/src/main/java/com/stripe/param/PlanListParams.java index 3c7311f708a..596dacc5d99 100644 --- a/src/main/java/com/stripe/param/PlanListParams.java +++ b/src/main/java/com/stripe/param/PlanListParams.java @@ -134,7 +134,7 @@ public Builder setActive(Boolean active) { * with an integer Unix timestamp, or it can be a dictionary with a number of different query * options. */ - public Builder setCreated(Created created) { + public Builder setCreated(PlanListParams.Created created) { this.created = created; return this; } @@ -290,8 +290,8 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public PlanListParams.Created build() { + return new PlanListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/PriceCreateParams.java b/src/main/java/com/stripe/param/PriceCreateParams.java index ab280e40c9f..a8992b04799 100644 --- a/src/main/java/com/stripe/param/PriceCreateParams.java +++ b/src/main/java/com/stripe/param/PriceCreateParams.java @@ -40,7 +40,7 @@ public class PriceCreateParams extends ApiRequestParams { * href="https://stripe.com/docs/currencies">supported currency. */ @SerializedName("currency_options") - Map currencyOptions; + Map currencyOptions; /** * When set, provides configuration for the amount to be adjusted by the customer during Checkout @@ -107,7 +107,7 @@ public class PriceCreateParams extends ApiRequestParams { * set to {@code tiered}. See also the documentation for {@code billing_scheme}. */ @SerializedName("tiers") - List tiers; + List tiers; /** * Defines if the tiering price should be {@code graduated} or {@code volume} based. In {@code @@ -151,7 +151,7 @@ private PriceCreateParams( Boolean active, BillingScheme billingScheme, String currency, - Map currencyOptions, + Map currencyOptions, CustomUnitAmount customUnitAmount, List expand, Map extraParams, @@ -162,7 +162,7 @@ private PriceCreateParams( ProductData productData, Recurring recurring, TaxBehavior taxBehavior, - List tiers, + List tiers, TiersMode tiersMode, Boolean transferLookupKey, TransformQuantity transformQuantity, @@ -201,7 +201,7 @@ public static class Builder { private String currency; - private Map currencyOptions; + private Map currencyOptions; private CustomUnitAmount customUnitAmount; @@ -223,7 +223,7 @@ public static class Builder { private TaxBehavior taxBehavior; - private List tiers; + private List tiers; private TiersMode tiersMode; @@ -274,7 +274,7 @@ public Builder setActive(Boolean active) { * usage_type=metered}). {@code tiered} indicates that the unit pricing will be computed using a * tiering strategy as defined using the {@code tiers} and {@code tiers_mode} attributes. */ - public Builder setBillingScheme(BillingScheme billingScheme) { + public Builder setBillingScheme(PriceCreateParams.BillingScheme billingScheme) { this.billingScheme = billingScheme; return this; } @@ -294,7 +294,7 @@ public Builder setCurrency(String currency) { * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link PriceCreateParams#currencyOptions} for the field documentation. */ - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption(String key, PriceCreateParams.CurrencyOption value) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -307,7 +307,7 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link PriceCreateParams#currencyOptions} for the field documentation. */ - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption(Map map) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -319,7 +319,7 @@ public Builder putAllCurrencyOption(Map map) { * When set, provides configuration for the amount to be adjusted by the customer during * Checkout Sessions and Payment Links. */ - public Builder setCustomUnitAmount(CustomUnitAmount customUnitAmount) { + public Builder setCustomUnitAmount(PriceCreateParams.CustomUnitAmount customUnitAmount) { this.customUnitAmount = customUnitAmount; return this; } @@ -424,13 +424,13 @@ public Builder setProduct(String product) { } /** These fields can be used to create a new product that this price will belong to. */ - public Builder setProductData(ProductData productData) { + public Builder setProductData(PriceCreateParams.ProductData productData) { this.productData = productData; return this; } /** The recurring components of a price such as {@code interval} and {@code usage_type}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(PriceCreateParams.Recurring recurring) { this.recurring = recurring; return this; } @@ -440,7 +440,7 @@ public Builder setRecurring(Recurring recurring) { * {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either {@code * inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior(PriceCreateParams.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -450,7 +450,7 @@ public Builder setTaxBehavior(TaxBehavior taxBehavior) { * subsequent calls adds additional elements to the original list. See {@link * PriceCreateParams#tiers} for the field documentation. */ - public Builder addTier(Tier element) { + public Builder addTier(PriceCreateParams.Tier element) { if (this.tiers == null) { this.tiers = new ArrayList<>(); } @@ -463,7 +463,7 @@ public Builder addTier(Tier element) { * subsequent calls adds additional elements to the original list. See {@link * PriceCreateParams#tiers} for the field documentation. */ - public Builder addAllTier(List elements) { + public Builder addAllTier(List elements) { if (this.tiers == null) { this.tiers = new ArrayList<>(); } @@ -476,7 +476,7 @@ public Builder addAllTier(List elements) { * volume}-based tiering, the maximum quantity within a period determines the per unit price, in * {@code graduated} tiering pricing can successively change as the quantity grows. */ - public Builder setTiersMode(TiersMode tiersMode) { + public Builder setTiersMode(PriceCreateParams.TiersMode tiersMode) { this.tiersMode = tiersMode; return this; } @@ -494,7 +494,7 @@ public Builder setTransferLookupKey(Boolean transferLookupKey) { * Apply a transformation to the reported usage or set quantity before computing the billed * price. Cannot be combined with {@code tiers}. */ - public Builder setTransformQuantity(TransformQuantity transformQuantity) { + public Builder setTransformQuantity(PriceCreateParams.TransformQuantity transformQuantity) { this.transformQuantity = transformQuantity; return this; } @@ -551,7 +551,7 @@ public static class CurrencyOption { * set to {@code tiered}. See also the documentation for {@code billing_scheme}. */ @SerializedName("tiers") - List tiers; + List tiers; /** * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how @@ -572,7 +572,7 @@ private CurrencyOption( CustomUnitAmount customUnitAmount, Map extraParams, TaxBehavior taxBehavior, - List tiers, + List tiers, Long unitAmount, BigDecimal unitAmountDecimal) { this.customUnitAmount = customUnitAmount; @@ -594,15 +594,15 @@ public static class Builder { private TaxBehavior taxBehavior; - private List tiers; + private List tiers; private Long unitAmount; private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption( + public PriceCreateParams.CurrencyOption build() { + return new PriceCreateParams.CurrencyOption( this.customUnitAmount, this.extraParams, this.taxBehavior, @@ -615,7 +615,8 @@ public CurrencyOption build() { * When set, provides configuration for the amount to be adjusted by the customer during * Checkout Sessions and Payment Links. */ - public Builder setCustomUnitAmount(CustomUnitAmount customUnitAmount) { + public Builder setCustomUnitAmount( + PriceCreateParams.CurrencyOption.CustomUnitAmount customUnitAmount) { this.customUnitAmount = customUnitAmount; return this; } @@ -651,7 +652,7 @@ public Builder putAllExtraParam(Map map) { * {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior(PriceCreateParams.CurrencyOption.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -661,7 +662,7 @@ public Builder setTaxBehavior(TaxBehavior taxBehavior) { * subsequent calls adds additional elements to the original list. See {@link * PriceCreateParams.CurrencyOption#tiers} for the field documentation. */ - public Builder addTier(Tier element) { + public Builder addTier(PriceCreateParams.CurrencyOption.Tier element) { if (this.tiers == null) { this.tiers = new ArrayList<>(); } @@ -674,7 +675,7 @@ public Builder addTier(Tier element) { * and subsequent calls adds additional elements to the original list. See {@link * PriceCreateParams.CurrencyOption#tiers} for the field documentation. */ - public Builder addAllTier(List elements) { + public Builder addAllTier(List elements) { if (this.tiers == null) { this.tiers = new ArrayList<>(); } @@ -764,8 +765,8 @@ public static class Builder { private Long preset; /** Finalize and obtain parameter instance from this builder. */ - public CustomUnitAmount build() { - return new CustomUnitAmount( + public PriceCreateParams.CurrencyOption.CustomUnitAmount build() { + return new PriceCreateParams.CurrencyOption.CustomUnitAmount( this.enabled, this.extraParams, this.maximum, this.minimum, this.preset); } @@ -906,8 +907,8 @@ public static class Builder { private Object upTo; /** Finalize and obtain parameter instance from this builder. */ - public Tier build() { - return new Tier( + public PriceCreateParams.CurrencyOption.Tier build() { + return new PriceCreateParams.CurrencyOption.Tier( this.extraParams, this.flatAmount, this.flatAmountDecimal, @@ -983,7 +984,7 @@ public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) { * Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of * the previous tier adding one. Use {@code inf} to define a fallback tier. */ - public Builder setUpTo(UpTo upTo) { + public Builder setUpTo(PriceCreateParams.CurrencyOption.Tier.UpTo upTo) { this.upTo = upTo; return this; } @@ -1088,8 +1089,8 @@ public static class Builder { private Long preset; /** Finalize and obtain parameter instance from this builder. */ - public CustomUnitAmount build() { - return new CustomUnitAmount( + public PriceCreateParams.CustomUnitAmount build() { + return new PriceCreateParams.CustomUnitAmount( this.enabled, this.extraParams, this.maximum, this.minimum, this.preset); } @@ -1250,8 +1251,8 @@ public static class Builder { private String unitLabel; /** Finalize and obtain parameter instance from this builder. */ - public ProductData build() { - return new ProductData( + public PriceCreateParams.ProductData build() { + return new PriceCreateParams.ProductData( this.active, this.extraParams, this.id, @@ -1451,8 +1452,8 @@ public static class Builder { private UsageType usageType; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring( + public PriceCreateParams.Recurring build() { + return new PriceCreateParams.Recurring( this.aggregateUsage, this.extraParams, this.interval, @@ -1468,7 +1469,7 @@ public Recurring build() { * last usage record ever (across period bounds) or {@code max} which uses the usage record * with the maximum reported usage during a period. Defaults to {@code sum}. */ - public Builder setAggregateUsage(AggregateUsage aggregateUsage) { + public Builder setAggregateUsage(PriceCreateParams.Recurring.AggregateUsage aggregateUsage) { this.aggregateUsage = aggregateUsage; return this; } @@ -1503,7 +1504,7 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval(PriceCreateParams.Recurring.Interval interval) { this.interval = interval; return this; } @@ -1534,7 +1535,7 @@ public Builder setTrialPeriodDays(Long trialPeriodDays) { * adding it to a subscription. {@code metered} aggregates the total usage based on usage * records. Defaults to {@code licensed}. */ - public Builder setUsageType(UsageType usageType) { + public Builder setUsageType(PriceCreateParams.Recurring.UsageType usageType) { this.usageType = usageType; return this; } @@ -1675,8 +1676,8 @@ public static class Builder { private Object upTo; /** Finalize and obtain parameter instance from this builder. */ - public Tier build() { - return new Tier( + public PriceCreateParams.Tier build() { + return new PriceCreateParams.Tier( this.extraParams, this.flatAmount, this.flatAmountDecimal, @@ -1749,7 +1750,7 @@ public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) { * Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the * previous tier adding one. Use {@code inf} to define a fallback tier. */ - public Builder setUpTo(UpTo upTo) { + public Builder setUpTo(PriceCreateParams.Tier.UpTo upTo) { this.upTo = upTo; return this; } @@ -1814,8 +1815,8 @@ public static class Builder { private Round round; /** Finalize and obtain parameter instance from this builder. */ - public TransformQuantity build() { - return new TransformQuantity(this.divideBy, this.extraParams, this.round); + public PriceCreateParams.TransformQuantity build() { + return new PriceCreateParams.TransformQuantity(this.divideBy, this.extraParams, this.round); } /** Divide usage by this number. */ @@ -1851,7 +1852,7 @@ public Builder putAllExtraParam(Map map) { } /** After division, either round the result {@code up} or {@code down}. */ - public Builder setRound(Round round) { + public Builder setRound(PriceCreateParams.TransformQuantity.Round round) { this.round = round; return this; } diff --git a/src/main/java/com/stripe/param/PriceListParams.java b/src/main/java/com/stripe/param/PriceListParams.java index b2ef15e4311..a3311986ba0 100644 --- a/src/main/java/com/stripe/param/PriceListParams.java +++ b/src/main/java/com/stripe/param/PriceListParams.java @@ -170,7 +170,7 @@ public Builder setActive(Boolean active) { * with an integer Unix timestamp, or it can be a dictionary with a number of different query * options. */ - public Builder setCreated(Created created) { + public Builder setCreated(PriceListParams.Created created) { this.created = created; return this; } @@ -296,7 +296,7 @@ public Builder setProduct(String product) { } /** Only return prices with these recurring fields. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(PriceListParams.Recurring recurring) { this.recurring = recurring; return this; } @@ -313,7 +313,7 @@ public Builder setStartingAfter(String startingAfter) { } /** Only return prices of type {@code recurring} or {@code one_time}. */ - public Builder setType(Type type) { + public Builder setType(PriceListParams.Type type) { this.type = type; return this; } @@ -370,8 +370,8 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public PriceListParams.Created build() { + return new PriceListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -467,8 +467,8 @@ public static class Builder { private UsageType usageType; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.usageType); + public PriceListParams.Recurring build() { + return new PriceListParams.Recurring(this.extraParams, this.interval, this.usageType); } /** @@ -501,7 +501,7 @@ public Builder putAllExtraParam(Map map) { * Filter by billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval(PriceListParams.Recurring.Interval interval) { this.interval = interval; return this; } @@ -509,7 +509,7 @@ public Builder setInterval(Interval interval) { /** * Filter by the usage type for this price. Can be either {@code metered} or {@code licensed}. */ - public Builder setUsageType(UsageType usageType) { + public Builder setUsageType(PriceListParams.Recurring.UsageType usageType) { this.usageType = usageType; return this; } diff --git a/src/main/java/com/stripe/param/PriceUpdateParams.java b/src/main/java/com/stripe/param/PriceUpdateParams.java index 98c46d2ad2c..82d78b2014f 100644 --- a/src/main/java/com/stripe/param/PriceUpdateParams.java +++ b/src/main/java/com/stripe/param/PriceUpdateParams.java @@ -152,7 +152,7 @@ public Builder setActive(Boolean active) { * See {@link PriceUpdateParams#currencyOptions} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption(String key, PriceUpdateParams.CurrencyOption value) { if (this.currencyOptions == null || this.currencyOptions instanceof EmptyParam) { this.currencyOptions = new HashMap(); } @@ -166,7 +166,7 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * See {@link PriceUpdateParams#currencyOptions} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption(Map map) { if (this.currencyOptions == null || this.currencyOptions instanceof EmptyParam) { this.currencyOptions = new HashMap(); } @@ -189,7 +189,8 @@ public Builder setCurrencyOptions(EmptyParam currencyOptions) { * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code and a supported currency. */ - public Builder setCurrencyOptions(Map currencyOptions) { + public Builder setCurrencyOptions( + Map currencyOptions) { this.currencyOptions = currencyOptions; return this; } @@ -327,7 +328,7 @@ public Builder setNickname(EmptyParam nickname) { } /** The recurring components of a price such as {@code interval} and {@code usage_type}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(PriceUpdateParams.Recurring recurring) { this.recurring = recurring; return this; } @@ -343,7 +344,7 @@ public Builder setRecurring(EmptyParam recurring) { * {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either {@code * inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior(PriceUpdateParams.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -389,7 +390,7 @@ public static class CurrencyOption { * set to {@code tiered}. See also the documentation for {@code billing_scheme}. */ @SerializedName("tiers") - List tiers; + List tiers; /** * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how @@ -410,7 +411,7 @@ private CurrencyOption( CustomUnitAmount customUnitAmount, Map extraParams, TaxBehavior taxBehavior, - List tiers, + List tiers, Long unitAmount, Object unitAmountDecimal) { this.customUnitAmount = customUnitAmount; @@ -432,15 +433,15 @@ public static class Builder { private TaxBehavior taxBehavior; - private List tiers; + private List tiers; private Long unitAmount; private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption( + public PriceUpdateParams.CurrencyOption build() { + return new PriceUpdateParams.CurrencyOption( this.customUnitAmount, this.extraParams, this.taxBehavior, @@ -453,7 +454,8 @@ public CurrencyOption build() { * When set, provides configuration for the amount to be adjusted by the customer during * Checkout Sessions and Payment Links. */ - public Builder setCustomUnitAmount(CustomUnitAmount customUnitAmount) { + public Builder setCustomUnitAmount( + PriceUpdateParams.CurrencyOption.CustomUnitAmount customUnitAmount) { this.customUnitAmount = customUnitAmount; return this; } @@ -489,7 +491,7 @@ public Builder putAllExtraParam(Map map) { * {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior(PriceUpdateParams.CurrencyOption.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -499,7 +501,7 @@ public Builder setTaxBehavior(TaxBehavior taxBehavior) { * subsequent calls adds additional elements to the original list. See {@link * PriceUpdateParams.CurrencyOption#tiers} for the field documentation. */ - public Builder addTier(Tier element) { + public Builder addTier(PriceUpdateParams.CurrencyOption.Tier element) { if (this.tiers == null) { this.tiers = new ArrayList<>(); } @@ -512,7 +514,7 @@ public Builder addTier(Tier element) { * and subsequent calls adds additional elements to the original list. See {@link * PriceUpdateParams.CurrencyOption#tiers} for the field documentation. */ - public Builder addAllTier(List elements) { + public Builder addAllTier(List elements) { if (this.tiers == null) { this.tiers = new ArrayList<>(); } @@ -612,8 +614,8 @@ public static class Builder { private Long preset; /** Finalize and obtain parameter instance from this builder. */ - public CustomUnitAmount build() { - return new CustomUnitAmount( + public PriceUpdateParams.CurrencyOption.CustomUnitAmount build() { + return new PriceUpdateParams.CurrencyOption.CustomUnitAmount( this.enabled, this.extraParams, this.maximum, this.minimum, this.preset); } @@ -754,8 +756,8 @@ public static class Builder { private Object upTo; /** Finalize and obtain parameter instance from this builder. */ - public Tier build() { - return new Tier( + public PriceUpdateParams.CurrencyOption.Tier build() { + return new PriceUpdateParams.CurrencyOption.Tier( this.extraParams, this.flatAmount, this.flatAmountDecimal, @@ -851,7 +853,7 @@ public Builder setUnitAmountDecimal(EmptyParam unitAmountDecimal) { * Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of * the previous tier adding one. Use {@code inf} to define a fallback tier. */ - public Builder setUpTo(UpTo upTo) { + public Builder setUpTo(PriceUpdateParams.CurrencyOption.Tier.UpTo upTo) { this.upTo = upTo; return this; } @@ -932,8 +934,8 @@ public static class Builder { private Long trialPeriodDays; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.trialPeriodDays); + public PriceUpdateParams.Recurring build() { + return new PriceUpdateParams.Recurring(this.extraParams, this.trialPeriodDays); } /** diff --git a/src/main/java/com/stripe/param/ProductCreateParams.java b/src/main/java/com/stripe/param/ProductCreateParams.java index b0b9e913209..74ecf73b6ed 100644 --- a/src/main/java/com/stripe/param/ProductCreateParams.java +++ b/src/main/java/com/stripe/param/ProductCreateParams.java @@ -310,7 +310,7 @@ public Builder addAllDeactivateOn(List elements) { * Data used to generate a new Price object. * This Price will be set as the default price for this product. */ - public Builder setDefaultPriceData(DefaultPriceData defaultPriceData) { + public Builder setDefaultPriceData(ProductCreateParams.DefaultPriceData defaultPriceData) { this.defaultPriceData = defaultPriceData; return this; } @@ -445,7 +445,7 @@ public Builder setName(String name) { } /** The dimensions of this product for shipping purposes. */ - public Builder setPackageDimensions(PackageDimensions packageDimensions) { + public Builder setPackageDimensions(ProductCreateParams.PackageDimensions packageDimensions) { this.packageDimensions = packageDimensions; return this; } @@ -483,7 +483,7 @@ public Builder setTaxCode(String taxCode) { * this product with Orders and SKUs. On API versions before {@code 2018-02-05}, this field * defaults to {@code good} for compatibility reasons. */ - public Builder setType(Type type) { + public Builder setType(ProductCreateParams.Type type) { this.type = type; return this; } @@ -520,7 +520,7 @@ public static class DefaultPriceData { * href="https://stripe.com/docs/currencies">supported currency. */ @SerializedName("currency_options") - Map currencyOptions; + Map currencyOptions; /** * Map of extra parameters for custom features not available in this client library. The content @@ -560,7 +560,7 @@ public static class DefaultPriceData { private DefaultPriceData( String currency, - Map currencyOptions, + Map currencyOptions, Map extraParams, Recurring recurring, TaxBehavior taxBehavior, @@ -582,7 +582,7 @@ public static Builder builder() { public static class Builder { private String currency; - private Map currencyOptions; + private Map currencyOptions; private Map extraParams; @@ -595,8 +595,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public DefaultPriceData build() { - return new DefaultPriceData( + public ProductCreateParams.DefaultPriceData build() { + return new ProductCreateParams.DefaultPriceData( this.currency, this.currencyOptions, this.extraParams, @@ -622,7 +622,8 @@ public Builder setCurrency(String currency) { * See {@link ProductCreateParams.DefaultPriceData#currencyOptions} for the field * documentation. */ - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption( + String key, ProductCreateParams.DefaultPriceData.CurrencyOption value) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -636,7 +637,8 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * See {@link ProductCreateParams.DefaultPriceData#currencyOptions} for the field * documentation. */ - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption( + Map map) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -673,7 +675,7 @@ public Builder putAllExtraParam(Map map) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(ProductCreateParams.DefaultPriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -683,7 +685,7 @@ public Builder setRecurring(Recurring recurring) { * {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior(ProductCreateParams.DefaultPriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -739,7 +741,7 @@ public static class CurrencyOption { * be set to {@code tiered}. See also the documentation for {@code billing_scheme}. */ @SerializedName("tiers") - List tiers; + List tiers; /** * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how @@ -760,7 +762,7 @@ private CurrencyOption( CustomUnitAmount customUnitAmount, Map extraParams, TaxBehavior taxBehavior, - List tiers, + List tiers, Long unitAmount, BigDecimal unitAmountDecimal) { this.customUnitAmount = customUnitAmount; @@ -782,15 +784,15 @@ public static class Builder { private TaxBehavior taxBehavior; - private List tiers; + private List tiers; private Long unitAmount; private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption( + public ProductCreateParams.DefaultPriceData.CurrencyOption build() { + return new ProductCreateParams.DefaultPriceData.CurrencyOption( this.customUnitAmount, this.extraParams, this.taxBehavior, @@ -803,7 +805,8 @@ public CurrencyOption build() { * When set, provides configuration for the amount to be adjusted by the customer during * Checkout Sessions and Payment Links. */ - public Builder setCustomUnitAmount(CustomUnitAmount customUnitAmount) { + public Builder setCustomUnitAmount( + ProductCreateParams.DefaultPriceData.CurrencyOption.CustomUnitAmount customUnitAmount) { this.customUnitAmount = customUnitAmount; return this; } @@ -841,7 +844,8 @@ public Builder putAllExtraParam(Map map) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + ProductCreateParams.DefaultPriceData.CurrencyOption.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -851,7 +855,7 @@ public Builder setTaxBehavior(TaxBehavior taxBehavior) { * and subsequent calls adds additional elements to the original list. See {@link * ProductCreateParams.DefaultPriceData.CurrencyOption#tiers} for the field documentation. */ - public Builder addTier(Tier element) { + public Builder addTier(ProductCreateParams.DefaultPriceData.CurrencyOption.Tier element) { if (this.tiers == null) { this.tiers = new ArrayList<>(); } @@ -864,7 +868,8 @@ public Builder addTier(Tier element) { * and subsequent calls adds additional elements to the original list. See {@link * ProductCreateParams.DefaultPriceData.CurrencyOption#tiers} for the field documentation. */ - public Builder addAllTier(List elements) { + public Builder addAllTier( + List elements) { if (this.tiers == null) { this.tiers = new ArrayList<>(); } @@ -955,8 +960,8 @@ public static class Builder { private Long preset; /** Finalize and obtain parameter instance from this builder. */ - public CustomUnitAmount build() { - return new CustomUnitAmount( + public ProductCreateParams.DefaultPriceData.CurrencyOption.CustomUnitAmount build() { + return new ProductCreateParams.DefaultPriceData.CurrencyOption.CustomUnitAmount( this.enabled, this.extraParams, this.maximum, this.minimum, this.preset); } @@ -1101,8 +1106,8 @@ public static class Builder { private Object upTo; /** Finalize and obtain parameter instance from this builder. */ - public Tier build() { - return new Tier( + public ProductCreateParams.DefaultPriceData.CurrencyOption.Tier build() { + return new ProductCreateParams.DefaultPriceData.CurrencyOption.Tier( this.extraParams, this.flatAmount, this.flatAmountDecimal, @@ -1178,7 +1183,8 @@ public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) { * Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of * the previous tier adding one. Use {@code inf} to define a fallback tier. */ - public Builder setUpTo(UpTo upTo) { + public Builder setUpTo( + ProductCreateParams.DefaultPriceData.CurrencyOption.Tier.UpTo upTo) { this.upTo = upTo; return this; } @@ -1269,8 +1275,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public ProductCreateParams.DefaultPriceData.Recurring build() { + return new ProductCreateParams.DefaultPriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -1305,7 +1312,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + ProductCreateParams.DefaultPriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -1418,8 +1426,8 @@ public static class Builder { private BigDecimal width; /** Finalize and obtain parameter instance from this builder. */ - public PackageDimensions build() { - return new PackageDimensions( + public ProductCreateParams.PackageDimensions build() { + return new ProductCreateParams.PackageDimensions( this.extraParams, this.height, this.length, this.weight, this.width); } diff --git a/src/main/java/com/stripe/param/ProductListParams.java b/src/main/java/com/stripe/param/ProductListParams.java index 53e68bbe4b5..072d75fb75f 100644 --- a/src/main/java/com/stripe/param/ProductListParams.java +++ b/src/main/java/com/stripe/param/ProductListParams.java @@ -158,7 +158,7 @@ public Builder setActive(Boolean active) { } /** Only return products that were created during the given date interval. */ - public Builder setCreated(Created created) { + public Builder setCreated(ProductListParams.Created created) { this.created = created; return this; } @@ -285,7 +285,7 @@ public Builder setStartingAfter(String startingAfter) { } /** Only return products of this type. */ - public Builder setType(Type type) { + public Builder setType(ProductListParams.Type type) { this.type = type; return this; } @@ -348,8 +348,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public ProductListParams.Created build() { + return new ProductListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/ProductUpdateParams.java b/src/main/java/com/stripe/param/ProductUpdateParams.java index e2d21a969c9..4f17a53849f 100644 --- a/src/main/java/com/stripe/param/ProductUpdateParams.java +++ b/src/main/java/com/stripe/param/ProductUpdateParams.java @@ -517,7 +517,7 @@ public Builder setName(EmptyParam name) { } /** The dimensions of this product for shipping purposes. */ - public Builder setPackageDimensions(PackageDimensions packageDimensions) { + public Builder setPackageDimensions(ProductUpdateParams.PackageDimensions packageDimensions) { this.packageDimensions = packageDimensions; return this; } @@ -665,8 +665,8 @@ public static class Builder { private BigDecimal width; /** Finalize and obtain parameter instance from this builder. */ - public PackageDimensions build() { - return new PackageDimensions( + public ProductUpdateParams.PackageDimensions build() { + return new ProductUpdateParams.PackageDimensions( this.extraParams, this.height, this.length, this.weight, this.width); } diff --git a/src/main/java/com/stripe/param/PromotionCodeCreateParams.java b/src/main/java/com/stripe/param/PromotionCodeCreateParams.java index b4b1d4c78b0..71c1700afe4 100644 --- a/src/main/java/com/stripe/param/PromotionCodeCreateParams.java +++ b/src/main/java/com/stripe/param/PromotionCodeCreateParams.java @@ -265,7 +265,7 @@ public Builder putAllMetadata(Map map) { } /** Settings that restrict the redemption of the promotion code. */ - public Builder setRestrictions(Restrictions restrictions) { + public Builder setRestrictions(PromotionCodeCreateParams.Restrictions restrictions) { this.restrictions = restrictions; return this; } @@ -279,7 +279,7 @@ public static class Restrictions { * href="https://stripe.com/docs/currencies">supported currency. */ @SerializedName("currency_options") - Map currencyOptions; + Map currencyOptions; /** * Map of extra parameters for custom features not available in this client library. The content @@ -309,7 +309,7 @@ public static class Restrictions { String minimumAmountCurrency; private Restrictions( - Map currencyOptions, + Map currencyOptions, Map extraParams, Boolean firstTimeTransaction, Long minimumAmount, @@ -326,7 +326,7 @@ public static Builder builder() { } public static class Builder { - private Map currencyOptions; + private Map currencyOptions; private Map extraParams; @@ -337,8 +337,8 @@ public static class Builder { private String minimumAmountCurrency; /** Finalize and obtain parameter instance from this builder. */ - public Restrictions build() { - return new Restrictions( + public PromotionCodeCreateParams.Restrictions build() { + return new PromotionCodeCreateParams.Restrictions( this.currencyOptions, this.extraParams, this.firstTimeTransaction, @@ -352,7 +352,8 @@ public Restrictions build() { * See {@link PromotionCodeCreateParams.Restrictions#currencyOptions} for the field * documentation. */ - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption( + String key, PromotionCodeCreateParams.Restrictions.CurrencyOption value) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -366,7 +367,8 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * See {@link PromotionCodeCreateParams.Restrictions#currencyOptions} for the field * documentation. */ - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption( + Map map) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -460,8 +462,9 @@ public static class Builder { private Long minimumAmount; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption(this.extraParams, this.minimumAmount); + public PromotionCodeCreateParams.Restrictions.CurrencyOption build() { + return new PromotionCodeCreateParams.Restrictions.CurrencyOption( + this.extraParams, this.minimumAmount); } /** diff --git a/src/main/java/com/stripe/param/PromotionCodeListParams.java b/src/main/java/com/stripe/param/PromotionCodeListParams.java index cfea4adc84b..c75505665fa 100644 --- a/src/main/java/com/stripe/param/PromotionCodeListParams.java +++ b/src/main/java/com/stripe/param/PromotionCodeListParams.java @@ -158,7 +158,7 @@ public Builder setCoupon(String coupon) { * with an integer Unix timestamp, or it can be a dictionary with a number of different query * options. */ - public Builder setCreated(Created created) { + public Builder setCreated(PromotionCodeListParams.Created created) { this.created = created; return this; } @@ -314,8 +314,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public PromotionCodeListParams.Created build() { + return new PromotionCodeListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/PromotionCodeUpdateParams.java b/src/main/java/com/stripe/param/PromotionCodeUpdateParams.java index 34507f7de81..2c1264c99dd 100644 --- a/src/main/java/com/stripe/param/PromotionCodeUpdateParams.java +++ b/src/main/java/com/stripe/param/PromotionCodeUpdateParams.java @@ -191,7 +191,7 @@ public Builder setMetadata(Map metadata) { } /** Settings that restrict the redemption of the promotion code. */ - public Builder setRestrictions(Restrictions restrictions) { + public Builder setRestrictions(PromotionCodeUpdateParams.Restrictions restrictions) { this.restrictions = restrictions; return this; } @@ -205,7 +205,7 @@ public static class Restrictions { * href="https://stripe.com/docs/currencies">supported currency. */ @SerializedName("currency_options") - Map currencyOptions; + Map currencyOptions; /** * Map of extra parameters for custom features not available in this client library. The content @@ -217,7 +217,8 @@ public static class Restrictions { Map extraParams; private Restrictions( - Map currencyOptions, Map extraParams) { + Map currencyOptions, + Map extraParams) { this.currencyOptions = currencyOptions; this.extraParams = extraParams; } @@ -227,13 +228,13 @@ public static Builder builder() { } public static class Builder { - private Map currencyOptions; + private Map currencyOptions; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Restrictions build() { - return new Restrictions(this.currencyOptions, this.extraParams); + public PromotionCodeUpdateParams.Restrictions build() { + return new PromotionCodeUpdateParams.Restrictions(this.currencyOptions, this.extraParams); } /** @@ -242,7 +243,8 @@ public Restrictions build() { * See {@link PromotionCodeUpdateParams.Restrictions#currencyOptions} for the field * documentation. */ - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption( + String key, PromotionCodeUpdateParams.Restrictions.CurrencyOption value) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -256,7 +258,8 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * See {@link PromotionCodeUpdateParams.Restrictions#currencyOptions} for the field * documentation. */ - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption( + Map map) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -324,8 +327,9 @@ public static class Builder { private Long minimumAmount; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption(this.extraParams, this.minimumAmount); + public PromotionCodeUpdateParams.Restrictions.CurrencyOption build() { + return new PromotionCodeUpdateParams.Restrictions.CurrencyOption( + this.extraParams, this.minimumAmount); } /** diff --git a/src/main/java/com/stripe/param/QuoteCreateParams.java b/src/main/java/com/stripe/param/QuoteCreateParams.java index 8790bf4aece..105fb471018 100644 --- a/src/main/java/com/stripe/param/QuoteCreateParams.java +++ b/src/main/java/com/stripe/param/QuoteCreateParams.java @@ -122,7 +122,7 @@ public class QuoteCreateParams extends ApiRequestParams { * about the product, the quantity, and the resulting cost. */ @SerializedName("line_items") - List lineItems; + List lineItems; /** * Set of key-value pairs that you can attach @@ -171,7 +171,7 @@ private QuoteCreateParams( FromQuote fromQuote, String header, InvoiceSettings invoiceSettings, - List lineItems, + List lineItems, Map metadata, Object onBehalfOf, SubscriptionData subscriptionData, @@ -235,7 +235,7 @@ public static class Builder { private InvoiceSettings invoiceSettings; - private List lineItems; + private List lineItems; private Map metadata; @@ -318,7 +318,7 @@ public Builder setApplicationFeePercent(EmptyParam applicationFeePercent) { /** * Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(QuoteCreateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -330,7 +330,7 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * sending an invoice, Stripe will email your customer an invoice with payment instructions. * Defaults to {@code charge_automatically}. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(QuoteCreateParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -401,7 +401,7 @@ public Builder setDescription(String description) { * QuoteCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(QuoteCreateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -415,7 +415,7 @@ public Builder addDiscount(Discount element) { * QuoteCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -430,7 +430,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The discounts applied to the quote. You can only set up to one discount. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -513,7 +513,7 @@ public Builder setFooter(String footer) { * Clone an existing quote. The new quote will be created in {@code status=draft}. When using * this parameter, you cannot specify any other parameters except for {@code expires_at}. */ - public Builder setFromQuote(FromQuote fromQuote) { + public Builder setFromQuote(QuoteCreateParams.FromQuote fromQuote) { this.fromQuote = fromQuote; return this; } @@ -529,7 +529,7 @@ public Builder setHeader(String header) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings(QuoteCreateParams.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -539,7 +539,7 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * and subsequent calls adds additional elements to the original list. See {@link * QuoteCreateParams#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(QuoteCreateParams.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -552,7 +552,7 @@ public Builder addLineItem(LineItem element) { * and subsequent calls adds additional elements to the original list. See {@link * QuoteCreateParams#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -605,7 +605,7 @@ public Builder setOnBehalfOf(EmptyParam onBehalfOf) { * subscription_data[effective_date]} is present and in the future, otherwise a subscription is * created. */ - public Builder setSubscriptionData(SubscriptionData subscriptionData) { + public Builder setSubscriptionData(QuoteCreateParams.SubscriptionData subscriptionData) { this.subscriptionData = subscriptionData; return this; } @@ -617,7 +617,7 @@ public Builder setTestClock(String testClock) { } /** The data with which to automatically create a Transfer for each of the invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(QuoteCreateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -662,8 +662,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public QuoteCreateParams.AutomaticTax build() { + return new QuoteCreateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -740,8 +740,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public QuoteCreateParams.Discount build() { + return new QuoteCreateParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -821,8 +821,8 @@ public static class Builder { private String quote; /** Finalize and obtain parameter instance from this builder. */ - public FromQuote build() { - return new FromQuote(this.extraParams, this.isRevision, this.quote); + public QuoteCreateParams.FromQuote build() { + return new QuoteCreateParams.FromQuote(this.extraParams, this.isRevision, this.quote); } /** @@ -898,8 +898,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public QuoteCreateParams.InvoiceSettings build() { + return new QuoteCreateParams.InvoiceSettings(this.daysUntilDue, this.extraParams); } /** @@ -1001,8 +1001,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem( + public QuoteCreateParams.LineItem build() { + return new QuoteCreateParams.LineItem( this.extraParams, this.price, this.priceData, this.quantity, this.taxRates); } @@ -1042,7 +1042,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. One of {@code price} or {@code price_data} is required. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(QuoteCreateParams.LineItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1189,8 +1189,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public QuoteCreateParams.LineItem.PriceData build() { + return new QuoteCreateParams.LineItem.PriceData( this.currency, this.extraParams, this.product, @@ -1247,7 +1247,7 @@ public Builder setProduct(String product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(QuoteCreateParams.LineItem.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -1257,7 +1257,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + QuoteCreateParams.LineItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -1327,8 +1328,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public QuoteCreateParams.LineItem.PriceData.Recurring build() { + return new QuoteCreateParams.LineItem.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -1363,7 +1365,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + QuoteCreateParams.LineItem.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -1481,8 +1484,8 @@ public static class Builder { private Object trialPeriodDays; /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionData build() { - return new SubscriptionData( + public QuoteCreateParams.SubscriptionData build() { + return new QuoteCreateParams.SubscriptionData( this.description, this.effectiveDate, this.extraParams, this.trialPeriodDays); } @@ -1503,7 +1506,8 @@ public Builder setDescription(String description) { * period. The {@code effective_date} is ignored if it is in the past when the quote is * accepted. */ - public Builder setEffectiveDate(EffectiveDate effectiveDate) { + public Builder setEffectiveDate( + QuoteCreateParams.SubscriptionData.EffectiveDate effectiveDate) { this.effectiveDate = effectiveDate; return this; } @@ -1649,8 +1653,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData( + public QuoteCreateParams.TransferData build() { + return new QuoteCreateParams.TransferData( this.amount, this.amountPercent, this.destination, this.extraParams); } diff --git a/src/main/java/com/stripe/param/QuoteListParams.java b/src/main/java/com/stripe/param/QuoteListParams.java index d284b8abd42..35a0405ab26 100644 --- a/src/main/java/com/stripe/param/QuoteListParams.java +++ b/src/main/java/com/stripe/param/QuoteListParams.java @@ -207,7 +207,7 @@ public Builder setStartingAfter(String startingAfter) { } /** The status of the quote. */ - public Builder setStatus(Status status) { + public Builder setStatus(QuoteListParams.Status status) { this.status = status; return this; } diff --git a/src/main/java/com/stripe/param/QuoteUpdateParams.java b/src/main/java/com/stripe/param/QuoteUpdateParams.java index a31fd065d26..e7d08b7a3bc 100644 --- a/src/main/java/com/stripe/param/QuoteUpdateParams.java +++ b/src/main/java/com/stripe/param/QuoteUpdateParams.java @@ -100,7 +100,7 @@ public class QuoteUpdateParams extends ApiRequestParams { * about the product, the quantity, and the resulting cost. */ @SerializedName("line_items") - List lineItems; + List lineItems; /** * Set of key-value pairs that you can attach @@ -144,7 +144,7 @@ private QuoteUpdateParams( Object footer, Object header, InvoiceSettings invoiceSettings, - List lineItems, + List lineItems, Map metadata, Object onBehalfOf, SubscriptionData subscriptionData, @@ -203,7 +203,7 @@ public static class Builder { private InvoiceSettings invoiceSettings; - private List lineItems; + private List lineItems; private Map metadata; @@ -282,7 +282,7 @@ public Builder setApplicationFeePercent(EmptyParam applicationFeePercent) { /** * Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(QuoteUpdateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -294,7 +294,7 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * sending an invoice, Stripe will email your customer an invoice with payment instructions. * Defaults to {@code charge_automatically}. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(QuoteUpdateParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -375,7 +375,7 @@ public Builder setDescription(EmptyParam description) { * QuoteUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(QuoteUpdateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -389,7 +389,7 @@ public Builder addDiscount(Discount element) { * QuoteUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -404,7 +404,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The discounts applied to the quote. You can only set up to one discount. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -495,7 +495,7 @@ public Builder setHeader(EmptyParam header) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings(QuoteUpdateParams.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -505,7 +505,7 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * and subsequent calls adds additional elements to the original list. See {@link * QuoteUpdateParams#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(QuoteUpdateParams.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -518,7 +518,7 @@ public Builder addLineItem(LineItem element) { * and subsequent calls adds additional elements to the original list. See {@link * QuoteUpdateParams#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -571,13 +571,13 @@ public Builder setOnBehalfOf(EmptyParam onBehalfOf) { * subscription_data[effective_date]} is present and in the future, otherwise a subscription is * created. */ - public Builder setSubscriptionData(SubscriptionData subscriptionData) { + public Builder setSubscriptionData(QuoteUpdateParams.SubscriptionData subscriptionData) { this.subscriptionData = subscriptionData; return this; } /** The data with which to automatically create a Transfer for each of the invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(QuoteUpdateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -622,8 +622,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public QuoteUpdateParams.AutomaticTax build() { + return new QuoteUpdateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -700,8 +700,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public QuoteUpdateParams.Discount build() { + return new QuoteUpdateParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -789,8 +789,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public QuoteUpdateParams.InvoiceSettings build() { + return new QuoteUpdateParams.InvoiceSettings(this.daysUntilDue, this.extraParams); } /** @@ -900,8 +900,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem( + public QuoteUpdateParams.LineItem build() { + return new QuoteUpdateParams.LineItem( this.extraParams, this.id, this.price, this.priceData, this.quantity, this.taxRates); } @@ -959,7 +959,7 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. One of {@code price} or {@code price_data} is required. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(QuoteUpdateParams.LineItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1106,8 +1106,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public QuoteUpdateParams.LineItem.PriceData build() { + return new QuoteUpdateParams.LineItem.PriceData( this.currency, this.extraParams, this.product, @@ -1180,7 +1180,7 @@ public Builder setProduct(EmptyParam product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(QuoteUpdateParams.LineItem.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -1190,7 +1190,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + QuoteUpdateParams.LineItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -1270,8 +1271,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public QuoteUpdateParams.LineItem.PriceData.Recurring build() { + return new QuoteUpdateParams.LineItem.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -1306,7 +1308,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + QuoteUpdateParams.LineItem.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -1424,8 +1427,8 @@ public static class Builder { private Object trialPeriodDays; /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionData build() { - return new SubscriptionData( + public QuoteUpdateParams.SubscriptionData build() { + return new QuoteUpdateParams.SubscriptionData( this.description, this.effectiveDate, this.extraParams, this.trialPeriodDays); } @@ -1455,7 +1458,8 @@ public Builder setDescription(EmptyParam description) { * period. The {@code effective_date} is ignored if it is in the past when the quote is * accepted. */ - public Builder setEffectiveDate(EffectiveDate effectiveDate) { + public Builder setEffectiveDate( + QuoteUpdateParams.SubscriptionData.EffectiveDate effectiveDate) { this.effectiveDate = effectiveDate; return this; } @@ -1601,8 +1605,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData( + public QuoteUpdateParams.TransferData build() { + return new QuoteUpdateParams.TransferData( this.amount, this.amountPercent, this.destination, this.extraParams); } diff --git a/src/main/java/com/stripe/param/RefundCreateParams.java b/src/main/java/com/stripe/param/RefundCreateParams.java index bd7844da39d..c79a6e9634f 100644 --- a/src/main/java/com/stripe/param/RefundCreateParams.java +++ b/src/main/java/com/stripe/param/RefundCreateParams.java @@ -286,7 +286,7 @@ public Builder setMetadata(Map metadata) { } /** Origin of the refund. */ - public Builder setOrigin(Origin origin) { + public Builder setOrigin(RefundCreateParams.Origin origin) { this.origin = origin; return this; } @@ -296,7 +296,7 @@ public Builder setPaymentIntent(String paymentIntent) { return this; } - public Builder setReason(Reason reason) { + public Builder setReason(RefundCreateParams.Reason reason) { this.reason = reason; return this; } diff --git a/src/main/java/com/stripe/param/RefundListParams.java b/src/main/java/com/stripe/param/RefundListParams.java index 2351ba48472..4cafbb99c9f 100644 --- a/src/main/java/com/stripe/param/RefundListParams.java +++ b/src/main/java/com/stripe/param/RefundListParams.java @@ -119,7 +119,7 @@ public Builder setCharge(String charge) { return this; } - public Builder setCreated(Created created) { + public Builder setCreated(RefundListParams.Created created) { this.created = created; return this; } @@ -270,8 +270,8 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public RefundListParams.Created build() { + return new RefundListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/ReviewListParams.java b/src/main/java/com/stripe/param/ReviewListParams.java index 08467a58e5e..0ef04bfa5ce 100644 --- a/src/main/java/com/stripe/param/ReviewListParams.java +++ b/src/main/java/com/stripe/param/ReviewListParams.java @@ -95,7 +95,7 @@ public ReviewListParams build() { this.startingAfter); } - public Builder setCreated(Created created) { + public Builder setCreated(ReviewListParams.Created created) { this.created = created; return this; } @@ -240,8 +240,8 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public ReviewListParams.Created build() { + return new ReviewListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/SetupAttemptListParams.java b/src/main/java/com/stripe/param/SetupAttemptListParams.java index 34bbacd928c..79cfb0b69d6 100644 --- a/src/main/java/com/stripe/param/SetupAttemptListParams.java +++ b/src/main/java/com/stripe/param/SetupAttemptListParams.java @@ -113,7 +113,7 @@ public SetupAttemptListParams build() { * with an integer Unix timestamp, or it can be a dictionary with a number of different query * options. */ - public Builder setCreated(Created created) { + public Builder setCreated(SetupAttemptListParams.Created created) { this.created = created; return this; } @@ -269,8 +269,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public SetupAttemptListParams.Created build() { + return new SetupAttemptListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/SetupIntentCancelParams.java b/src/main/java/com/stripe/param/SetupIntentCancelParams.java index 17e0ad392a2..3215a04ef6c 100644 --- a/src/main/java/com/stripe/param/SetupIntentCancelParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCancelParams.java @@ -58,7 +58,8 @@ public SetupIntentCancelParams build() { * Reason for canceling this SetupIntent. Possible values are {@code abandoned}, {@code * requested_by_customer}, or {@code duplicate} */ - public Builder setCancellationReason(CancellationReason cancellationReason) { + public Builder setCancellationReason( + SetupIntentCancelParams.CancellationReason cancellationReason) { this.cancellationReason = cancellationReason; return this; } diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index 8fb539605de..197f71142f8 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -158,7 +158,7 @@ public Builder putAllExtraParam(Map map) { } /** This hash contains details about the Mandate to create. */ - public Builder setMandateData(MandateData mandateData) { + public Builder setMandateData(SetupIntentConfirmParams.MandateData mandateData) { this.mandateData = mandateData; return this; } @@ -177,13 +177,15 @@ public Builder setPaymentMethod(String paymentMethod) { * href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method">{@code * payment_method} value in the SetupIntent. */ - public Builder setPaymentMethodData(PaymentMethodData paymentMethodData) { + public Builder setPaymentMethodData( + SetupIntentConfirmParams.PaymentMethodData paymentMethodData) { this.paymentMethodData = paymentMethodData; return this; } /** Payment-method-specific configuration for this SetupIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + SetupIntentConfirmParams.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -230,12 +232,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateData build() { - return new MandateData(this.customerAcceptance, this.extraParams); + public SetupIntentConfirmParams.MandateData build() { + return new SetupIntentConfirmParams.MandateData(this.customerAcceptance, this.extraParams); } /** This hash contains details about the customer acceptance of the Mandate. */ - public Builder setCustomerAcceptance(CustomerAcceptance customerAcceptance) { + public Builder setCustomerAcceptance( + SetupIntentConfirmParams.MandateData.CustomerAcceptance customerAcceptance) { this.customerAcceptance = customerAcceptance; return this; } @@ -332,8 +335,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public CustomerAcceptance build() { - return new CustomerAcceptance( + public SetupIntentConfirmParams.MandateData.CustomerAcceptance build() { + return new SetupIntentConfirmParams.MandateData.CustomerAcceptance( this.acceptedAt, this.extraParams, this.offline, this.online, this.type); } @@ -375,7 +378,8 @@ public Builder putAllExtraParam(Map map) { * If this is a Mandate accepted offline, this hash contains details about the offline * acceptance. */ - public Builder setOffline(Offline offline) { + public Builder setOffline( + SetupIntentConfirmParams.MandateData.CustomerAcceptance.Offline offline) { this.offline = offline; return this; } @@ -384,7 +388,8 @@ public Builder setOffline(Offline offline) { * If this is a Mandate accepted online, this hash contains details about the online * acceptance. */ - public Builder setOnline(Online online) { + public Builder setOnline( + SetupIntentConfirmParams.MandateData.CustomerAcceptance.Online online) { this.online = online; return this; } @@ -393,7 +398,7 @@ public Builder setOnline(Online online) { * The type of customer acceptance information included with the Mandate. One of {@code * online} or {@code offline}. */ - public Builder setType(Type type) { + public Builder setType(SetupIntentConfirmParams.MandateData.CustomerAcceptance.Type type) { this.type = type; return this; } @@ -423,8 +428,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Offline build() { - return new Offline(this.extraParams); + public SetupIntentConfirmParams.MandateData.CustomerAcceptance.Offline build() { + return new SetupIntentConfirmParams.MandateData.CustomerAcceptance.Offline( + this.extraParams); } /** @@ -497,8 +503,9 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public Online build() { - return new Online(this.extraParams, this.ipAddress, this.userAgent); + public SetupIntentConfirmParams.MandateData.CustomerAcceptance.Online build() { + return new SetupIntentConfirmParams.MandateData.CustomerAcceptance.Online( + this.extraParams, this.ipAddress, this.userAgent); } /** @@ -941,8 +948,8 @@ public static class Builder { private WechatPay wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodData build() { - return new PaymentMethodData( + public SetupIntentConfirmParams.PaymentMethodData build() { + return new SetupIntentConfirmParams.PaymentMethodData( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -982,7 +989,7 @@ public PaymentMethodData build() { * If this is an {@code acss_debit} PaymentMethod, this hash contains details about the ACSS * Debit payment method. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(SetupIntentConfirmParams.PaymentMethodData.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -991,7 +998,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is an {@code affirm} PaymentMethod, this hash contains details about the Affirm * payment method. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(SetupIntentConfirmParams.PaymentMethodData.Affirm affirm) { this.affirm = affirm; return this; } @@ -1000,7 +1007,8 @@ public Builder setAffirm(Affirm affirm) { * If this is an {@code AfterpayClearpay} PaymentMethod, this hash contains details about the * AfterpayClearpay payment method. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + SetupIntentConfirmParams.PaymentMethodData.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -1009,7 +1017,7 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If this is an {@code Alipay} PaymentMethod, this hash contains details about the Alipay * payment method. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(SetupIntentConfirmParams.PaymentMethodData.Alipay alipay) { this.alipay = alipay; return this; } @@ -1018,7 +1026,8 @@ public Builder setAlipay(Alipay alipay) { * If this is an {@code au_becs_debit} PaymentMethod, this hash contains details about the * bank account. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + SetupIntentConfirmParams.PaymentMethodData.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -1027,7 +1036,7 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs * Direct Debit bank account. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(SetupIntentConfirmParams.PaymentMethodData.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -1036,7 +1045,8 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this hash contains details about the * Bancontact payment method. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + SetupIntentConfirmParams.PaymentMethodData.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -1045,7 +1055,8 @@ public Builder setBancontact(Bancontact bancontact) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails( + SetupIntentConfirmParams.PaymentMethodData.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -1054,7 +1065,7 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentConfirmParams.PaymentMethodData.Blik blik) { this.blik = blik; return this; } @@ -1063,7 +1074,7 @@ public Builder setBlik(Blik blik) { * If this is a {@code boleto} PaymentMethod, this hash contains details about the Boleto * payment method. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(SetupIntentConfirmParams.PaymentMethodData.Boleto boleto) { this.boleto = boleto; return this; } @@ -1072,7 +1083,8 @@ public Builder setBoleto(Boleto boleto) { * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + SetupIntentConfirmParams.PaymentMethodData.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -1081,7 +1093,7 @@ public Builder setCustomerBalance(CustomerBalance customerBalance) { * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment * method. */ - public Builder setEps(Eps eps) { + public Builder setEps(SetupIntentConfirmParams.PaymentMethodData.Eps eps) { this.eps = eps; return this; } @@ -1117,7 +1129,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code fpx} PaymentMethod, this hash contains details about the FPX payment * method. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(SetupIntentConfirmParams.PaymentMethodData.Fpx fpx) { this.fpx = fpx; return this; } @@ -1126,7 +1138,7 @@ public Builder setFpx(Fpx fpx) { * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(SetupIntentConfirmParams.PaymentMethodData.Giropay giropay) { this.giropay = giropay; return this; } @@ -1135,7 +1147,7 @@ public Builder setGiropay(Giropay giropay) { * If this is a {@code grabpay} PaymentMethod, this hash contains details about the GrabPay * payment method. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(SetupIntentConfirmParams.PaymentMethodData.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -1144,7 +1156,7 @@ public Builder setGrabpay(Grabpay grabpay) { * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL * payment method. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(SetupIntentConfirmParams.PaymentMethodData.Ideal ideal) { this.ideal = ideal; return this; } @@ -1153,7 +1165,8 @@ public Builder setIdeal(Ideal ideal) { * If this is an {@code interac_present} PaymentMethod, this hash contains details about the * Interac Present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + SetupIntentConfirmParams.PaymentMethodData.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -1162,7 +1175,7 @@ public Builder setInteracPresent(InteracPresent interacPresent) { * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna * payment method. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(SetupIntentConfirmParams.PaymentMethodData.Klarna klarna) { this.klarna = klarna; return this; } @@ -1171,7 +1184,7 @@ public Builder setKlarna(Klarna klarna) { * If this is a {@code konbini} PaymentMethod, this hash contains details about the Konbini * payment method. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(SetupIntentConfirmParams.PaymentMethodData.Konbini konbini) { this.konbini = konbini; return this; } @@ -1180,7 +1193,7 @@ public Builder setKonbini(Konbini konbini) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentConfirmParams.PaymentMethodData.Link link) { this.link = link; return this; } @@ -1216,7 +1229,7 @@ public Builder putAllMetadata(Map map) { * If this is an {@code oxxo} PaymentMethod, this hash contains details about the OXXO payment * method. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(SetupIntentConfirmParams.PaymentMethodData.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -1225,7 +1238,7 @@ public Builder setOxxo(Oxxo oxxo) { * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment * method. */ - public Builder setP24(P24 p24) { + public Builder setP24(SetupIntentConfirmParams.PaymentMethodData.P24 p24) { this.p24 = p24; return this; } @@ -1234,7 +1247,7 @@ public Builder setP24(P24 p24) { * If this is a {@code paynow} PaymentMethod, this hash contains details about the PayNow * payment method. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(SetupIntentConfirmParams.PaymentMethodData.Paynow paynow) { this.paynow = paynow; return this; } @@ -1243,7 +1256,7 @@ public Builder setPaynow(Paynow paynow) { * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. */ - public Builder setPix(Pix pix) { + public Builder setPix(SetupIntentConfirmParams.PaymentMethodData.Pix pix) { this.pix = pix; return this; } @@ -1252,7 +1265,7 @@ public Builder setPix(Pix pix) { * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay(SetupIntentConfirmParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1261,7 +1274,8 @@ public Builder setPromptpay(Promptpay promptpay) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions( + SetupIntentConfirmParams.PaymentMethodData.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -1270,7 +1284,7 @@ public Builder setRadarOptions(RadarOptions radarOptions) { * If this is a {@code sepa_debit} PaymentMethod, this hash contains details about the SEPA * debit bank account. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(SetupIntentConfirmParams.PaymentMethodData.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -1279,7 +1293,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code sofort} PaymentMethod, this hash contains details about the SOFORT * payment method. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(SetupIntentConfirmParams.PaymentMethodData.Sofort sofort) { this.sofort = sofort; return this; } @@ -1289,7 +1303,7 @@ public Builder setSofort(Sofort sofort) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(SetupIntentConfirmParams.PaymentMethodData.Type type) { this.type = type; return this; } @@ -1298,7 +1312,8 @@ public Builder setType(Type type) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentConfirmParams.PaymentMethodData.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -1307,7 +1322,7 @@ public Builder setUsBankAccount(UsBankAccount usBankAccount) { * If this is an {@code wechat_pay} PaymentMethod, this hash contains details about the * wechat_pay payment method. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay(SetupIntentConfirmParams.PaymentMethodData.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -1361,8 +1376,8 @@ public static class Builder { private String transitNumber; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentConfirmParams.PaymentMethodData.AcssDebit build() { + return new SetupIntentConfirmParams.PaymentMethodData.AcssDebit( this.accountNumber, this.extraParams, this.institutionNumber, this.transitNumber); } @@ -1437,8 +1452,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Affirm build() { + return new SetupIntentConfirmParams.PaymentMethodData.Affirm(this.extraParams); } /** @@ -1494,8 +1509,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.AfterpayClearpay build() { + return new SetupIntentConfirmParams.PaymentMethodData.AfterpayClearpay(this.extraParams); } /** @@ -1551,8 +1566,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Alipay build() { + return new SetupIntentConfirmParams.PaymentMethodData.Alipay(this.extraParams); } /** @@ -1622,8 +1637,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.accountNumber, this.bsbNumber, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.AuBecsDebit build() { + return new SetupIntentConfirmParams.PaymentMethodData.AuBecsDebit( + this.accountNumber, this.bsbNumber, this.extraParams); } /** The account number for the bank account. */ @@ -1705,8 +1721,9 @@ public static class Builder { private String sortCode; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.accountNumber, this.extraParams, this.sortCode); + public SetupIntentConfirmParams.PaymentMethodData.BacsDebit build() { + return new SetupIntentConfirmParams.PaymentMethodData.BacsDebit( + this.accountNumber, this.extraParams, this.sortCode); } /** Account number of the bank account that the funds will be debited from. */ @@ -1774,8 +1791,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Bancontact build() { + return new SetupIntentConfirmParams.PaymentMethodData.Bancontact(this.extraParams); } /** @@ -1864,13 +1881,14 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public SetupIntentConfirmParams.PaymentMethodData.BillingDetails build() { + return new SetupIntentConfirmParams.PaymentMethodData.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress( + SetupIntentConfirmParams.PaymentMethodData.BillingDetails.Address address) { this.address = address; return this; } @@ -2010,8 +2028,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public SetupIntentConfirmParams.PaymentMethodData.BillingDetails.Address build() { + return new SetupIntentConfirmParams.PaymentMethodData.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -2116,8 +2134,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Blik build() { + return new SetupIntentConfirmParams.PaymentMethodData.Blik(this.extraParams); } /** @@ -2182,8 +2200,9 @@ public static class Builder { private String taxId; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.extraParams, this.taxId); + public SetupIntentConfirmParams.PaymentMethodData.Boleto build() { + return new SetupIntentConfirmParams.PaymentMethodData.Boleto( + this.extraParams, this.taxId); } /** @@ -2248,8 +2267,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.CustomerBalance build() { + return new SetupIntentConfirmParams.PaymentMethodData.CustomerBalance(this.extraParams); } /** @@ -2312,12 +2331,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.bank, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Eps build() { + return new SetupIntentConfirmParams.PaymentMethodData.Eps(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentConfirmParams.PaymentMethodData.Eps.Bank bank) { this.bank = bank; return this; } @@ -2482,18 +2501,20 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.accountHolderType, this.bank, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Fpx build() { + return new SetupIntentConfirmParams.PaymentMethodData.Fpx( + this.accountHolderType, this.bank, this.extraParams); } /** Account holder type for FPX transaction. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentConfirmParams.PaymentMethodData.Fpx.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentConfirmParams.PaymentMethodData.Fpx.Bank bank) { this.bank = bank; return this; } @@ -2638,8 +2659,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Giropay build() { + return new SetupIntentConfirmParams.PaymentMethodData.Giropay(this.extraParams); } /** @@ -2695,8 +2716,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Grabpay build() { + return new SetupIntentConfirmParams.PaymentMethodData.Grabpay(this.extraParams); } /** @@ -2759,12 +2780,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.bank, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Ideal build() { + return new SetupIntentConfirmParams.PaymentMethodData.Ideal(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentConfirmParams.PaymentMethodData.Ideal.Bank bank) { this.bank = bank; return this; } @@ -2870,8 +2891,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.InteracPresent build() { + return new SetupIntentConfirmParams.PaymentMethodData.InteracPresent(this.extraParams); } /** @@ -2934,12 +2955,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.dob, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Klarna build() { + return new SetupIntentConfirmParams.PaymentMethodData.Klarna(this.dob, this.extraParams); } /** Customer's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(SetupIntentConfirmParams.PaymentMethodData.Klarna.Dob dob) { this.dob = dob; return this; } @@ -3018,8 +3039,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public SetupIntentConfirmParams.PaymentMethodData.Klarna.Dob build() { + return new SetupIntentConfirmParams.PaymentMethodData.Klarna.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -3094,8 +3116,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Konbini build() { + return new SetupIntentConfirmParams.PaymentMethodData.Konbini(this.extraParams); } /** @@ -3151,8 +3173,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Link build() { + return new SetupIntentConfirmParams.PaymentMethodData.Link(this.extraParams); } /** @@ -3208,8 +3230,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Oxxo build() { + return new SetupIntentConfirmParams.PaymentMethodData.Oxxo(this.extraParams); } /** @@ -3272,12 +3294,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.bank, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.P24 build() { + return new SetupIntentConfirmParams.PaymentMethodData.P24(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentConfirmParams.PaymentMethodData.P24.Bank bank) { this.bank = bank; return this; } @@ -3419,8 +3441,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Paynow build() { + return new SetupIntentConfirmParams.PaymentMethodData.Paynow(this.extraParams); } /** @@ -3476,8 +3498,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pix build() { - return new Pix(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Pix build() { + return new SetupIntentConfirmParams.PaymentMethodData.Pix(this.extraParams); } /** @@ -3533,8 +3555,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Promptpay build() { + return new SetupIntentConfirmParams.PaymentMethodData.Promptpay(this.extraParams); } /** @@ -3601,8 +3623,9 @@ public static class Builder { private String session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public SetupIntentConfirmParams.PaymentMethodData.RadarOptions build() { + return new SetupIntentConfirmParams.PaymentMethodData.RadarOptions( + this.extraParams, this.session); } /** @@ -3675,8 +3698,9 @@ public static class Builder { private String iban; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.iban); + public SetupIntentConfirmParams.PaymentMethodData.SepaDebit build() { + return new SetupIntentConfirmParams.PaymentMethodData.SepaDebit( + this.extraParams, this.iban); } /** @@ -3745,12 +3769,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.country, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Sofort build() { + return new SetupIntentConfirmParams.PaymentMethodData.Sofort( + this.country, this.extraParams); } /** Two-letter ISO code representing the country the bank account is located in. */ - public Builder setCountry(Country country) { + public Builder setCountry( + SetupIntentConfirmParams.PaymentMethodData.Sofort.Country country) { this.country = country; return this; } @@ -3876,8 +3902,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentConfirmParams.PaymentMethodData.UsBankAccount build() { + return new SetupIntentConfirmParams.PaymentMethodData.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -3887,7 +3913,9 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentConfirmParams.PaymentMethodData.UsBankAccount.AccountHolderType + accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -3899,7 +3927,8 @@ public Builder setAccountNumber(String accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + SetupIntentConfirmParams.PaymentMethodData.UsBankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -3999,8 +4028,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.WechatPay build() { + return new SetupIntentConfirmParams.PaymentMethodData.WechatPay(this.extraParams); } /** @@ -4211,8 +4240,8 @@ public static class Builder { private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public SetupIntentConfirmParams.PaymentMethodOptions build() { + return new SetupIntentConfirmParams.PaymentMethodOptions( this.acssDebit, this.blik, this.card, @@ -4226,7 +4255,8 @@ public PaymentMethodOptions build() { * If this is a {@code acss_debit} SetupIntent, this sub-hash contains details about the ACSS * Debit payment method options. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -4235,13 +4265,13 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentConfirmParams.PaymentMethodOptions.Blik blik) { this.blik = blik; return this; } /** Configuration for any card setup attempted on this SetupIntent. */ - public Builder setCard(Card card) { + public Builder setCard(SetupIntentConfirmParams.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -4277,7 +4307,7 @@ public Builder putAllExtraParam(Map map) { * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentConfirmParams.PaymentMethodOptions.Link link) { this.link = link; return this; } @@ -4286,7 +4316,8 @@ public Builder setLink(Link link) { * If this is a {@code sepa_debit} SetupIntent, this sub-hash contains details about the SEPA * Debit payment method options. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -4295,7 +4326,8 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the * US bank account payment method options. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -4353,8 +4385,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit( this.currency, this.extraParams, this.mandateOptions, this.verificationMethod); } @@ -4363,7 +4395,8 @@ public AcssDebit build() { * code, in lowercase. Must be a supported * currency. */ - public Builder setCurrency(Currency currency) { + public Builder setCurrency( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.Currency currency) { this.currency = currency; return this; } @@ -4397,13 +4430,16 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -4422,7 +4458,8 @@ public static class MandateOptions { /** List of Stripe products where this mandate can be selected automatically. */ @SerializedName("default_for") - List defaultFor; + List + defaultFor; /** * Map of extra parameters for custom features not available in this client library. The @@ -4451,7 +4488,8 @@ public static class MandateOptions { private MandateOptions( Object customMandateUrl, - List defaultFor, + List + defaultFor, Map extraParams, String intervalDescription, PaymentSchedule paymentSchedule, @@ -4471,7 +4509,9 @@ public static Builder builder() { public static class Builder { private Object customMandateUrl; - private List defaultFor; + private List< + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor> + defaultFor; private Map extraParams; @@ -4482,8 +4522,8 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions( this.customMandateUrl, this.defaultFor, this.extraParams, @@ -4520,7 +4560,9 @@ public Builder setCustomMandateUrl(EmptyParam customMandateUrl) { * SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addDefaultFor(DefaultFor element) { + public Builder addDefaultFor( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor + element) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4534,7 +4576,11 @@ public Builder addDefaultFor(DefaultFor element) { * SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addAllDefaultFor(List elements) { + public Builder addAllDefaultFor( + List< + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions + .DefaultFor> + elements) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4582,13 +4628,17 @@ public Builder setIntervalDescription(String intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions.PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions.TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -4710,8 +4760,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.code, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodOptions.Blik build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Blik( + this.code, this.extraParams); } /** @@ -4826,8 +4877,8 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public SetupIntentConfirmParams.PaymentMethodOptions.Card build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Card( this.extraParams, this.mandateOptions, this.moto, @@ -4864,7 +4915,8 @@ public Builder putAllExtraParam(Map map) { } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -4883,7 +4935,8 @@ public Builder setMoto(Boolean moto) { * Selected network to process this SetupIntent on. Depends on the available networks of the * card attached to the SetupIntent. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + SetupIntentConfirmParams.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -4899,7 +4952,9 @@ public Builder setNetwork(Network network) { * Secure for more information on how this configuration interacts with Radar and our * SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + SetupIntentConfirmParams.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -4980,7 +5035,8 @@ public static class MandateOptions { /** Specifies the type of mandates supported. Possible values are {@code india}. */ @SerializedName("supported_types") - List supportedTypes; + List + supportedTypes; private MandateOptions( Long amount, @@ -4993,7 +5049,8 @@ private MandateOptions( Long intervalCount, String reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.currency = currency; @@ -5032,11 +5089,13 @@ public static class Builder { private Long startDate; - private List supportedTypes; + private List< + SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.SupportedType> + supportedTypes; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions( this.amount, this.amountType, this.currency, @@ -5061,7 +5120,9 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.AmountType + amountType) { this.amountType = amountType; return this; } @@ -5129,7 +5190,8 @@ public Builder putAllExtraParam(Map map) { * Specifies payment frequency. One of {@code day}, {@code week}, {@code month}, {@code * year}, or {@code sporadic}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.Interval interval) { this.interval = interval; return this; } @@ -5167,7 +5229,9 @@ public Builder setStartDate(Long startDate) { * SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addSupportedType(SupportedType element) { + public Builder addSupportedType( + SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.SupportedType + element) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5182,7 +5246,9 @@ public Builder addSupportedType(SupportedType element) { * SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addAllSupportedType(List elements) { + public Builder addAllSupportedType( + List + elements) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5328,8 +5394,9 @@ public static class Builder { private String persistentToken; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams, this.persistentToken); + public SetupIntentConfirmParams.PaymentMethodOptions.Link build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Link( + this.extraParams, this.persistentToken); } /** @@ -5398,8 +5465,9 @@ public static class Builder { private MandateOptions mandateOptions; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.mandateOptions); + public SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit( + this.extraParams, this.mandateOptions); } /** @@ -5431,7 +5499,8 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5461,8 +5530,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit.MandateOptions build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit.MandateOptions( + this.extraParams); } /** @@ -5546,8 +5616,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.networks, this.verificationMethod); } @@ -5580,19 +5650,24 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Additional fields for network related functions. */ - public Builder setNetworks(Networks networks) { + public Builder setNetworks( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks networks) { this.networks = networks; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -5616,7 +5691,10 @@ public static class FinancialConnections { * {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; /** * For webview integrations only. Upon completing OAuth login in the native browser, the @@ -5626,7 +5704,12 @@ public static class FinancialConnections { String returnUrl; private FinancialConnections( - Map extraParams, List permissions, String returnUrl) { + Map extraParams, + List< + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions, + String returnUrl) { this.extraParams = extraParams; this.permissions = permissions; this.returnUrl = returnUrl; @@ -5639,13 +5722,18 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; private String returnUrl; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions, this.returnUrl); + public SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions, this.returnUrl); } /** @@ -5684,7 +5772,10 @@ public Builder putAllExtraParam(Map map) { * SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -5699,7 +5790,11 @@ public Builder addPermission(Permission element) { * SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -5753,9 +5848,13 @@ public static class Networks { /** Triggers validations to run across the selected networks. */ @SerializedName("requested") - List requested; + List + requested; - private Networks(Map extraParams, List requested) { + private Networks( + Map extraParams, + List + requested) { this.extraParams = extraParams; this.requested = requested; } @@ -5767,11 +5866,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List requested; + private List< + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks.Requested> + requested; /** Finalize and obtain parameter instance from this builder. */ - public Networks build() { - return new Networks(this.extraParams, this.requested); + public SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks( + this.extraParams, this.requested); } /** @@ -5810,7 +5912,9 @@ public Builder putAllExtraParam(Map map) { * SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addRequested(Requested element) { + public Builder addRequested( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks.Requested + element) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -5824,7 +5928,9 @@ public Builder addRequested(Requested element) { * SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addAllRequested(List elements) { + public Builder addAllRequested( + List + elements) { if (this.requested == null) { this.requested = new ArrayList<>(); } diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index c73a2bdeef8..a33e4cff27c 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -65,7 +65,7 @@ public class SetupIntentCreateParams extends ApiRequestParams { * send funds to. You can include both if you intend to use the payment method for both purposes. */ @SerializedName("flow_directions") - List flowDirections; + List flowDirections; /** * This hash contains details about the Mandate to create. This parameter can only be used with expand, Map extraParams, - List flowDirections, + List flowDirections, MandateData mandateData, Map metadata, String onBehalfOf, @@ -189,7 +189,7 @@ public static class Builder { private Map extraParams; - private List flowDirections; + private List flowDirections; private MandateData mandateData; @@ -332,7 +332,7 @@ public Builder putAllExtraParam(Map map) { * call, and subsequent calls adds additional elements to the original list. See {@link * SetupIntentCreateParams#flowDirections} for the field documentation. */ - public Builder addFlowDirection(FlowDirection element) { + public Builder addFlowDirection(SetupIntentCreateParams.FlowDirection element) { if (this.flowDirections == null) { this.flowDirections = new ArrayList<>(); } @@ -345,7 +345,7 @@ public Builder addFlowDirection(FlowDirection element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SetupIntentCreateParams#flowDirections} for the field documentation. */ - public Builder addAllFlowDirection(List elements) { + public Builder addAllFlowDirection(List elements) { if (this.flowDirections == null) { this.flowDirections = new ArrayList<>(); } @@ -358,7 +358,7 @@ public Builder addAllFlowDirection(List elements) { * {@code * confirm=true}. */ - public Builder setMandateData(MandateData mandateData) { + public Builder setMandateData(SetupIntentCreateParams.MandateData mandateData) { this.mandateData = mandateData; return this; } @@ -409,13 +409,15 @@ public Builder setPaymentMethod(String paymentMethod) { * href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method">{@code * payment_method} value in the SetupIntent. */ - public Builder setPaymentMethodData(PaymentMethodData paymentMethodData) { + public Builder setPaymentMethodData( + SetupIntentCreateParams.PaymentMethodData paymentMethodData) { this.paymentMethodData = paymentMethodData; return this; } /** Payment-method-specific configuration for this SetupIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + SetupIntentCreateParams.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -461,7 +463,7 @@ public Builder setReturnUrl(String returnUrl) { /** * If this hash is populated, this SetupIntent will generate a single_use Mandate on success. */ - public Builder setSingleUse(SingleUse singleUse) { + public Builder setSingleUse(SetupIntentCreateParams.SingleUse singleUse) { this.singleUse = singleUse; return this; } @@ -470,7 +472,7 @@ public Builder setSingleUse(SingleUse singleUse) { * Indicates how the payment method is intended to be used in the future. If not provided, this * value defaults to {@code off_session}. */ - public Builder setUsage(Usage usage) { + public Builder setUsage(SetupIntentCreateParams.Usage usage) { this.usage = usage; return this; } @@ -506,12 +508,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateData build() { - return new MandateData(this.customerAcceptance, this.extraParams); + public SetupIntentCreateParams.MandateData build() { + return new SetupIntentCreateParams.MandateData(this.customerAcceptance, this.extraParams); } /** This hash contains details about the customer acceptance of the Mandate. */ - public Builder setCustomerAcceptance(CustomerAcceptance customerAcceptance) { + public Builder setCustomerAcceptance( + SetupIntentCreateParams.MandateData.CustomerAcceptance customerAcceptance) { this.customerAcceptance = customerAcceptance; return this; } @@ -608,8 +611,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public CustomerAcceptance build() { - return new CustomerAcceptance( + public SetupIntentCreateParams.MandateData.CustomerAcceptance build() { + return new SetupIntentCreateParams.MandateData.CustomerAcceptance( this.acceptedAt, this.extraParams, this.offline, this.online, this.type); } @@ -651,7 +654,8 @@ public Builder putAllExtraParam(Map map) { * If this is a Mandate accepted offline, this hash contains details about the offline * acceptance. */ - public Builder setOffline(Offline offline) { + public Builder setOffline( + SetupIntentCreateParams.MandateData.CustomerAcceptance.Offline offline) { this.offline = offline; return this; } @@ -660,7 +664,8 @@ public Builder setOffline(Offline offline) { * If this is a Mandate accepted online, this hash contains details about the online * acceptance. */ - public Builder setOnline(Online online) { + public Builder setOnline( + SetupIntentCreateParams.MandateData.CustomerAcceptance.Online online) { this.online = online; return this; } @@ -669,7 +674,7 @@ public Builder setOnline(Online online) { * The type of customer acceptance information included with the Mandate. One of {@code * online} or {@code offline}. */ - public Builder setType(Type type) { + public Builder setType(SetupIntentCreateParams.MandateData.CustomerAcceptance.Type type) { this.type = type; return this; } @@ -699,8 +704,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Offline build() { - return new Offline(this.extraParams); + public SetupIntentCreateParams.MandateData.CustomerAcceptance.Offline build() { + return new SetupIntentCreateParams.MandateData.CustomerAcceptance.Offline( + this.extraParams); } /** @@ -773,8 +779,9 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public Online build() { - return new Online(this.extraParams, this.ipAddress, this.userAgent); + public SetupIntentCreateParams.MandateData.CustomerAcceptance.Online build() { + return new SetupIntentCreateParams.MandateData.CustomerAcceptance.Online( + this.extraParams, this.ipAddress, this.userAgent); } /** @@ -1217,8 +1224,8 @@ public static class Builder { private WechatPay wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodData build() { - return new PaymentMethodData( + public SetupIntentCreateParams.PaymentMethodData build() { + return new SetupIntentCreateParams.PaymentMethodData( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -1258,7 +1265,7 @@ public PaymentMethodData build() { * If this is an {@code acss_debit} PaymentMethod, this hash contains details about the ACSS * Debit payment method. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(SetupIntentCreateParams.PaymentMethodData.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -1267,7 +1274,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is an {@code affirm} PaymentMethod, this hash contains details about the Affirm * payment method. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(SetupIntentCreateParams.PaymentMethodData.Affirm affirm) { this.affirm = affirm; return this; } @@ -1276,7 +1283,8 @@ public Builder setAffirm(Affirm affirm) { * If this is an {@code AfterpayClearpay} PaymentMethod, this hash contains details about the * AfterpayClearpay payment method. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + SetupIntentCreateParams.PaymentMethodData.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -1285,7 +1293,7 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If this is an {@code Alipay} PaymentMethod, this hash contains details about the Alipay * payment method. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(SetupIntentCreateParams.PaymentMethodData.Alipay alipay) { this.alipay = alipay; return this; } @@ -1294,7 +1302,8 @@ public Builder setAlipay(Alipay alipay) { * If this is an {@code au_becs_debit} PaymentMethod, this hash contains details about the * bank account. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + SetupIntentCreateParams.PaymentMethodData.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -1303,7 +1312,7 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs * Direct Debit bank account. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(SetupIntentCreateParams.PaymentMethodData.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -1312,7 +1321,8 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this hash contains details about the * Bancontact payment method. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + SetupIntentCreateParams.PaymentMethodData.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -1321,7 +1331,8 @@ public Builder setBancontact(Bancontact bancontact) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails( + SetupIntentCreateParams.PaymentMethodData.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -1330,7 +1341,7 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentCreateParams.PaymentMethodData.Blik blik) { this.blik = blik; return this; } @@ -1339,7 +1350,7 @@ public Builder setBlik(Blik blik) { * If this is a {@code boleto} PaymentMethod, this hash contains details about the Boleto * payment method. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(SetupIntentCreateParams.PaymentMethodData.Boleto boleto) { this.boleto = boleto; return this; } @@ -1348,7 +1359,8 @@ public Builder setBoleto(Boleto boleto) { * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + SetupIntentCreateParams.PaymentMethodData.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -1357,7 +1369,7 @@ public Builder setCustomerBalance(CustomerBalance customerBalance) { * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment * method. */ - public Builder setEps(Eps eps) { + public Builder setEps(SetupIntentCreateParams.PaymentMethodData.Eps eps) { this.eps = eps; return this; } @@ -1393,7 +1405,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code fpx} PaymentMethod, this hash contains details about the FPX payment * method. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(SetupIntentCreateParams.PaymentMethodData.Fpx fpx) { this.fpx = fpx; return this; } @@ -1402,7 +1414,7 @@ public Builder setFpx(Fpx fpx) { * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(SetupIntentCreateParams.PaymentMethodData.Giropay giropay) { this.giropay = giropay; return this; } @@ -1411,7 +1423,7 @@ public Builder setGiropay(Giropay giropay) { * If this is a {@code grabpay} PaymentMethod, this hash contains details about the GrabPay * payment method. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(SetupIntentCreateParams.PaymentMethodData.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -1420,7 +1432,7 @@ public Builder setGrabpay(Grabpay grabpay) { * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL * payment method. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(SetupIntentCreateParams.PaymentMethodData.Ideal ideal) { this.ideal = ideal; return this; } @@ -1429,7 +1441,8 @@ public Builder setIdeal(Ideal ideal) { * If this is an {@code interac_present} PaymentMethod, this hash contains details about the * Interac Present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + SetupIntentCreateParams.PaymentMethodData.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -1438,7 +1451,7 @@ public Builder setInteracPresent(InteracPresent interacPresent) { * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna * payment method. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(SetupIntentCreateParams.PaymentMethodData.Klarna klarna) { this.klarna = klarna; return this; } @@ -1447,7 +1460,7 @@ public Builder setKlarna(Klarna klarna) { * If this is a {@code konbini} PaymentMethod, this hash contains details about the Konbini * payment method. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(SetupIntentCreateParams.PaymentMethodData.Konbini konbini) { this.konbini = konbini; return this; } @@ -1456,7 +1469,7 @@ public Builder setKonbini(Konbini konbini) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentCreateParams.PaymentMethodData.Link link) { this.link = link; return this; } @@ -1491,7 +1504,7 @@ public Builder putAllMetadata(Map map) { * If this is an {@code oxxo} PaymentMethod, this hash contains details about the OXXO payment * method. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(SetupIntentCreateParams.PaymentMethodData.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -1500,7 +1513,7 @@ public Builder setOxxo(Oxxo oxxo) { * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment * method. */ - public Builder setP24(P24 p24) { + public Builder setP24(SetupIntentCreateParams.PaymentMethodData.P24 p24) { this.p24 = p24; return this; } @@ -1509,7 +1522,7 @@ public Builder setP24(P24 p24) { * If this is a {@code paynow} PaymentMethod, this hash contains details about the PayNow * payment method. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(SetupIntentCreateParams.PaymentMethodData.Paynow paynow) { this.paynow = paynow; return this; } @@ -1518,7 +1531,7 @@ public Builder setPaynow(Paynow paynow) { * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. */ - public Builder setPix(Pix pix) { + public Builder setPix(SetupIntentCreateParams.PaymentMethodData.Pix pix) { this.pix = pix; return this; } @@ -1527,7 +1540,7 @@ public Builder setPix(Pix pix) { * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay(SetupIntentCreateParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1536,7 +1549,8 @@ public Builder setPromptpay(Promptpay promptpay) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions( + SetupIntentCreateParams.PaymentMethodData.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -1545,7 +1559,7 @@ public Builder setRadarOptions(RadarOptions radarOptions) { * If this is a {@code sepa_debit} PaymentMethod, this hash contains details about the SEPA * debit bank account. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(SetupIntentCreateParams.PaymentMethodData.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -1554,7 +1568,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code sofort} PaymentMethod, this hash contains details about the SOFORT * payment method. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(SetupIntentCreateParams.PaymentMethodData.Sofort sofort) { this.sofort = sofort; return this; } @@ -1564,7 +1578,7 @@ public Builder setSofort(Sofort sofort) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(SetupIntentCreateParams.PaymentMethodData.Type type) { this.type = type; return this; } @@ -1573,7 +1587,8 @@ public Builder setType(Type type) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentCreateParams.PaymentMethodData.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -1582,7 +1597,7 @@ public Builder setUsBankAccount(UsBankAccount usBankAccount) { * If this is an {@code wechat_pay} PaymentMethod, this hash contains details about the * wechat_pay payment method. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay(SetupIntentCreateParams.PaymentMethodData.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -1636,8 +1651,8 @@ public static class Builder { private String transitNumber; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentCreateParams.PaymentMethodData.AcssDebit build() { + return new SetupIntentCreateParams.PaymentMethodData.AcssDebit( this.accountNumber, this.extraParams, this.institutionNumber, this.transitNumber); } @@ -1712,8 +1727,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Affirm build() { + return new SetupIntentCreateParams.PaymentMethodData.Affirm(this.extraParams); } /** @@ -1769,8 +1784,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.AfterpayClearpay build() { + return new SetupIntentCreateParams.PaymentMethodData.AfterpayClearpay(this.extraParams); } /** @@ -1826,8 +1841,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Alipay build() { + return new SetupIntentCreateParams.PaymentMethodData.Alipay(this.extraParams); } /** @@ -1897,8 +1912,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.accountNumber, this.bsbNumber, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.AuBecsDebit build() { + return new SetupIntentCreateParams.PaymentMethodData.AuBecsDebit( + this.accountNumber, this.bsbNumber, this.extraParams); } /** The account number for the bank account. */ @@ -1980,8 +1996,9 @@ public static class Builder { private String sortCode; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.accountNumber, this.extraParams, this.sortCode); + public SetupIntentCreateParams.PaymentMethodData.BacsDebit build() { + return new SetupIntentCreateParams.PaymentMethodData.BacsDebit( + this.accountNumber, this.extraParams, this.sortCode); } /** Account number of the bank account that the funds will be debited from. */ @@ -2049,8 +2066,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Bancontact build() { + return new SetupIntentCreateParams.PaymentMethodData.Bancontact(this.extraParams); } /** @@ -2139,13 +2156,14 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public SetupIntentCreateParams.PaymentMethodData.BillingDetails build() { + return new SetupIntentCreateParams.PaymentMethodData.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress( + SetupIntentCreateParams.PaymentMethodData.BillingDetails.Address address) { this.address = address; return this; } @@ -2285,8 +2303,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public SetupIntentCreateParams.PaymentMethodData.BillingDetails.Address build() { + return new SetupIntentCreateParams.PaymentMethodData.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -2391,8 +2409,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Blik build() { + return new SetupIntentCreateParams.PaymentMethodData.Blik(this.extraParams); } /** @@ -2457,8 +2475,8 @@ public static class Builder { private String taxId; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.extraParams, this.taxId); + public SetupIntentCreateParams.PaymentMethodData.Boleto build() { + return new SetupIntentCreateParams.PaymentMethodData.Boleto(this.extraParams, this.taxId); } /** @@ -2523,8 +2541,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.CustomerBalance build() { + return new SetupIntentCreateParams.PaymentMethodData.CustomerBalance(this.extraParams); } /** @@ -2587,12 +2605,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.bank, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Eps build() { + return new SetupIntentCreateParams.PaymentMethodData.Eps(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentCreateParams.PaymentMethodData.Eps.Bank bank) { this.bank = bank; return this; } @@ -2757,18 +2775,20 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.accountHolderType, this.bank, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Fpx build() { + return new SetupIntentCreateParams.PaymentMethodData.Fpx( + this.accountHolderType, this.bank, this.extraParams); } /** Account holder type for FPX transaction. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentCreateParams.PaymentMethodData.Fpx.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentCreateParams.PaymentMethodData.Fpx.Bank bank) { this.bank = bank; return this; } @@ -2913,8 +2933,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Giropay build() { + return new SetupIntentCreateParams.PaymentMethodData.Giropay(this.extraParams); } /** @@ -2970,8 +2990,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Grabpay build() { + return new SetupIntentCreateParams.PaymentMethodData.Grabpay(this.extraParams); } /** @@ -3034,12 +3054,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.bank, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Ideal build() { + return new SetupIntentCreateParams.PaymentMethodData.Ideal(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentCreateParams.PaymentMethodData.Ideal.Bank bank) { this.bank = bank; return this; } @@ -3145,8 +3165,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.InteracPresent build() { + return new SetupIntentCreateParams.PaymentMethodData.InteracPresent(this.extraParams); } /** @@ -3209,12 +3229,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.dob, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Klarna build() { + return new SetupIntentCreateParams.PaymentMethodData.Klarna(this.dob, this.extraParams); } /** Customer's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(SetupIntentCreateParams.PaymentMethodData.Klarna.Dob dob) { this.dob = dob; return this; } @@ -3293,8 +3313,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public SetupIntentCreateParams.PaymentMethodData.Klarna.Dob build() { + return new SetupIntentCreateParams.PaymentMethodData.Klarna.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -3369,8 +3390,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Konbini build() { + return new SetupIntentCreateParams.PaymentMethodData.Konbini(this.extraParams); } /** @@ -3426,8 +3447,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Link build() { + return new SetupIntentCreateParams.PaymentMethodData.Link(this.extraParams); } /** @@ -3483,8 +3504,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Oxxo build() { + return new SetupIntentCreateParams.PaymentMethodData.Oxxo(this.extraParams); } /** @@ -3547,12 +3568,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.bank, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.P24 build() { + return new SetupIntentCreateParams.PaymentMethodData.P24(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentCreateParams.PaymentMethodData.P24.Bank bank) { this.bank = bank; return this; } @@ -3694,8 +3715,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Paynow build() { + return new SetupIntentCreateParams.PaymentMethodData.Paynow(this.extraParams); } /** @@ -3751,8 +3772,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pix build() { - return new Pix(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Pix build() { + return new SetupIntentCreateParams.PaymentMethodData.Pix(this.extraParams); } /** @@ -3808,8 +3829,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Promptpay build() { + return new SetupIntentCreateParams.PaymentMethodData.Promptpay(this.extraParams); } /** @@ -3876,8 +3897,9 @@ public static class Builder { private String session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public SetupIntentCreateParams.PaymentMethodData.RadarOptions build() { + return new SetupIntentCreateParams.PaymentMethodData.RadarOptions( + this.extraParams, this.session); } /** @@ -3950,8 +3972,9 @@ public static class Builder { private String iban; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.iban); + public SetupIntentCreateParams.PaymentMethodData.SepaDebit build() { + return new SetupIntentCreateParams.PaymentMethodData.SepaDebit( + this.extraParams, this.iban); } /** @@ -4020,12 +4043,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.country, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Sofort build() { + return new SetupIntentCreateParams.PaymentMethodData.Sofort( + this.country, this.extraParams); } /** Two-letter ISO code representing the country the bank account is located in. */ - public Builder setCountry(Country country) { + public Builder setCountry( + SetupIntentCreateParams.PaymentMethodData.Sofort.Country country) { this.country = country; return this; } @@ -4151,8 +4176,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentCreateParams.PaymentMethodData.UsBankAccount build() { + return new SetupIntentCreateParams.PaymentMethodData.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -4162,7 +4187,9 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentCreateParams.PaymentMethodData.UsBankAccount.AccountHolderType + accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -4174,7 +4201,8 @@ public Builder setAccountNumber(String accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + SetupIntentCreateParams.PaymentMethodData.UsBankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -4274,8 +4302,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.WechatPay build() { + return new SetupIntentCreateParams.PaymentMethodData.WechatPay(this.extraParams); } /** @@ -4486,8 +4514,8 @@ public static class Builder { private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public SetupIntentCreateParams.PaymentMethodOptions build() { + return new SetupIntentCreateParams.PaymentMethodOptions( this.acssDebit, this.blik, this.card, @@ -4501,7 +4529,8 @@ public PaymentMethodOptions build() { * If this is a {@code acss_debit} SetupIntent, this sub-hash contains details about the ACSS * Debit payment method options. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -4510,13 +4539,13 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentCreateParams.PaymentMethodOptions.Blik blik) { this.blik = blik; return this; } /** Configuration for any card setup attempted on this SetupIntent. */ - public Builder setCard(Card card) { + public Builder setCard(SetupIntentCreateParams.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -4552,7 +4581,7 @@ public Builder putAllExtraParam(Map map) { * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentCreateParams.PaymentMethodOptions.Link link) { this.link = link; return this; } @@ -4561,7 +4590,8 @@ public Builder setLink(Link link) { * If this is a {@code sepa_debit} SetupIntent, this sub-hash contains details about the SEPA * Debit payment method options. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + SetupIntentCreateParams.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -4570,7 +4600,8 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the * US bank account payment method options. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -4628,8 +4659,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentCreateParams.PaymentMethodOptions.AcssDebit build() { + return new SetupIntentCreateParams.PaymentMethodOptions.AcssDebit( this.currency, this.extraParams, this.mandateOptions, this.verificationMethod); } @@ -4638,7 +4669,8 @@ public AcssDebit build() { * code, in lowercase. Must be a supported * currency. */ - public Builder setCurrency(Currency currency) { + public Builder setCurrency( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.Currency currency) { this.currency = currency; return this; } @@ -4672,13 +4704,16 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -4697,7 +4732,8 @@ public static class MandateOptions { /** List of Stripe products where this mandate can be selected automatically. */ @SerializedName("default_for") - List defaultFor; + List + defaultFor; /** * Map of extra parameters for custom features not available in this client library. The @@ -4726,7 +4762,8 @@ public static class MandateOptions { private MandateOptions( Object customMandateUrl, - List defaultFor, + List + defaultFor, Map extraParams, String intervalDescription, PaymentSchedule paymentSchedule, @@ -4746,7 +4783,9 @@ public static Builder builder() { public static class Builder { private Object customMandateUrl; - private List defaultFor; + private List< + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor> + defaultFor; private Map extraParams; @@ -4757,8 +4796,8 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions build() { + return new SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions( this.customMandateUrl, this.defaultFor, this.extraParams, @@ -4795,7 +4834,9 @@ public Builder setCustomMandateUrl(EmptyParam customMandateUrl) { * SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addDefaultFor(DefaultFor element) { + public Builder addDefaultFor( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor + element) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4809,7 +4850,9 @@ public Builder addDefaultFor(DefaultFor element) { * SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addAllDefaultFor(List elements) { + public Builder addAllDefaultFor( + List + elements) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4857,13 +4900,17 @@ public Builder setIntervalDescription(String intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions.PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions.TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -4985,8 +5032,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.code, this.extraParams); + public SetupIntentCreateParams.PaymentMethodOptions.Blik build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Blik(this.code, this.extraParams); } /** @@ -5101,8 +5148,8 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public SetupIntentCreateParams.PaymentMethodOptions.Card build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Card( this.extraParams, this.mandateOptions, this.moto, @@ -5139,7 +5186,8 @@ public Builder putAllExtraParam(Map map) { } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5158,7 +5206,8 @@ public Builder setMoto(Boolean moto) { * Selected network to process this SetupIntent on. Depends on the available networks of the * card attached to the SetupIntent. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + SetupIntentCreateParams.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -5174,7 +5223,9 @@ public Builder setNetwork(Network network) { * Secure for more information on how this configuration interacts with Radar and our * SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + SetupIntentCreateParams.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -5255,7 +5306,8 @@ public static class MandateOptions { /** Specifies the type of mandates supported. Possible values are {@code india}. */ @SerializedName("supported_types") - List supportedTypes; + List + supportedTypes; private MandateOptions( Long amount, @@ -5268,7 +5320,8 @@ private MandateOptions( Long intervalCount, String reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.currency = currency; @@ -5307,11 +5360,13 @@ public static class Builder { private Long startDate; - private List supportedTypes; + private List< + SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType> + supportedTypes; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions( this.amount, this.amountType, this.currency, @@ -5336,7 +5391,9 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.AmountType + amountType) { this.amountType = amountType; return this; } @@ -5404,7 +5461,8 @@ public Builder putAllExtraParam(Map map) { * Specifies payment frequency. One of {@code day}, {@code week}, {@code month}, {@code * year}, or {@code sporadic}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.Interval interval) { this.interval = interval; return this; } @@ -5442,7 +5500,9 @@ public Builder setStartDate(Long startDate) { * SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addSupportedType(SupportedType element) { + public Builder addSupportedType( + SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType + element) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5457,7 +5517,9 @@ public Builder addSupportedType(SupportedType element) { * SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addAllSupportedType(List elements) { + public Builder addAllSupportedType( + List + elements) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5603,8 +5665,9 @@ public static class Builder { private String persistentToken; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams, this.persistentToken); + public SetupIntentCreateParams.PaymentMethodOptions.Link build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Link( + this.extraParams, this.persistentToken); } /** @@ -5673,8 +5736,9 @@ public static class Builder { private MandateOptions mandateOptions; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.mandateOptions); + public SetupIntentCreateParams.PaymentMethodOptions.SepaDebit build() { + return new SetupIntentCreateParams.PaymentMethodOptions.SepaDebit( + this.extraParams, this.mandateOptions); } /** @@ -5706,7 +5770,8 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5736,8 +5801,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams); + public SetupIntentCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions build() { + return new SetupIntentCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions( + this.extraParams); } /** @@ -5821,8 +5887,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount build() { + return new SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.networks, this.verificationMethod); } @@ -5855,19 +5921,24 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Additional fields for network related functions. */ - public Builder setNetworks(Networks networks) { + public Builder setNetworks( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks networks) { this.networks = networks; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -5891,7 +5962,10 @@ public static class FinancialConnections { * {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; /** * For webview integrations only. Upon completing OAuth login in the native browser, the @@ -5901,7 +5975,12 @@ public static class FinancialConnections { String returnUrl; private FinancialConnections( - Map extraParams, List permissions, String returnUrl) { + Map extraParams, + List< + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions, + String returnUrl) { this.extraParams = extraParams; this.permissions = permissions; this.returnUrl = returnUrl; @@ -5914,13 +5993,18 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; private String returnUrl; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions, this.returnUrl); + public SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + build() { + return new SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions, this.returnUrl); } /** @@ -5959,7 +6043,10 @@ public Builder putAllExtraParam(Map map) { * SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -5974,7 +6061,11 @@ public Builder addPermission(Permission element) { * SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -6028,9 +6119,13 @@ public static class Networks { /** Triggers validations to run across the selected networks. */ @SerializedName("requested") - List requested; + List + requested; - private Networks(Map extraParams, List requested) { + private Networks( + Map extraParams, + List + requested) { this.extraParams = extraParams; this.requested = requested; } @@ -6042,11 +6137,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List requested; + private List< + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested> + requested; /** Finalize and obtain parameter instance from this builder. */ - public Networks build() { - return new Networks(this.extraParams, this.requested); + public SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks build() { + return new SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks( + this.extraParams, this.requested); } /** @@ -6085,7 +6183,9 @@ public Builder putAllExtraParam(Map map) { * SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addRequested(Requested element) { + public Builder addRequested( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested + element) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -6099,7 +6199,9 @@ public Builder addRequested(Requested element) { * SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addAllRequested(List elements) { + public Builder addAllRequested( + List + elements) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -6193,8 +6295,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public SingleUse build() { - return new SingleUse(this.amount, this.currency, this.extraParams); + public SetupIntentCreateParams.SingleUse build() { + return new SetupIntentCreateParams.SingleUse(this.amount, this.currency, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/SetupIntentListParams.java b/src/main/java/com/stripe/param/SetupIntentListParams.java index b36b54c99ae..949ba07960b 100644 --- a/src/main/java/com/stripe/param/SetupIntentListParams.java +++ b/src/main/java/com/stripe/param/SetupIntentListParams.java @@ -151,7 +151,7 @@ public Builder setAttachToSelf(Boolean attachToSelf) { * with an integer Unix timestamp, or it can be a dictionary with a number of different query * options. */ - public Builder setCreated(Created created) { + public Builder setCreated(SetupIntentListParams.Created created) { this.created = created; return this; } @@ -313,8 +313,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public SetupIntentListParams.Created build() { + return new SetupIntentListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index 6e5e0fe4d5f..8b9913ebb26 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -57,7 +57,7 @@ public class SetupIntentUpdateParams extends ApiRequestParams { * send funds to. You can include both if you intend to use the payment method for both purposes. */ @SerializedName("flow_directions") - List flowDirections; + List flowDirections; /** * Set of key-value pairs that you can attach @@ -100,7 +100,7 @@ private SetupIntentUpdateParams( Object description, List expand, Map extraParams, - List flowDirections, + List flowDirections, Object metadata, Object paymentMethod, PaymentMethodData paymentMethodData, @@ -134,7 +134,7 @@ public static class Builder { private Map extraParams; - private List flowDirections; + private List flowDirections; private Object metadata; @@ -269,7 +269,7 @@ public Builder putAllExtraParam(Map map) { * call, and subsequent calls adds additional elements to the original list. See {@link * SetupIntentUpdateParams#flowDirections} for the field documentation. */ - public Builder addFlowDirection(FlowDirection element) { + public Builder addFlowDirection(SetupIntentUpdateParams.FlowDirection element) { if (this.flowDirections == null) { this.flowDirections = new ArrayList<>(); } @@ -282,7 +282,7 @@ public Builder addFlowDirection(FlowDirection element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SetupIntentUpdateParams#flowDirections} for the field documentation. */ - public Builder addAllFlowDirection(List elements) { + public Builder addAllFlowDirection(List elements) { if (this.flowDirections == null) { this.flowDirections = new ArrayList<>(); } @@ -363,13 +363,15 @@ public Builder setPaymentMethod(EmptyParam paymentMethod) { * href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method">{@code * payment_method} value in the SetupIntent. */ - public Builder setPaymentMethodData(PaymentMethodData paymentMethodData) { + public Builder setPaymentMethodData( + SetupIntentUpdateParams.PaymentMethodData paymentMethodData) { this.paymentMethodData = paymentMethodData; return this; } /** Payment-method-specific configuration for this SetupIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + SetupIntentUpdateParams.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -780,8 +782,8 @@ public static class Builder { private WechatPay wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodData build() { - return new PaymentMethodData( + public SetupIntentUpdateParams.PaymentMethodData build() { + return new SetupIntentUpdateParams.PaymentMethodData( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -821,7 +823,7 @@ public PaymentMethodData build() { * If this is an {@code acss_debit} PaymentMethod, this hash contains details about the ACSS * Debit payment method. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(SetupIntentUpdateParams.PaymentMethodData.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -830,7 +832,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is an {@code affirm} PaymentMethod, this hash contains details about the Affirm * payment method. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(SetupIntentUpdateParams.PaymentMethodData.Affirm affirm) { this.affirm = affirm; return this; } @@ -839,7 +841,8 @@ public Builder setAffirm(Affirm affirm) { * If this is an {@code AfterpayClearpay} PaymentMethod, this hash contains details about the * AfterpayClearpay payment method. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + SetupIntentUpdateParams.PaymentMethodData.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -848,7 +851,7 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If this is an {@code Alipay} PaymentMethod, this hash contains details about the Alipay * payment method. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(SetupIntentUpdateParams.PaymentMethodData.Alipay alipay) { this.alipay = alipay; return this; } @@ -857,7 +860,8 @@ public Builder setAlipay(Alipay alipay) { * If this is an {@code au_becs_debit} PaymentMethod, this hash contains details about the * bank account. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + SetupIntentUpdateParams.PaymentMethodData.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -866,7 +870,7 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs * Direct Debit bank account. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(SetupIntentUpdateParams.PaymentMethodData.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -875,7 +879,8 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this hash contains details about the * Bancontact payment method. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + SetupIntentUpdateParams.PaymentMethodData.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -884,7 +889,8 @@ public Builder setBancontact(Bancontact bancontact) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails( + SetupIntentUpdateParams.PaymentMethodData.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -893,7 +899,7 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentUpdateParams.PaymentMethodData.Blik blik) { this.blik = blik; return this; } @@ -902,7 +908,7 @@ public Builder setBlik(Blik blik) { * If this is a {@code boleto} PaymentMethod, this hash contains details about the Boleto * payment method. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(SetupIntentUpdateParams.PaymentMethodData.Boleto boleto) { this.boleto = boleto; return this; } @@ -911,7 +917,8 @@ public Builder setBoleto(Boleto boleto) { * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + SetupIntentUpdateParams.PaymentMethodData.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -920,7 +927,7 @@ public Builder setCustomerBalance(CustomerBalance customerBalance) { * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment * method. */ - public Builder setEps(Eps eps) { + public Builder setEps(SetupIntentUpdateParams.PaymentMethodData.Eps eps) { this.eps = eps; return this; } @@ -956,7 +963,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code fpx} PaymentMethod, this hash contains details about the FPX payment * method. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(SetupIntentUpdateParams.PaymentMethodData.Fpx fpx) { this.fpx = fpx; return this; } @@ -965,7 +972,7 @@ public Builder setFpx(Fpx fpx) { * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(SetupIntentUpdateParams.PaymentMethodData.Giropay giropay) { this.giropay = giropay; return this; } @@ -974,7 +981,7 @@ public Builder setGiropay(Giropay giropay) { * If this is a {@code grabpay} PaymentMethod, this hash contains details about the GrabPay * payment method. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(SetupIntentUpdateParams.PaymentMethodData.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -983,7 +990,7 @@ public Builder setGrabpay(Grabpay grabpay) { * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL * payment method. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(SetupIntentUpdateParams.PaymentMethodData.Ideal ideal) { this.ideal = ideal; return this; } @@ -992,7 +999,8 @@ public Builder setIdeal(Ideal ideal) { * If this is an {@code interac_present} PaymentMethod, this hash contains details about the * Interac Present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + SetupIntentUpdateParams.PaymentMethodData.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -1001,7 +1009,7 @@ public Builder setInteracPresent(InteracPresent interacPresent) { * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna * payment method. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(SetupIntentUpdateParams.PaymentMethodData.Klarna klarna) { this.klarna = klarna; return this; } @@ -1010,7 +1018,7 @@ public Builder setKlarna(Klarna klarna) { * If this is a {@code konbini} PaymentMethod, this hash contains details about the Konbini * payment method. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(SetupIntentUpdateParams.PaymentMethodData.Konbini konbini) { this.konbini = konbini; return this; } @@ -1019,7 +1027,7 @@ public Builder setKonbini(Konbini konbini) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentUpdateParams.PaymentMethodData.Link link) { this.link = link; return this; } @@ -1054,7 +1062,7 @@ public Builder putAllMetadata(Map map) { * If this is an {@code oxxo} PaymentMethod, this hash contains details about the OXXO payment * method. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(SetupIntentUpdateParams.PaymentMethodData.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -1063,7 +1071,7 @@ public Builder setOxxo(Oxxo oxxo) { * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment * method. */ - public Builder setP24(P24 p24) { + public Builder setP24(SetupIntentUpdateParams.PaymentMethodData.P24 p24) { this.p24 = p24; return this; } @@ -1072,7 +1080,7 @@ public Builder setP24(P24 p24) { * If this is a {@code paynow} PaymentMethod, this hash contains details about the PayNow * payment method. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(SetupIntentUpdateParams.PaymentMethodData.Paynow paynow) { this.paynow = paynow; return this; } @@ -1081,7 +1089,7 @@ public Builder setPaynow(Paynow paynow) { * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. */ - public Builder setPix(Pix pix) { + public Builder setPix(SetupIntentUpdateParams.PaymentMethodData.Pix pix) { this.pix = pix; return this; } @@ -1090,7 +1098,7 @@ public Builder setPix(Pix pix) { * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay(SetupIntentUpdateParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1099,7 +1107,8 @@ public Builder setPromptpay(Promptpay promptpay) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions( + SetupIntentUpdateParams.PaymentMethodData.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -1108,7 +1117,7 @@ public Builder setRadarOptions(RadarOptions radarOptions) { * If this is a {@code sepa_debit} PaymentMethod, this hash contains details about the SEPA * debit bank account. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(SetupIntentUpdateParams.PaymentMethodData.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -1117,7 +1126,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code sofort} PaymentMethod, this hash contains details about the SOFORT * payment method. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(SetupIntentUpdateParams.PaymentMethodData.Sofort sofort) { this.sofort = sofort; return this; } @@ -1127,7 +1136,7 @@ public Builder setSofort(Sofort sofort) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(SetupIntentUpdateParams.PaymentMethodData.Type type) { this.type = type; return this; } @@ -1136,7 +1145,8 @@ public Builder setType(Type type) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentUpdateParams.PaymentMethodData.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -1145,7 +1155,7 @@ public Builder setUsBankAccount(UsBankAccount usBankAccount) { * If this is an {@code wechat_pay} PaymentMethod, this hash contains details about the * wechat_pay payment method. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay(SetupIntentUpdateParams.PaymentMethodData.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -1199,8 +1209,8 @@ public static class Builder { private Object transitNumber; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentUpdateParams.PaymentMethodData.AcssDebit build() { + return new SetupIntentUpdateParams.PaymentMethodData.AcssDebit( this.accountNumber, this.extraParams, this.institutionNumber, this.transitNumber); } @@ -1293,8 +1303,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Affirm build() { + return new SetupIntentUpdateParams.PaymentMethodData.Affirm(this.extraParams); } /** @@ -1350,8 +1360,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.AfterpayClearpay build() { + return new SetupIntentUpdateParams.PaymentMethodData.AfterpayClearpay(this.extraParams); } /** @@ -1407,8 +1417,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Alipay build() { + return new SetupIntentUpdateParams.PaymentMethodData.Alipay(this.extraParams); } /** @@ -1478,8 +1488,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.accountNumber, this.bsbNumber, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.AuBecsDebit build() { + return new SetupIntentUpdateParams.PaymentMethodData.AuBecsDebit( + this.accountNumber, this.bsbNumber, this.extraParams); } /** The account number for the bank account. */ @@ -1573,8 +1584,9 @@ public static class Builder { private Object sortCode; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.accountNumber, this.extraParams, this.sortCode); + public SetupIntentUpdateParams.PaymentMethodData.BacsDebit build() { + return new SetupIntentUpdateParams.PaymentMethodData.BacsDebit( + this.accountNumber, this.extraParams, this.sortCode); } /** Account number of the bank account that the funds will be debited from. */ @@ -1654,8 +1666,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Bancontact build() { + return new SetupIntentUpdateParams.PaymentMethodData.Bancontact(this.extraParams); } /** @@ -1744,13 +1756,14 @@ public static class Builder { private Object phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public SetupIntentUpdateParams.PaymentMethodData.BillingDetails build() { + return new SetupIntentUpdateParams.PaymentMethodData.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress( + SetupIntentUpdateParams.PaymentMethodData.BillingDetails.Address address) { this.address = address; return this; } @@ -1902,8 +1915,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public SetupIntentUpdateParams.PaymentMethodData.BillingDetails.Address build() { + return new SetupIntentUpdateParams.PaymentMethodData.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -2047,8 +2060,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Blik build() { + return new SetupIntentUpdateParams.PaymentMethodData.Blik(this.extraParams); } /** @@ -2113,8 +2126,8 @@ public static class Builder { private Object taxId; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.extraParams, this.taxId); + public SetupIntentUpdateParams.PaymentMethodData.Boleto build() { + return new SetupIntentUpdateParams.PaymentMethodData.Boleto(this.extraParams, this.taxId); } /** @@ -2188,8 +2201,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.CustomerBalance build() { + return new SetupIntentUpdateParams.PaymentMethodData.CustomerBalance(this.extraParams); } /** @@ -2252,12 +2265,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.bank, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Eps build() { + return new SetupIntentUpdateParams.PaymentMethodData.Eps(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentUpdateParams.PaymentMethodData.Eps.Bank bank) { this.bank = bank; return this; } @@ -2422,18 +2435,20 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.accountHolderType, this.bank, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Fpx build() { + return new SetupIntentUpdateParams.PaymentMethodData.Fpx( + this.accountHolderType, this.bank, this.extraParams); } /** Account holder type for FPX transaction. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentUpdateParams.PaymentMethodData.Fpx.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentUpdateParams.PaymentMethodData.Fpx.Bank bank) { this.bank = bank; return this; } @@ -2578,8 +2593,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Giropay build() { + return new SetupIntentUpdateParams.PaymentMethodData.Giropay(this.extraParams); } /** @@ -2635,8 +2650,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Grabpay build() { + return new SetupIntentUpdateParams.PaymentMethodData.Grabpay(this.extraParams); } /** @@ -2699,12 +2714,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.bank, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Ideal build() { + return new SetupIntentUpdateParams.PaymentMethodData.Ideal(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentUpdateParams.PaymentMethodData.Ideal.Bank bank) { this.bank = bank; return this; } @@ -2810,8 +2825,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.InteracPresent build() { + return new SetupIntentUpdateParams.PaymentMethodData.InteracPresent(this.extraParams); } /** @@ -2874,12 +2889,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.dob, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Klarna build() { + return new SetupIntentUpdateParams.PaymentMethodData.Klarna(this.dob, this.extraParams); } /** Customer's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(SetupIntentUpdateParams.PaymentMethodData.Klarna.Dob dob) { this.dob = dob; return this; } @@ -2958,8 +2973,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public SetupIntentUpdateParams.PaymentMethodData.Klarna.Dob build() { + return new SetupIntentUpdateParams.PaymentMethodData.Klarna.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -3034,8 +3050,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Konbini build() { + return new SetupIntentUpdateParams.PaymentMethodData.Konbini(this.extraParams); } /** @@ -3091,8 +3107,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Link build() { + return new SetupIntentUpdateParams.PaymentMethodData.Link(this.extraParams); } /** @@ -3148,8 +3164,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Oxxo build() { + return new SetupIntentUpdateParams.PaymentMethodData.Oxxo(this.extraParams); } /** @@ -3212,12 +3228,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.bank, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.P24 build() { + return new SetupIntentUpdateParams.PaymentMethodData.P24(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentUpdateParams.PaymentMethodData.P24.Bank bank) { this.bank = bank; return this; } @@ -3359,8 +3375,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Paynow build() { + return new SetupIntentUpdateParams.PaymentMethodData.Paynow(this.extraParams); } /** @@ -3416,8 +3432,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pix build() { - return new Pix(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Pix build() { + return new SetupIntentUpdateParams.PaymentMethodData.Pix(this.extraParams); } /** @@ -3473,8 +3489,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Promptpay build() { + return new SetupIntentUpdateParams.PaymentMethodData.Promptpay(this.extraParams); } /** @@ -3541,8 +3557,9 @@ public static class Builder { private Object session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public SetupIntentUpdateParams.PaymentMethodData.RadarOptions build() { + return new SetupIntentUpdateParams.PaymentMethodData.RadarOptions( + this.extraParams, this.session); } /** @@ -3625,8 +3642,9 @@ public static class Builder { private Object iban; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.iban); + public SetupIntentUpdateParams.PaymentMethodData.SepaDebit build() { + return new SetupIntentUpdateParams.PaymentMethodData.SepaDebit( + this.extraParams, this.iban); } /** @@ -3701,12 +3719,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.country, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Sofort build() { + return new SetupIntentUpdateParams.PaymentMethodData.Sofort( + this.country, this.extraParams); } /** Two-letter ISO code representing the country the bank account is located in. */ - public Builder setCountry(Country country) { + public Builder setCountry( + SetupIntentUpdateParams.PaymentMethodData.Sofort.Country country) { this.country = country; return this; } @@ -3832,8 +3852,8 @@ public static class Builder { private Object routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentUpdateParams.PaymentMethodData.UsBankAccount build() { + return new SetupIntentUpdateParams.PaymentMethodData.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -3843,7 +3863,9 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentUpdateParams.PaymentMethodData.UsBankAccount.AccountHolderType + accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -3861,7 +3883,8 @@ public Builder setAccountNumber(EmptyParam accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + SetupIntentUpdateParams.PaymentMethodData.UsBankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -3973,8 +3996,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.WechatPay build() { + return new SetupIntentUpdateParams.PaymentMethodData.WechatPay(this.extraParams); } /** @@ -4185,8 +4208,8 @@ public static class Builder { private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public SetupIntentUpdateParams.PaymentMethodOptions build() { + return new SetupIntentUpdateParams.PaymentMethodOptions( this.acssDebit, this.blik, this.card, @@ -4200,7 +4223,8 @@ public PaymentMethodOptions build() { * If this is a {@code acss_debit} SetupIntent, this sub-hash contains details about the ACSS * Debit payment method options. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -4209,13 +4233,13 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentUpdateParams.PaymentMethodOptions.Blik blik) { this.blik = blik; return this; } /** Configuration for any card setup attempted on this SetupIntent. */ - public Builder setCard(Card card) { + public Builder setCard(SetupIntentUpdateParams.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -4251,7 +4275,7 @@ public Builder putAllExtraParam(Map map) { * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentUpdateParams.PaymentMethodOptions.Link link) { this.link = link; return this; } @@ -4260,7 +4284,8 @@ public Builder setLink(Link link) { * If this is a {@code sepa_debit} SetupIntent, this sub-hash contains details about the SEPA * Debit payment method options. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -4269,7 +4294,8 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the * US bank account payment method options. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -4327,8 +4353,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit( this.currency, this.extraParams, this.mandateOptions, this.verificationMethod); } @@ -4337,7 +4363,8 @@ public AcssDebit build() { * code, in lowercase. Must be a supported * currency. */ - public Builder setCurrency(Currency currency) { + public Builder setCurrency( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.Currency currency) { this.currency = currency; return this; } @@ -4371,13 +4398,16 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -4396,7 +4426,8 @@ public static class MandateOptions { /** List of Stripe products where this mandate can be selected automatically. */ @SerializedName("default_for") - List defaultFor; + List + defaultFor; /** * Map of extra parameters for custom features not available in this client library. The @@ -4425,7 +4456,8 @@ public static class MandateOptions { private MandateOptions( Object customMandateUrl, - List defaultFor, + List + defaultFor, Map extraParams, Object intervalDescription, PaymentSchedule paymentSchedule, @@ -4445,7 +4477,9 @@ public static Builder builder() { public static class Builder { private Object customMandateUrl; - private List defaultFor; + private List< + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor> + defaultFor; private Map extraParams; @@ -4456,8 +4490,8 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions( this.customMandateUrl, this.defaultFor, this.extraParams, @@ -4494,7 +4528,9 @@ public Builder setCustomMandateUrl(EmptyParam customMandateUrl) { * SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addDefaultFor(DefaultFor element) { + public Builder addDefaultFor( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor + element) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4508,7 +4544,9 @@ public Builder addDefaultFor(DefaultFor element) { * SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addAllDefaultFor(List elements) { + public Builder addAllDefaultFor( + List + elements) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4565,13 +4603,17 @@ public Builder setIntervalDescription(EmptyParam intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions.PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions.TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -4693,8 +4735,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.code, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodOptions.Blik build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Blik(this.code, this.extraParams); } /** @@ -4818,8 +4860,8 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public SetupIntentUpdateParams.PaymentMethodOptions.Card build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Card( this.extraParams, this.mandateOptions, this.moto, @@ -4856,7 +4898,8 @@ public Builder putAllExtraParam(Map map) { } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -4875,7 +4918,8 @@ public Builder setMoto(Boolean moto) { * Selected network to process this SetupIntent on. Depends on the available networks of the * card attached to the SetupIntent. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + SetupIntentUpdateParams.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -4891,7 +4935,9 @@ public Builder setNetwork(Network network) { * Secure for more information on how this configuration interacts with Radar and our * SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + SetupIntentUpdateParams.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -4972,7 +5018,8 @@ public static class MandateOptions { /** Specifies the type of mandates supported. Possible values are {@code india}. */ @SerializedName("supported_types") - List supportedTypes; + List + supportedTypes; private MandateOptions( Long amount, @@ -4985,7 +5032,8 @@ private MandateOptions( Long intervalCount, Object reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.currency = currency; @@ -5024,11 +5072,13 @@ public static class Builder { private Long startDate; - private List supportedTypes; + private List< + SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType> + supportedTypes; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions( this.amount, this.amountType, this.currency, @@ -5053,7 +5103,9 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.AmountType + amountType) { this.amountType = amountType; return this; } @@ -5141,7 +5193,8 @@ public Builder putAllExtraParam(Map map) { * Specifies payment frequency. One of {@code day}, {@code week}, {@code month}, {@code * year}, or {@code sporadic}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.Interval interval) { this.interval = interval; return this; } @@ -5185,7 +5238,9 @@ public Builder setStartDate(Long startDate) { * SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addSupportedType(SupportedType element) { + public Builder addSupportedType( + SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType + element) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5200,7 +5255,9 @@ public Builder addSupportedType(SupportedType element) { * SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addAllSupportedType(List elements) { + public Builder addAllSupportedType( + List + elements) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5346,8 +5403,9 @@ public static class Builder { private Object persistentToken; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams, this.persistentToken); + public SetupIntentUpdateParams.PaymentMethodOptions.Link build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Link( + this.extraParams, this.persistentToken); } /** @@ -5422,8 +5480,9 @@ public static class Builder { private MandateOptions mandateOptions; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.mandateOptions); + public SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit( + this.extraParams, this.mandateOptions); } /** @@ -5455,7 +5514,8 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5485,8 +5545,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit.MandateOptions build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit.MandateOptions( + this.extraParams); } /** @@ -5570,8 +5631,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.networks, this.verificationMethod); } @@ -5604,19 +5665,24 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Additional fields for network related functions. */ - public Builder setNetworks(Networks networks) { + public Builder setNetworks( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks networks) { this.networks = networks; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -5640,7 +5706,10 @@ public static class FinancialConnections { * {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; /** * For webview integrations only. Upon completing OAuth login in the native browser, the @@ -5650,7 +5719,12 @@ public static class FinancialConnections { Object returnUrl; private FinancialConnections( - Map extraParams, List permissions, Object returnUrl) { + Map extraParams, + List< + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions, + Object returnUrl) { this.extraParams = extraParams; this.permissions = permissions; this.returnUrl = returnUrl; @@ -5663,13 +5737,18 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; private Object returnUrl; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions, this.returnUrl); + public SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions, this.returnUrl); } /** @@ -5708,7 +5787,10 @@ public Builder putAllExtraParam(Map map) { * SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -5723,7 +5805,11 @@ public Builder addPermission(Permission element) { * SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -5786,9 +5872,13 @@ public static class Networks { /** Triggers validations to run across the selected networks. */ @SerializedName("requested") - List requested; + List + requested; - private Networks(Map extraParams, List requested) { + private Networks( + Map extraParams, + List + requested) { this.extraParams = extraParams; this.requested = requested; } @@ -5800,11 +5890,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List requested; + private List< + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested> + requested; /** Finalize and obtain parameter instance from this builder. */ - public Networks build() { - return new Networks(this.extraParams, this.requested); + public SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks( + this.extraParams, this.requested); } /** @@ -5843,7 +5936,9 @@ public Builder putAllExtraParam(Map map) { * SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addRequested(Requested element) { + public Builder addRequested( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested + element) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -5857,7 +5952,9 @@ public Builder addRequested(Requested element) { * SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addAllRequested(List elements) { + public Builder addAllRequested( + List + elements) { if (this.requested == null) { this.requested = new ArrayList<>(); } diff --git a/src/main/java/com/stripe/param/ShippingRateCreateParams.java b/src/main/java/com/stripe/param/ShippingRateCreateParams.java index cb2de2271a1..ba2cba9878b 100644 --- a/src/main/java/com/stripe/param/ShippingRateCreateParams.java +++ b/src/main/java/com/stripe/param/ShippingRateCreateParams.java @@ -136,7 +136,7 @@ public ShippingRateCreateParams build() { * The estimated range for how long shipping will take, meant to be displayable to the customer. * This will appear on CheckoutSessions. */ - public Builder setDeliveryEstimate(DeliveryEstimate deliveryEstimate) { + public Builder setDeliveryEstimate(ShippingRateCreateParams.DeliveryEstimate deliveryEstimate) { this.deliveryEstimate = deliveryEstimate; return this; } @@ -206,7 +206,7 @@ public Builder putAllExtraParam(Map map) { * Describes a fixed amount to charge for shipping. Must be present if type is {@code * fixed_amount}. */ - public Builder setFixedAmount(FixedAmount fixedAmount) { + public Builder setFixedAmount(ShippingRateCreateParams.FixedAmount fixedAmount) { this.fixedAmount = fixedAmount; return this; } @@ -241,7 +241,7 @@ public Builder putAllMetadata(Map map) { * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of * {@code inclusive}, {@code exclusive}, or {@code unspecified}. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior(ShippingRateCreateParams.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -259,7 +259,7 @@ public Builder setTaxCode(String taxCode) { * The type of calculation to use on the shipping rate. Can only be {@code fixed_amount} for * now. */ - public Builder setType(Type type) { + public Builder setType(ShippingRateCreateParams.Type type) { this.type = type; return this; } @@ -304,8 +304,9 @@ public static class Builder { private Minimum minimum; /** Finalize and obtain parameter instance from this builder. */ - public DeliveryEstimate build() { - return new DeliveryEstimate(this.extraParams, this.maximum, this.minimum); + public ShippingRateCreateParams.DeliveryEstimate build() { + return new ShippingRateCreateParams.DeliveryEstimate( + this.extraParams, this.maximum, this.minimum); } /** @@ -338,13 +339,13 @@ public Builder putAllExtraParam(Map map) { /** * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. */ - public Builder setMaximum(Maximum maximum) { + public Builder setMaximum(ShippingRateCreateParams.DeliveryEstimate.Maximum maximum) { this.maximum = maximum; return this; } /** The lower bound of the estimated range. If empty, represents no lower bound. */ - public Builder setMinimum(Minimum minimum) { + public Builder setMinimum(ShippingRateCreateParams.DeliveryEstimate.Minimum minimum) { this.minimum = minimum; return this; } @@ -387,8 +388,9 @@ public static class Builder { private Long value; /** Finalize and obtain parameter instance from this builder. */ - public Maximum build() { - return new Maximum(this.extraParams, this.unit, this.value); + public ShippingRateCreateParams.DeliveryEstimate.Maximum build() { + return new ShippingRateCreateParams.DeliveryEstimate.Maximum( + this.extraParams, this.unit, this.value); } /** @@ -420,7 +422,7 @@ public Builder putAllExtraParam(Map map) { } /** A unit of time. */ - public Builder setUnit(Unit unit) { + public Builder setUnit(ShippingRateCreateParams.DeliveryEstimate.Maximum.Unit unit) { this.unit = unit; return this; } @@ -494,8 +496,9 @@ public static class Builder { private Long value; /** Finalize and obtain parameter instance from this builder. */ - public Minimum build() { - return new Minimum(this.extraParams, this.unit, this.value); + public ShippingRateCreateParams.DeliveryEstimate.Minimum build() { + return new ShippingRateCreateParams.DeliveryEstimate.Minimum( + this.extraParams, this.unit, this.value); } /** @@ -527,7 +530,7 @@ public Builder putAllExtraParam(Map map) { } /** A unit of time. */ - public Builder setUnit(Unit unit) { + public Builder setUnit(ShippingRateCreateParams.DeliveryEstimate.Minimum.Unit unit) { this.unit = unit; return this; } @@ -585,7 +588,7 @@ public static class FixedAmount { * href="https://stripe.com/docs/currencies">supported currency. */ @SerializedName("currency_options") - Map currencyOptions; + Map currencyOptions; /** * Map of extra parameters for custom features not available in this client library. The content @@ -599,7 +602,7 @@ public static class FixedAmount { private FixedAmount( Long amount, String currency, - Map currencyOptions, + Map currencyOptions, Map extraParams) { this.amount = amount; this.currency = currency; @@ -616,13 +619,14 @@ public static class Builder { private String currency; - private Map currencyOptions; + private Map currencyOptions; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public FixedAmount build() { - return new FixedAmount(this.amount, this.currency, this.currencyOptions, this.extraParams); + public ShippingRateCreateParams.FixedAmount build() { + return new ShippingRateCreateParams.FixedAmount( + this.amount, this.currency, this.currencyOptions, this.extraParams); } /** A non-negative integer in cents representing how much to charge. */ @@ -647,7 +651,8 @@ public Builder setCurrency(String currency) { * See {@link ShippingRateCreateParams.FixedAmount#currencyOptions} for the field * documentation. */ - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption( + String key, ShippingRateCreateParams.FixedAmount.CurrencyOption value) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -661,7 +666,8 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * See {@link ShippingRateCreateParams.FixedAmount#currencyOptions} for the field * documentation. */ - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption( + Map map) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -737,8 +743,9 @@ public static class Builder { private TaxBehavior taxBehavior; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption(this.amount, this.extraParams, this.taxBehavior); + public ShippingRateCreateParams.FixedAmount.CurrencyOption build() { + return new ShippingRateCreateParams.FixedAmount.CurrencyOption( + this.amount, this.extraParams, this.taxBehavior); } /** A non-negative integer in cents representing how much to charge. */ @@ -779,7 +786,8 @@ public Builder putAllExtraParam(Map map) { * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of * {@code inclusive}, {@code exclusive}, or {@code unspecified}. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + ShippingRateCreateParams.FixedAmount.CurrencyOption.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } diff --git a/src/main/java/com/stripe/param/ShippingRateListParams.java b/src/main/java/com/stripe/param/ShippingRateListParams.java index 9060f41c63a..a60806f236d 100644 --- a/src/main/java/com/stripe/param/ShippingRateListParams.java +++ b/src/main/java/com/stripe/param/ShippingRateListParams.java @@ -128,7 +128,7 @@ public Builder setActive(Boolean active) { * with an integer Unix timestamp, or it can be a dictionary with a number of different query * options. */ - public Builder setCreated(Created created) { + public Builder setCreated(ShippingRateListParams.Created created) { this.created = created; return this; } @@ -284,8 +284,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public ShippingRateListParams.Created build() { + return new ShippingRateListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/ShippingRateUpdateParams.java b/src/main/java/com/stripe/param/ShippingRateUpdateParams.java index 99c5815567a..916ae218425 100644 --- a/src/main/java/com/stripe/param/ShippingRateUpdateParams.java +++ b/src/main/java/com/stripe/param/ShippingRateUpdateParams.java @@ -157,7 +157,7 @@ public Builder putAllExtraParam(Map map) { * Describes a fixed amount to charge for shipping. Must be present if type is {@code * fixed_amount}. */ - public Builder setFixedAmount(FixedAmount fixedAmount) { + public Builder setFixedAmount(ShippingRateUpdateParams.FixedAmount fixedAmount) { this.fixedAmount = fixedAmount; return this; } @@ -216,7 +216,7 @@ public Builder setMetadata(Map metadata) { * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of * {@code inclusive}, {@code exclusive}, or {@code unspecified}. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior(ShippingRateUpdateParams.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -230,7 +230,7 @@ public static class FixedAmount { * href="https://stripe.com/docs/currencies">supported currency. */ @SerializedName("currency_options") - Map currencyOptions; + Map currencyOptions; /** * Map of extra parameters for custom features not available in this client library. The content @@ -242,7 +242,8 @@ public static class FixedAmount { Map extraParams; private FixedAmount( - Map currencyOptions, Map extraParams) { + Map currencyOptions, + Map extraParams) { this.currencyOptions = currencyOptions; this.extraParams = extraParams; } @@ -252,13 +253,13 @@ public static Builder builder() { } public static class Builder { - private Map currencyOptions; + private Map currencyOptions; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public FixedAmount build() { - return new FixedAmount(this.currencyOptions, this.extraParams); + public ShippingRateUpdateParams.FixedAmount build() { + return new ShippingRateUpdateParams.FixedAmount(this.currencyOptions, this.extraParams); } /** @@ -267,7 +268,8 @@ public FixedAmount build() { * See {@link ShippingRateUpdateParams.FixedAmount#currencyOptions} for the field * documentation. */ - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption( + String key, ShippingRateUpdateParams.FixedAmount.CurrencyOption value) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -281,7 +283,8 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * See {@link ShippingRateUpdateParams.FixedAmount#currencyOptions} for the field * documentation. */ - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption( + Map map) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -357,8 +360,9 @@ public static class Builder { private TaxBehavior taxBehavior; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption(this.amount, this.extraParams, this.taxBehavior); + public ShippingRateUpdateParams.FixedAmount.CurrencyOption build() { + return new ShippingRateUpdateParams.FixedAmount.CurrencyOption( + this.amount, this.extraParams, this.taxBehavior); } /** A non-negative integer in cents representing how much to charge. */ @@ -399,7 +403,8 @@ public Builder putAllExtraParam(Map map) { * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of * {@code inclusive}, {@code exclusive}, or {@code unspecified}. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + ShippingRateUpdateParams.FixedAmount.CurrencyOption.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } diff --git a/src/main/java/com/stripe/param/SkuCreateParams.java b/src/main/java/com/stripe/param/SkuCreateParams.java index e3dde4076cd..dc25c2a83a7 100644 --- a/src/main/java/com/stripe/param/SkuCreateParams.java +++ b/src/main/java/com/stripe/param/SkuCreateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; import java.util.ArrayList; @@ -270,7 +269,7 @@ public Builder setImage(String image) { } /** Description of the SKU's inventory. */ - public Builder setInventory(Inventory inventory) { + public Builder setInventory(SkuCreateParams.Inventory inventory) { this.inventory = inventory; return this; } @@ -302,7 +301,7 @@ public Builder putAllMetadata(Map map) { } /** The dimensions of this SKU for shipping purposes. */ - public Builder setPackageDimensions(PackageDimensions packageDimensions) { + public Builder setPackageDimensions(SkuCreateParams.PackageDimensions packageDimensions) { this.packageDimensions = packageDimensions; return this; } @@ -353,9 +352,13 @@ public static class Inventory { * bucket}. */ @SerializedName("value") - EnumParam value; + ApiRequestParams.EnumParam value; - private Inventory(Map extraParams, Long quantity, Type type, EnumParam value) { + private Inventory( + Map extraParams, + Long quantity, + Type type, + ApiRequestParams.EnumParam value) { this.extraParams = extraParams; this.quantity = quantity; this.type = type; @@ -373,11 +376,12 @@ public static class Builder { private Type type; - private EnumParam value; + private ApiRequestParams.EnumParam value; /** Finalize and obtain parameter instance from this builder. */ - public Inventory build() { - return new Inventory(this.extraParams, this.quantity, this.type, this.value); + public SkuCreateParams.Inventory build() { + return new SkuCreateParams.Inventory( + this.extraParams, this.quantity, this.type, this.value); } /** @@ -416,7 +420,7 @@ public Builder setQuantity(Long quantity) { * Inventory type. Possible values are {@code finite}, {@code bucket} (not quantified), and * {@code infinite}. */ - public Builder setType(Type type) { + public Builder setType(SkuCreateParams.Inventory.Type type) { this.type = type; return this; } @@ -426,7 +430,7 @@ public Builder setType(Type type) { * limited}, and {@code out_of_stock}. Will be present if and only if {@code type} is {@code * bucket}. */ - public Builder setValue(Value value) { + public Builder setValue(SkuCreateParams.Inventory.Value value) { this.value = value; return this; } @@ -535,8 +539,8 @@ public static class Builder { private BigDecimal width; /** Finalize and obtain parameter instance from this builder. */ - public PackageDimensions build() { - return new PackageDimensions( + public SkuCreateParams.PackageDimensions build() { + return new SkuCreateParams.PackageDimensions( this.extraParams, this.height, this.length, this.weight, this.width); } diff --git a/src/main/java/com/stripe/param/SkuUpdateParams.java b/src/main/java/com/stripe/param/SkuUpdateParams.java index 6607d52dc97..19a1daa775d 100644 --- a/src/main/java/com/stripe/param/SkuUpdateParams.java +++ b/src/main/java/com/stripe/param/SkuUpdateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; import java.util.ArrayList; @@ -267,7 +266,7 @@ public Builder setImage(EmptyParam image) { } /** Description of the SKU's inventory. */ - public Builder setInventory(Inventory inventory) { + public Builder setInventory(SkuUpdateParams.Inventory inventory) { this.inventory = inventory; return this; } @@ -323,7 +322,7 @@ public Builder setMetadata(Map metadata) { } /** The dimensions of this SKU for shipping purposes. */ - public Builder setPackageDimensions(PackageDimensions packageDimensions) { + public Builder setPackageDimensions(SkuUpdateParams.PackageDimensions packageDimensions) { this.packageDimensions = packageDimensions; return this; } @@ -390,9 +389,13 @@ public static class Inventory { * bucket}. */ @SerializedName("value") - EnumParam value; + ApiRequestParams.EnumParam value; - private Inventory(Map extraParams, Long quantity, Type type, EnumParam value) { + private Inventory( + Map extraParams, + Long quantity, + Type type, + ApiRequestParams.EnumParam value) { this.extraParams = extraParams; this.quantity = quantity; this.type = type; @@ -410,11 +413,12 @@ public static class Builder { private Type type; - private EnumParam value; + private ApiRequestParams.EnumParam value; /** Finalize and obtain parameter instance from this builder. */ - public Inventory build() { - return new Inventory(this.extraParams, this.quantity, this.type, this.value); + public SkuUpdateParams.Inventory build() { + return new SkuUpdateParams.Inventory( + this.extraParams, this.quantity, this.type, this.value); } /** @@ -453,7 +457,7 @@ public Builder setQuantity(Long quantity) { * Inventory type. Possible values are {@code finite}, {@code bucket} (not quantified), and * {@code infinite}. */ - public Builder setType(Type type) { + public Builder setType(SkuUpdateParams.Inventory.Type type) { this.type = type; return this; } @@ -463,7 +467,7 @@ public Builder setType(Type type) { * limited}, and {@code out_of_stock}. Will be present if and only if {@code type} is {@code * bucket}. */ - public Builder setValue(Value value) { + public Builder setValue(SkuUpdateParams.Inventory.Value value) { this.value = value; return this; } @@ -572,8 +576,8 @@ public static class Builder { private BigDecimal width; /** Finalize and obtain parameter instance from this builder. */ - public PackageDimensions build() { - return new PackageDimensions( + public SkuUpdateParams.PackageDimensions build() { + return new SkuUpdateParams.PackageDimensions( this.extraParams, this.height, this.length, this.weight, this.width); } diff --git a/src/main/java/com/stripe/param/SourceCreateParams.java b/src/main/java/com/stripe/param/SourceCreateParams.java index 44c44a552c1..8e32176a7fe 100644 --- a/src/main/java/com/stripe/param/SourceCreateParams.java +++ b/src/main/java/com/stripe/param/SourceCreateParams.java @@ -310,7 +310,7 @@ public Builder putAllExtraParam(Map map) { * redirect}, {@code receiver}, {@code code_verification}, {@code none}. It is generally * inferred unless a type supports multiple flows. */ - public Builder setFlow(Flow flow) { + public Builder setFlow(SourceCreateParams.Flow flow) { this.flow = flow; return this; } @@ -319,7 +319,7 @@ public Builder setFlow(Flow flow) { * Information about a mandate possibility attached to a source object (generally for bank * debits) as well as its acceptance status. */ - public Builder setMandate(Mandate mandate) { + public Builder setMandate(SourceCreateParams.Mandate mandate) { this.mandate = mandate; return this; } @@ -360,7 +360,7 @@ public Builder setOriginalSource(String originalSource) { * Information about the owner of the payment instrument that may be used or required by * particular source types. */ - public Builder setOwner(Owner owner) { + public Builder setOwner(SourceCreateParams.Owner owner) { this.owner = owner; return this; } @@ -369,7 +369,7 @@ public Builder setOwner(Owner owner) { * Optional parameters for the receiver flow. Can be set only if the source is a receiver * ({@code flow} is {@code receiver}). */ - public Builder setReceiver(Receiver receiver) { + public Builder setReceiver(SourceCreateParams.Receiver receiver) { this.receiver = receiver; return this; } @@ -378,7 +378,7 @@ public Builder setReceiver(Receiver receiver) { * Parameters required for the redirect flow. Required if the source is authenticated by a * redirect ({@code flow} is {@code redirect}). */ - public Builder setRedirect(Redirect redirect) { + public Builder setRedirect(SourceCreateParams.Redirect redirect) { this.redirect = redirect; return this; } @@ -387,7 +387,7 @@ public Builder setRedirect(Redirect redirect) { * Information about the items and shipping associated with the source. Required for * transactional credit (for example Klarna) sources before you can charge it. */ - public Builder setSourceOrder(SourceOrder sourceOrder) { + public Builder setSourceOrder(SourceCreateParams.SourceOrder sourceOrder) { this.sourceOrder = sourceOrder; return this; } @@ -423,7 +423,7 @@ public Builder setType(String type) { return this; } - public Builder setUsage(Usage usage) { + public Builder setUsage(SourceCreateParams.Usage usage) { this.usage = usage; return this; } @@ -506,8 +506,8 @@ public static class Builder { private NotificationMethod notificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public Mandate build() { - return new Mandate( + public SourceCreateParams.Mandate build() { + return new SourceCreateParams.Mandate( this.acceptance, this.amount, this.currency, @@ -520,7 +520,7 @@ public Mandate build() { * The parameters required to notify Stripe of a mandate acceptance or refusal by the * customer. */ - public Builder setAcceptance(Acceptance acceptance) { + public Builder setAcceptance(SourceCreateParams.Mandate.Acceptance acceptance) { this.acceptance = acceptance; return this; } @@ -574,7 +574,7 @@ public Builder putAllExtraParam(Map map) { * single debit), {@code scheduled} (with debits on an agreed schedule or for clearly-defined * events), or {@code variable}(for debits with any frequency) */ - public Builder setInterval(Interval interval) { + public Builder setInterval(SourceCreateParams.Mandate.Interval interval) { this.interval = interval; return this; } @@ -587,7 +587,8 @@ public Builder setInterval(Interval interval) { * the notification) or {@code none} (the underlying debit network does not require any * notification). */ - public Builder setNotificationMethod(NotificationMethod notificationMethod) { + public Builder setNotificationMethod( + SourceCreateParams.Mandate.NotificationMethod notificationMethod) { this.notificationMethod = notificationMethod; return this; } @@ -690,8 +691,8 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public Acceptance build() { - return new Acceptance( + public SourceCreateParams.Mandate.Acceptance build() { + return new SourceCreateParams.Mandate.Acceptance( this.date, this.extraParams, this.ip, @@ -748,7 +749,7 @@ public Builder setIp(String ip) { * The parameters required to store a mandate accepted offline. Should only be set if {@code * mandate[type]} is {@code offline} */ - public Builder setOffline(Offline offline) { + public Builder setOffline(SourceCreateParams.Mandate.Acceptance.Offline offline) { this.offline = offline; return this; } @@ -757,7 +758,7 @@ public Builder setOffline(Offline offline) { * The parameters required to store a mandate accepted online. Should only be set if {@code * mandate[type]} is {@code online} */ - public Builder setOnline(Online online) { + public Builder setOnline(SourceCreateParams.Mandate.Acceptance.Online online) { this.online = online; return this; } @@ -766,7 +767,7 @@ public Builder setOnline(Online online) { * The status of the mandate acceptance. Either {@code accepted} (the mandate was accepted) * or {@code refused} (the mandate was refused). */ - public Builder setStatus(Status status) { + public Builder setStatus(SourceCreateParams.Mandate.Acceptance.Status status) { this.status = status; return this; } @@ -775,7 +776,7 @@ public Builder setStatus(Status status) { * The type of acceptance information included with the mandate. Either {@code online} or * {@code offline} */ - public Builder setType(Type type) { + public Builder setType(SourceCreateParams.Mandate.Acceptance.Type type) { this.type = type; return this; } @@ -824,8 +825,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Offline build() { - return new Offline(this.contactEmail, this.extraParams); + public SourceCreateParams.Mandate.Acceptance.Offline build() { + return new SourceCreateParams.Mandate.Acceptance.Offline( + this.contactEmail, this.extraParams); } /** @@ -917,8 +919,9 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public Online build() { - return new Online(this.date, this.extraParams, this.ip, this.userAgent); + public SourceCreateParams.Mandate.Acceptance.Online build() { + return new SourceCreateParams.Mandate.Acceptance.Online( + this.date, this.extraParams, this.ip, this.userAgent); } /** @@ -1107,12 +1110,13 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public Owner build() { - return new Owner(this.address, this.email, this.extraParams, this.name, this.phone); + public SourceCreateParams.Owner build() { + return new SourceCreateParams.Owner( + this.address, this.email, this.extraParams, this.name, this.phone); } /** Owner's address. */ - public Builder setAddress(Address address) { + public Builder setAddress(SourceCreateParams.Owner.Address address) { this.address = address; return this; } @@ -1237,8 +1241,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public SourceCreateParams.Owner.Address build() { + return new SourceCreateParams.Owner.Address( this.city, this.country, this.extraParams, @@ -1354,8 +1358,8 @@ public static class Builder { private RefundAttributesMethod refundAttributesMethod; /** Finalize and obtain parameter instance from this builder. */ - public Receiver build() { - return new Receiver(this.extraParams, this.refundAttributesMethod); + public SourceCreateParams.Receiver build() { + return new SourceCreateParams.Receiver(this.extraParams, this.refundAttributesMethod); } /** @@ -1391,7 +1395,8 @@ public Builder putAllExtraParam(Map map) { * endpoint). Refer to each payment method's documentation to learn which refund attributes * may be required. */ - public Builder setRefundAttributesMethod(RefundAttributesMethod refundAttributesMethod) { + public Builder setRefundAttributesMethod( + SourceCreateParams.Receiver.RefundAttributesMethod refundAttributesMethod) { this.refundAttributesMethod = refundAttributesMethod; return this; } @@ -1449,8 +1454,8 @@ public static class Builder { private String returnUrl; /** Finalize and obtain parameter instance from this builder. */ - public Redirect build() { - return new Redirect(this.extraParams, this.returnUrl); + public SourceCreateParams.Redirect build() { + return new SourceCreateParams.Redirect(this.extraParams, this.returnUrl); } /** @@ -1503,7 +1508,7 @@ public static class SourceOrder { /** List of items constituting the order. */ @SerializedName("items") - List items; + List items; /** * Shipping address for the order. Required if any of the SKUs are for products that have {@code @@ -1512,7 +1517,10 @@ public static class SourceOrder { @SerializedName("shipping") Shipping shipping; - private SourceOrder(Map extraParams, List items, Shipping shipping) { + private SourceOrder( + Map extraParams, + List items, + Shipping shipping) { this.extraParams = extraParams; this.items = items; this.shipping = shipping; @@ -1525,13 +1533,13 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List items; + private List items; private Shipping shipping; /** Finalize and obtain parameter instance from this builder. */ - public SourceOrder build() { - return new SourceOrder(this.extraParams, this.items, this.shipping); + public SourceCreateParams.SourceOrder build() { + return new SourceCreateParams.SourceOrder(this.extraParams, this.items, this.shipping); } /** @@ -1565,7 +1573,7 @@ public Builder putAllExtraParam(Map map) { * subsequent calls adds additional elements to the original list. See {@link * SourceCreateParams.SourceOrder#items} for the field documentation. */ - public Builder addItem(Item element) { + public Builder addItem(SourceCreateParams.SourceOrder.Item element) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1578,7 +1586,7 @@ public Builder addItem(Item element) { * and subsequent calls adds additional elements to the original list. See {@link * SourceCreateParams.SourceOrder#items} for the field documentation. */ - public Builder addAllItem(List elements) { + public Builder addAllItem(List elements) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1590,7 +1598,7 @@ public Builder addAllItem(List elements) { * Shipping address for the order. Required if any of the SKUs are for products that have * {@code shippable} set to true. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(SourceCreateParams.SourceOrder.Shipping shipping) { this.shipping = shipping; return this; } @@ -1667,8 +1675,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Item build() { - return new Item( + public SourceCreateParams.SourceOrder.Item build() { + return new SourceCreateParams.SourceOrder.Item( this.amount, this.currency, this.description, @@ -1736,7 +1744,7 @@ public Builder setQuantity(Long quantity) { return this; } - public Builder setType(Type type) { + public Builder setType(SourceCreateParams.SourceOrder.Item.Type type) { this.type = type; return this; } @@ -1831,8 +1839,8 @@ public static class Builder { private String trackingNumber; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping( + public SourceCreateParams.SourceOrder.Shipping build() { + return new SourceCreateParams.SourceOrder.Shipping( this.address, this.carrier, this.extraParams, @@ -1842,7 +1850,7 @@ public Shipping build() { } /** Shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(SourceCreateParams.SourceOrder.Shipping.Address address) { this.address = address; return this; } @@ -1980,8 +1988,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public SourceCreateParams.SourceOrder.Shipping.Address build() { + return new SourceCreateParams.SourceOrder.Shipping.Address( this.city, this.country, this.extraParams, diff --git a/src/main/java/com/stripe/param/SourceUpdateParams.java b/src/main/java/com/stripe/param/SourceUpdateParams.java index d0c8516993a..a8025e47d9e 100644 --- a/src/main/java/com/stripe/param/SourceUpdateParams.java +++ b/src/main/java/com/stripe/param/SourceUpdateParams.java @@ -169,7 +169,7 @@ public Builder putAllExtraParam(Map map) { * Information about a mandate possibility attached to a source object (generally for bank * debits) as well as its acceptance status. */ - public Builder setMandate(Mandate mandate) { + public Builder setMandate(SourceUpdateParams.Mandate mandate) { this.mandate = mandate; return this; } @@ -228,7 +228,7 @@ public Builder setMetadata(Map metadata) { * Information about the owner of the payment instrument that may be used or required by * particular source types. */ - public Builder setOwner(Owner owner) { + public Builder setOwner(SourceUpdateParams.Owner owner) { this.owner = owner; return this; } @@ -237,7 +237,7 @@ public Builder setOwner(Owner owner) { * Information about the items and shipping associated with the source. Required for * transactional credit (for example Klarna) sources before you can charge it. */ - public Builder setSourceOrder(SourceOrder sourceOrder) { + public Builder setSourceOrder(SourceUpdateParams.SourceOrder sourceOrder) { this.sourceOrder = sourceOrder; return this; } @@ -320,8 +320,8 @@ public static class Builder { private NotificationMethod notificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public Mandate build() { - return new Mandate( + public SourceUpdateParams.Mandate build() { + return new SourceUpdateParams.Mandate( this.acceptance, this.amount, this.currency, @@ -334,7 +334,7 @@ public Mandate build() { * The parameters required to notify Stripe of a mandate acceptance or refusal by the * customer. */ - public Builder setAcceptance(Acceptance acceptance) { + public Builder setAcceptance(SourceUpdateParams.Mandate.Acceptance acceptance) { this.acceptance = acceptance; return this; } @@ -394,7 +394,7 @@ public Builder putAllExtraParam(Map map) { * single debit), {@code scheduled} (with debits on an agreed schedule or for clearly-defined * events), or {@code variable}(for debits with any frequency) */ - public Builder setInterval(Interval interval) { + public Builder setInterval(SourceUpdateParams.Mandate.Interval interval) { this.interval = interval; return this; } @@ -407,7 +407,8 @@ public Builder setInterval(Interval interval) { * the notification) or {@code none} (the underlying debit network does not require any * notification). */ - public Builder setNotificationMethod(NotificationMethod notificationMethod) { + public Builder setNotificationMethod( + SourceUpdateParams.Mandate.NotificationMethod notificationMethod) { this.notificationMethod = notificationMethod; return this; } @@ -510,8 +511,8 @@ public static class Builder { private Object userAgent; /** Finalize and obtain parameter instance from this builder. */ - public Acceptance build() { - return new Acceptance( + public SourceUpdateParams.Mandate.Acceptance build() { + return new SourceUpdateParams.Mandate.Acceptance( this.date, this.extraParams, this.ip, @@ -574,7 +575,7 @@ public Builder setIp(EmptyParam ip) { * The parameters required to store a mandate accepted offline. Should only be set if {@code * mandate[type]} is {@code offline} */ - public Builder setOffline(Offline offline) { + public Builder setOffline(SourceUpdateParams.Mandate.Acceptance.Offline offline) { this.offline = offline; return this; } @@ -583,7 +584,7 @@ public Builder setOffline(Offline offline) { * The parameters required to store a mandate accepted online. Should only be set if {@code * mandate[type]} is {@code online} */ - public Builder setOnline(Online online) { + public Builder setOnline(SourceUpdateParams.Mandate.Acceptance.Online online) { this.online = online; return this; } @@ -592,7 +593,7 @@ public Builder setOnline(Online online) { * The status of the mandate acceptance. Either {@code accepted} (the mandate was accepted) * or {@code refused} (the mandate was refused). */ - public Builder setStatus(Status status) { + public Builder setStatus(SourceUpdateParams.Mandate.Acceptance.Status status) { this.status = status; return this; } @@ -601,7 +602,7 @@ public Builder setStatus(Status status) { * The type of acceptance information included with the mandate. Either {@code online} or * {@code offline} */ - public Builder setType(Type type) { + public Builder setType(SourceUpdateParams.Mandate.Acceptance.Type type) { this.type = type; return this; } @@ -659,8 +660,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Offline build() { - return new Offline(this.contactEmail, this.extraParams); + public SourceUpdateParams.Mandate.Acceptance.Offline build() { + return new SourceUpdateParams.Mandate.Acceptance.Offline( + this.contactEmail, this.extraParams); } /** @@ -761,8 +763,9 @@ public static class Builder { private Object userAgent; /** Finalize and obtain parameter instance from this builder. */ - public Online build() { - return new Online(this.date, this.extraParams, this.ip, this.userAgent); + public SourceUpdateParams.Mandate.Acceptance.Online build() { + return new SourceUpdateParams.Mandate.Acceptance.Online( + this.date, this.extraParams, this.ip, this.userAgent); } /** @@ -966,12 +969,13 @@ public static class Builder { private Object phone; /** Finalize and obtain parameter instance from this builder. */ - public Owner build() { - return new Owner(this.address, this.email, this.extraParams, this.name, this.phone); + public SourceUpdateParams.Owner build() { + return new SourceUpdateParams.Owner( + this.address, this.email, this.extraParams, this.name, this.phone); } /** Owner's address. */ - public Builder setAddress(Address address) { + public Builder setAddress(SourceUpdateParams.Owner.Address address) { this.address = address; return this; } @@ -1114,8 +1118,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public SourceUpdateParams.Owner.Address build() { + return new SourceUpdateParams.Owner.Address( this.city, this.country, this.extraParams, @@ -1247,7 +1251,7 @@ public static class SourceOrder { /** List of items constituting the order. */ @SerializedName("items") - List items; + List items; /** * Shipping address for the order. Required if any of the SKUs are for products that have {@code @@ -1256,7 +1260,10 @@ public static class SourceOrder { @SerializedName("shipping") Shipping shipping; - private SourceOrder(Map extraParams, List items, Shipping shipping) { + private SourceOrder( + Map extraParams, + List items, + Shipping shipping) { this.extraParams = extraParams; this.items = items; this.shipping = shipping; @@ -1269,13 +1276,13 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List items; + private List items; private Shipping shipping; /** Finalize and obtain parameter instance from this builder. */ - public SourceOrder build() { - return new SourceOrder(this.extraParams, this.items, this.shipping); + public SourceUpdateParams.SourceOrder build() { + return new SourceUpdateParams.SourceOrder(this.extraParams, this.items, this.shipping); } /** @@ -1309,7 +1316,7 @@ public Builder putAllExtraParam(Map map) { * subsequent calls adds additional elements to the original list. See {@link * SourceUpdateParams.SourceOrder#items} for the field documentation. */ - public Builder addItem(Item element) { + public Builder addItem(SourceUpdateParams.SourceOrder.Item element) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1322,7 +1329,7 @@ public Builder addItem(Item element) { * and subsequent calls adds additional elements to the original list. See {@link * SourceUpdateParams.SourceOrder#items} for the field documentation. */ - public Builder addAllItem(List elements) { + public Builder addAllItem(List elements) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1334,7 +1341,7 @@ public Builder addAllItem(List elements) { * Shipping address for the order. Required if any of the SKUs are for products that have * {@code shippable} set to true. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(SourceUpdateParams.SourceOrder.Shipping shipping) { this.shipping = shipping; return this; } @@ -1411,8 +1418,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Item build() { - return new Item( + public SourceUpdateParams.SourceOrder.Item build() { + return new SourceUpdateParams.SourceOrder.Item( this.amount, this.currency, this.description, @@ -1496,7 +1503,7 @@ public Builder setQuantity(Long quantity) { return this; } - public Builder setType(Type type) { + public Builder setType(SourceUpdateParams.SourceOrder.Item.Type type) { this.type = type; return this; } @@ -1591,8 +1598,8 @@ public static class Builder { private Object trackingNumber; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping( + public SourceUpdateParams.SourceOrder.Shipping build() { + return new SourceUpdateParams.SourceOrder.Shipping( this.address, this.carrier, this.extraParams, @@ -1602,7 +1609,7 @@ public Shipping build() { } /** Shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(SourceUpdateParams.SourceOrder.Shipping.Address address) { this.address = address; return this; } @@ -1768,8 +1775,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public SourceUpdateParams.SourceOrder.Shipping.Address build() { + return new SourceUpdateParams.SourceOrder.Shipping.Address( this.city, this.country, this.extraParams, diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index f07324efb46..98d8968f2aa 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -18,7 +18,7 @@ public class SubscriptionCreateParams extends ApiRequestParams { * for this subscription. You may pass up to 20 items. */ @SerializedName("add_invoice_items") - List addInvoiceItems; + List addInvoiceItems; /** * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the @@ -164,7 +164,7 @@ public class SubscriptionCreateParams extends ApiRequestParams { /** A list of up to 20 subscription items, each with an attached price. */ @SerializedName("items") - List items; + List items; /** * Set of key-value pairs that you can attach @@ -277,7 +277,7 @@ public class SubscriptionCreateParams extends ApiRequestParams { Long trialPeriodDays; private SubscriptionCreateParams( - List addInvoiceItems, + List addInvoiceItems, BigDecimal applicationFeePercent, AutomaticTax automaticTax, Long backdateStartDate, @@ -296,7 +296,7 @@ private SubscriptionCreateParams( String description, List expand, Map extraParams, - List items, + List items, Object metadata, Boolean offSession, PaymentBehavior paymentBehavior, @@ -346,7 +346,7 @@ public static Builder builder() { } public static class Builder { - private List addInvoiceItems; + private List addInvoiceItems; private BigDecimal applicationFeePercent; @@ -384,7 +384,7 @@ public static class Builder { private Map extraParams; - private List items; + private List items; private Object metadata; @@ -449,7 +449,7 @@ public SubscriptionCreateParams build() { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionCreateParams#addInvoiceItems} for the field documentation. */ - public Builder addAddInvoiceItem(AddInvoiceItem element) { + public Builder addAddInvoiceItem(SubscriptionCreateParams.AddInvoiceItem element) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -462,7 +462,7 @@ public Builder addAddInvoiceItem(AddInvoiceItem element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionCreateParams#addInvoiceItems} for the field documentation. */ - public Builder addAllAddInvoiceItem(List elements) { + public Builder addAllAddInvoiceItem(List elements) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -487,7 +487,7 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { * Automatic tax settings for this subscription. We recommend you only include this parameter * when the existing value is being changed. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(SubscriptionCreateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -518,7 +518,8 @@ public Builder setBillingCycleAnchor(Long billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionCreateParams.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -557,7 +558,7 @@ public Builder setCancelAtPeriodEnd(Boolean cancelAtPeriodEnd) { * attached to the customer. When sending an invoice, Stripe will email your customer an invoice * with payment instructions. Defaults to {@code charge_automatically}. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(SubscriptionCreateParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -737,7 +738,7 @@ public Builder putAllExtraParam(Map map) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionCreateParams#items} for the field documentation. */ - public Builder addItem(Item element) { + public Builder addItem(SubscriptionCreateParams.Item element) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -750,7 +751,7 @@ public Builder addItem(Item element) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionCreateParams#items} for the field documentation. */ - public Builder addAllItem(List elements) { + public Builder addAllItem(List elements) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -842,13 +843,13 @@ public Builder setOffSession(Boolean offSession) { *

{@code pending_if_incomplete} is only used with updates and cannot be passed when creating * a subscription. */ - public Builder setPaymentBehavior(PaymentBehavior paymentBehavior) { + public Builder setPaymentBehavior(SubscriptionCreateParams.PaymentBehavior paymentBehavior) { this.paymentBehavior = paymentBehavior; return this; } /** Payment settings to pass to invoices created by the subscription. */ - public Builder setPaymentSettings(PaymentSettings paymentSettings) { + public Builder setPaymentSettings(SubscriptionCreateParams.PaymentSettings paymentSettings) { this.paymentSettings = paymentSettings; return this; } @@ -859,7 +860,7 @@ public Builder setPaymentSettings(PaymentSettings paymentSettings) { * given subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval( - PendingInvoiceItemInterval pendingInvoiceItemInterval) { + SubscriptionCreateParams.PendingInvoiceItemInterval pendingInvoiceItemInterval) { this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; return this; } @@ -889,7 +890,8 @@ public Builder setPromotionCode(String promotionCode) { * resulting from the {@code billing_cycle_anchor}. If no value is passed, the default is {@code * create_prorations}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionCreateParams.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -898,7 +900,7 @@ public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { * If specified, the funds from the subscription's invoices will be transferred to the * destination and the ID of the resulting transfers will be found on the resulting charges. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(SubscriptionCreateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -912,7 +914,7 @@ public Builder setTransferData(TransferData transferData) { * Using trial periods on * subscriptions to learn more. */ - public Builder setTrialEnd(TrialEnd trialEnd) { + public Builder setTrialEnd(SubscriptionCreateParams.TrialEnd trialEnd) { this.trialEnd = trialEnd; return this; } @@ -1017,8 +1019,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public AddInvoiceItem build() { - return new AddInvoiceItem( + public SubscriptionCreateParams.AddInvoiceItem build() { + return new SubscriptionCreateParams.AddInvoiceItem( this.extraParams, this.price, this.priceData, this.quantity, this.taxRates); } @@ -1059,7 +1061,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(SubscriptionCreateParams.AddInvoiceItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1196,8 +1198,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionCreateParams.AddInvoiceItem.PriceData build() { + return new SubscriptionCreateParams.AddInvoiceItem.PriceData( this.currency, this.extraParams, this.product, @@ -1255,7 +1257,8 @@ public Builder setProduct(String product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionCreateParams.AddInvoiceItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -1333,8 +1336,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionCreateParams.AutomaticTax build() { + return new SubscriptionCreateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -1416,8 +1419,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionCreateParams.BillingThresholds build() { + return new SubscriptionCreateParams.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -1563,8 +1566,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public Item build() { - return new Item( + public SubscriptionCreateParams.Item build() { + return new SubscriptionCreateParams.Item( this.billingThresholds, this.extraParams, this.metadata, @@ -1580,7 +1583,8 @@ public Item build() { * billing period. When updating, pass an empty string to remove previously-defined * thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionCreateParams.Item.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -1663,7 +1667,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(SubscriptionCreateParams.Item.PriceData priceData) { this.priceData = priceData; return this; } @@ -1757,8 +1761,9 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public SubscriptionCreateParams.Item.BillingThresholds build() { + return new SubscriptionCreateParams.Item.BillingThresholds( + this.extraParams, this.usageGte); } /** @@ -1886,8 +1891,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionCreateParams.Item.PriceData build() { + return new SubscriptionCreateParams.Item.PriceData( this.currency, this.extraParams, this.product, @@ -1944,7 +1949,7 @@ public Builder setProduct(String product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(SubscriptionCreateParams.Item.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -1954,7 +1959,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionCreateParams.Item.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2024,8 +2030,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public SubscriptionCreateParams.Item.PriceData.Recurring build() { + return new SubscriptionCreateParams.Item.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -2060,7 +2067,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionCreateParams.Item.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -2175,8 +2183,8 @@ public static class Builder { private SaveDefaultPaymentMethod saveDefaultPaymentMethod; /** Finalize and obtain parameter instance from this builder. */ - public PaymentSettings build() { - return new PaymentSettings( + public SubscriptionCreateParams.PaymentSettings build() { + return new SubscriptionCreateParams.PaymentSettings( this.extraParams, this.paymentMethodOptions, this.paymentMethodTypes, @@ -2213,7 +2221,8 @@ public Builder putAllExtraParam(Map map) { /** * Payment-method-specific configuration to provide to invoices created by the subscription. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -2225,7 +2234,8 @@ public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions * documentation. */ @SuppressWarnings("unchecked") - public Builder addPaymentMethodType(PaymentMethodType element) { + public Builder addPaymentMethodType( + SubscriptionCreateParams.PaymentSettings.PaymentMethodType element) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -2242,7 +2252,8 @@ public Builder addPaymentMethodType(PaymentMethodType element) { * documentation. */ @SuppressWarnings("unchecked") - public Builder addAllPaymentMethodType(List elements) { + public Builder addAllPaymentMethodType( + List elements) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -2271,7 +2282,8 @@ public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) { * default payment method, and your invoice template settings. */ - public Builder setPaymentMethodTypes(List paymentMethodTypes) { + public Builder setPaymentMethodTypes( + List paymentMethodTypes) { this.paymentMethodTypes = paymentMethodTypes; return this; } @@ -2281,7 +2293,8 @@ public Builder setPaymentMethodTypes(List paymentMethodTypes) * {@code subscription.default_payment_method} when a subscription payment succeeds. */ public Builder setSaveDefaultPaymentMethod( - SaveDefaultPaymentMethod saveDefaultPaymentMethod) { + SubscriptionCreateParams.PaymentSettings.SaveDefaultPaymentMethod + saveDefaultPaymentMethod) { this.saveDefaultPaymentMethod = saveDefaultPaymentMethod; return this; } @@ -2377,8 +2390,8 @@ public static class Builder { private Object usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions( this.acssDebit, this.bancontact, this.card, @@ -2392,7 +2405,8 @@ public PaymentMethodOptions build() { * This sub-hash contains details about the Canadian pre-authorized debit payment method * options to pass to the invoice’s PaymentIntent. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -2410,7 +2424,8 @@ public Builder setAcssDebit(EmptyParam acssDebit) { * This sub-hash contains details about the Bancontact payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -2428,7 +2443,8 @@ public Builder setBancontact(EmptyParam bancontact) { * This sub-hash contains details about the Card payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setCard(Card card) { + public Builder setCard( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -2446,7 +2462,9 @@ public Builder setCard(EmptyParam card) { * This sub-hash contains details about the Bank transfer payment method options to pass to * the invoice’s PaymentIntent. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + customerBalance) { this.customerBalance = customerBalance; return this; } @@ -2494,7 +2512,8 @@ public Builder putAllExtraParam(Map map) { * This sub-hash contains details about the Konbini payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Konbini konbini) { this.konbini = konbini; return this; } @@ -2512,7 +2531,9 @@ public Builder setKonbini(EmptyParam konbini) { * This sub-hash contains details about the ACH direct debit payment method options to pass * to the invoice’s PaymentIntent. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -2568,8 +2589,9 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit(this.extraParams, this.mandateOptions, this.verificationMethod); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit( + this.extraParams, this.mandateOptions, this.verificationMethod); } /** @@ -2603,13 +2625,18 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -2646,8 +2673,11 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams, this.transactionType); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions(this.extraParams, this.transactionType); } /** @@ -2681,7 +2711,10 @@ public Builder putAllExtraParam(Map map) { } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions.TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -2756,8 +2789,9 @@ public static class Builder { private PreferredLanguage preferredLanguage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams, this.preferredLanguage); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact( + this.extraParams, this.preferredLanguage); } /** @@ -2794,7 +2828,10 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Bancontact authorization page that the customer is redirected * to. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact + .PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -2883,8 +2920,8 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card( this.extraParams, this.mandateOptions, this.network, this.requestThreeDSecure); } @@ -2919,7 +2956,9 @@ public Builder putAllExtraParam(Map map) { } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -2928,7 +2967,8 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * Selected network to process this Subscription on. Depends on the available networks of * the card attached to the Subscription. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -2943,7 +2983,9 @@ public Builder setNetwork(Network network) { * 3D Secure for more information on how this configuration interacts with Radar and * our SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -3005,9 +3047,10 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( - this.amount, this.amountType, this.description, this.extraParams); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card + .MandateOptions(this.amount, this.amountType, this.description, this.extraParams); } /** Amount to be charged for future payments. */ @@ -3021,7 +3064,10 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + .AmountType + amountType) { this.amountType = amountType; return this; } @@ -3182,15 +3228,20 @@ public static class Builder { private String fundingType; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.bankTransfer, this.extraParams, this.fundingType); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance(this.bankTransfer, this.extraParams, this.fundingType); } /** * Configuration for the bank transfer funding type, if the {@code funding_type} is set to * {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer + bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -3278,12 +3329,18 @@ public static class Builder { private String type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer(this.euBankTransfer, this.extraParams, this.type); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance.BankTransfer(this.euBankTransfer, this.extraParams, this.type); } /** Configuration for eu_bank_transfer funding type. */ - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -3363,8 +3420,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance.BankTransfer.EuBankTransfer(this.country, this.extraParams); } /** @@ -3434,8 +3494,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Konbini build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Konbini( + this.extraParams); } /** @@ -3511,8 +3572,9 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.verificationMethod); } @@ -3547,13 +3609,19 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -3577,10 +3645,17 @@ public static class FinancialConnections { * balances}, {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; private FinancialConnections( - Map extraParams, List permissions) { + Map extraParams, + List< + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions) { this.extraParams = extraParams; this.permissions = permissions; } @@ -3592,11 +3667,17 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions); } /** @@ -3636,7 +3717,10 @@ public Builder putAllExtraParam(Map map) { * SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -3651,7 +3735,11 @@ public Builder addPermission(Permission element) { * SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -3838,8 +3926,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public PendingInvoiceItemInterval build() { - return new PendingInvoiceItemInterval(this.extraParams, this.interval, this.intervalCount); + public SubscriptionCreateParams.PendingInvoiceItemInterval build() { + return new SubscriptionCreateParams.PendingInvoiceItemInterval( + this.extraParams, this.interval, this.intervalCount); } /** @@ -3874,7 +3963,8 @@ public Builder putAllExtraParam(Map map) { * Specifies invoicing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionCreateParams.PendingInvoiceItemInterval.Interval interval) { this.interval = interval; return this; } @@ -3954,8 +4044,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionCreateParams.TransferData build() { + return new SubscriptionCreateParams.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java index dd67c9f24b7..890f7f3c35e 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java @@ -205,7 +205,8 @@ public SubscriptionItemCreateParams build() { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. When updating, pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionItemCreateParams.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -325,7 +326,8 @@ public Builder putAllMetadata(Map map) { * API versions prior to 2019-03-14. See the changelog to learn more. */ - public Builder setPaymentBehavior(PaymentBehavior paymentBehavior) { + public Builder setPaymentBehavior( + SubscriptionItemCreateParams.PaymentBehavior paymentBehavior) { this.paymentBehavior = paymentBehavior; return this; } @@ -346,7 +348,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(SubscriptionItemCreateParams.PriceData priceData) { this.priceData = priceData; return this; } @@ -357,7 +359,8 @@ public Builder setPriceData(PriceData priceData) { * billing cycle changes (e.g., when switching plans, resetting {@code * billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionItemCreateParams.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -467,8 +470,8 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public SubscriptionItemCreateParams.BillingThresholds build() { + return new SubscriptionItemCreateParams.BillingThresholds(this.extraParams, this.usageGte); } /** @@ -593,8 +596,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionItemCreateParams.PriceData build() { + return new SubscriptionItemCreateParams.PriceData( this.currency, this.extraParams, this.product, @@ -649,7 +652,7 @@ public Builder setProduct(String product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(SubscriptionItemCreateParams.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -659,7 +662,8 @@ public Builder setRecurring(Recurring recurring) { * {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionItemCreateParams.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -728,8 +732,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public SubscriptionItemCreateParams.PriceData.Recurring build() { + return new SubscriptionItemCreateParams.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -764,7 +769,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionItemCreateParams.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } diff --git a/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java b/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java index 0bc10821dfe..86ef9fe9ab1 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java @@ -113,7 +113,8 @@ public Builder putAllExtraParam(Map map) { * billing cycle changes (e.g., when switching plans, resetting {@code * billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionItemDeleteParams.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } diff --git a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java index 47d26377cf7..ed9191c6098 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java @@ -208,7 +208,8 @@ public SubscriptionItemUpdateParams build() { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. When updating, pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionItemUpdateParams.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -358,7 +359,8 @@ public Builder setOffSession(Boolean offSession) { * API versions prior to 2019-03-14. See the changelog to learn more. */ - public Builder setPaymentBehavior(PaymentBehavior paymentBehavior) { + public Builder setPaymentBehavior( + SubscriptionItemUpdateParams.PaymentBehavior paymentBehavior) { this.paymentBehavior = paymentBehavior; return this; } @@ -397,7 +399,7 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(SubscriptionItemUpdateParams.PriceData priceData) { this.priceData = priceData; return this; } @@ -408,7 +410,8 @@ public Builder setPriceData(PriceData priceData) { * billing cycle changes (e.g., when switching plans, resetting {@code * billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionItemUpdateParams.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -512,8 +515,8 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public SubscriptionItemUpdateParams.BillingThresholds build() { + return new SubscriptionItemUpdateParams.BillingThresholds(this.extraParams, this.usageGte); } /** @@ -638,8 +641,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionItemUpdateParams.PriceData build() { + return new SubscriptionItemUpdateParams.PriceData( this.currency, this.extraParams, this.product, @@ -710,7 +713,7 @@ public Builder setProduct(EmptyParam product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(SubscriptionItemUpdateParams.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -720,7 +723,8 @@ public Builder setRecurring(Recurring recurring) { * {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionItemUpdateParams.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -799,8 +803,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public SubscriptionItemUpdateParams.PriceData.Recurring build() { + return new SubscriptionItemUpdateParams.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -835,7 +840,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionItemUpdateParams.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } diff --git a/src/main/java/com/stripe/param/SubscriptionListParams.java b/src/main/java/com/stripe/param/SubscriptionListParams.java index ccb3d415302..2693b3c1cfc 100644 --- a/src/main/java/com/stripe/param/SubscriptionListParams.java +++ b/src/main/java/com/stripe/param/SubscriptionListParams.java @@ -182,12 +182,12 @@ public SubscriptionListParams build() { * The collection method of the subscriptions to retrieve. Either {@code charge_automatically} * or {@code send_invoice}. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(SubscriptionListParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } - public Builder setCreated(Created created) { + public Builder setCreated(SubscriptionListParams.Created created) { this.created = created; return this; } @@ -197,7 +197,7 @@ public Builder setCreated(Long created) { return this; } - public Builder setCurrentPeriodEnd(CurrentPeriodEnd currentPeriodEnd) { + public Builder setCurrentPeriodEnd(SubscriptionListParams.CurrentPeriodEnd currentPeriodEnd) { this.currentPeriodEnd = currentPeriodEnd; return this; } @@ -207,7 +207,8 @@ public Builder setCurrentPeriodEnd(Long currentPeriodEnd) { return this; } - public Builder setCurrentPeriodStart(CurrentPeriodStart currentPeriodStart) { + public Builder setCurrentPeriodStart( + SubscriptionListParams.CurrentPeriodStart currentPeriodStart) { this.currentPeriodStart = currentPeriodStart; return this; } @@ -327,7 +328,7 @@ public Builder setStartingAfter(String startingAfter) { * payment. Passing in a value of {@code all} will return subscriptions of all statuses. If * no value is supplied, all subscriptions that have not been canceled are returned. */ - public Builder setStatus(Status status) { + public Builder setStatus(SubscriptionListParams.Status status) { this.status = status; return this; } @@ -393,8 +394,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public SubscriptionListParams.Created build() { + return new SubscriptionListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -501,8 +503,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public CurrentPeriodEnd build() { - return new CurrentPeriodEnd(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public SubscriptionListParams.CurrentPeriodEnd build() { + return new SubscriptionListParams.CurrentPeriodEnd( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -610,8 +613,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public CurrentPeriodStart build() { - return new CurrentPeriodStart(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public SubscriptionListParams.CurrentPeriodStart build() { + return new SubscriptionListParams.CurrentPeriodStart( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java index 00268ffe650..1903ad8e9a0 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java @@ -68,7 +68,7 @@ public class SubscriptionScheduleCreateParams extends ApiRequestParams { * one phase will always equal the {@code start_date} of the next phase. */ @SerializedName("phases") - List phases; + List phases; /** * When the subscription schedule starts. We recommend using {@code now} so that it starts the @@ -86,7 +86,7 @@ private SubscriptionScheduleCreateParams( Map extraParams, String fromSubscription, Object metadata, - List phases, + List phases, Object startDate) { this.customer = customer; this.defaultSettings = defaultSettings; @@ -118,7 +118,7 @@ public static class Builder { private Object metadata; - private List phases; + private List phases; private Object startDate; @@ -143,7 +143,8 @@ public Builder setCustomer(String customer) { } /** Object representing the subscription schedule's default settings. */ - public Builder setDefaultSettings(DefaultSettings defaultSettings) { + public Builder setDefaultSettings( + SubscriptionScheduleCreateParams.DefaultSettings defaultSettings) { this.defaultSettings = defaultSettings; return this; } @@ -154,7 +155,7 @@ public Builder setDefaultSettings(DefaultSettings defaultSettings) { * the subscription schedule and keep the underlying subscription running.{@code cancel} will * end the subscription schedule and cancel the underlying subscription. */ - public Builder setEndBehavior(EndBehavior endBehavior) { + public Builder setEndBehavior(SubscriptionScheduleCreateParams.EndBehavior endBehavior) { this.endBehavior = endBehavior; return this; } @@ -278,7 +279,7 @@ public Builder setMetadata(Map metadata) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleCreateParams#phases} for the field documentation. */ - public Builder addPhase(Phase element) { + public Builder addPhase(SubscriptionScheduleCreateParams.Phase element) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -291,7 +292,7 @@ public Builder addPhase(Phase element) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleCreateParams#phases} for the field documentation. */ - public Builder addAllPhase(List elements) { + public Builder addAllPhase(List elements) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -314,7 +315,7 @@ public Builder setStartDate(Long startDate) { * subscription immediately. You can also use a Unix timestamp to backdate the subscription so * that it starts on a past date, or set a future date for the subscription to start on. */ - public Builder setStartDate(StartDate startDate) { + public Builder setStartDate(SubscriptionScheduleCreateParams.StartDate startDate) { this.startDate = startDate; return this; } @@ -447,8 +448,8 @@ public static class Builder { private Object transferData; /** Finalize and obtain parameter instance from this builder. */ - public DefaultSettings build() { - return new DefaultSettings( + public SubscriptionScheduleCreateParams.DefaultSettings build() { + return new SubscriptionScheduleCreateParams.DefaultSettings( this.applicationFeePercent, this.automaticTax, this.billingCycleAnchor, @@ -475,7 +476,8 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { } /** Default settings for automatic tax computation. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax( + SubscriptionScheduleCreateParams.DefaultSettings.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -486,7 +488,8 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * this phase specifies a trial. For more information, see the billing cycle documentation. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + SubscriptionScheduleCreateParams.DefaultSettings.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -495,7 +498,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleCreateParams.DefaultSettings.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -516,7 +520,8 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * email your customer an invoice with payment instructions. Defaults to {@code * charge_automatically} on creation. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod( + SubscriptionScheduleCreateParams.DefaultSettings.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -568,7 +573,8 @@ public Builder putAllExtraParam(Map map) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings( + SubscriptionScheduleCreateParams.DefaultSettings.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -577,7 +583,8 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * The data with which to automatically create a Transfer for each of the associated * subscription's invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + SubscriptionScheduleCreateParams.DefaultSettings.TransferData transferData) { this.transferData = transferData; return this; } @@ -625,8 +632,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionScheduleCreateParams.DefaultSettings.AutomaticTax build() { + return new SubscriptionScheduleCreateParams.DefaultSettings.AutomaticTax( + this.enabled, this.extraParams); } /** @@ -712,8 +720,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionScheduleCreateParams.DefaultSettings.BillingThresholds build() { + return new SubscriptionScheduleCreateParams.DefaultSettings.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -799,8 +807,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public SubscriptionScheduleCreateParams.DefaultSettings.InvoiceSettings build() { + return new SubscriptionScheduleCreateParams.DefaultSettings.InvoiceSettings( + this.daysUntilDue, this.extraParams); } /** @@ -887,8 +896,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionScheduleCreateParams.DefaultSettings.TransferData build() { + return new SubscriptionScheduleCreateParams.DefaultSettings.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** @@ -978,7 +988,7 @@ public static class Phase { * for this phase. You may pass up to 20 items. */ @SerializedName("add_invoice_items") - List addInvoiceItems; + List addInvoiceItems; /** * A non-negative decimal between 0 and 100, with at most two decimal places. This represents @@ -1084,7 +1094,7 @@ public static class Phase { * subscription schedule. */ @SerializedName("items") - List items; + List items; /** * Integer representing the multiplier applied to the price interval. For example, {@code @@ -1137,7 +1147,7 @@ public static class Phase { Long trialEnd; private Phase( - List addInvoiceItems, + List addInvoiceItems, BigDecimal applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, @@ -1151,7 +1161,7 @@ private Phase( Long endDate, Map extraParams, InvoiceSettings invoiceSettings, - List items, + List items, Long iterations, Map metadata, ProrationBehavior prorationBehavior, @@ -1186,7 +1196,7 @@ public static Builder builder() { } public static class Builder { - private List addInvoiceItems; + private List addInvoiceItems; private BigDecimal applicationFeePercent; @@ -1214,7 +1224,7 @@ public static class Builder { private InvoiceSettings invoiceSettings; - private List items; + private List items; private Long iterations; @@ -1229,8 +1239,8 @@ public static class Builder { private Long trialEnd; /** Finalize and obtain parameter instance from this builder. */ - public Phase build() { - return new Phase( + public SubscriptionScheduleCreateParams.Phase build() { + return new SubscriptionScheduleCreateParams.Phase( this.addInvoiceItems, this.applicationFeePercent, this.automaticTax, @@ -1259,7 +1269,8 @@ public Phase build() { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleCreateParams.Phase#addInvoiceItems} for the field documentation. */ - public Builder addAddInvoiceItem(AddInvoiceItem element) { + public Builder addAddInvoiceItem( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem element) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -1272,7 +1283,8 @@ public Builder addAddInvoiceItem(AddInvoiceItem element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link SubscriptionScheduleCreateParams.Phase#addInvoiceItems} for the field documentation. */ - public Builder addAllAddInvoiceItem(List elements) { + public Builder addAllAddInvoiceItem( + List elements) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -1294,7 +1306,8 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { } /** Automatic tax settings for this phase. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax( + SubscriptionScheduleCreateParams.Phase.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -1305,7 +1318,8 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * this phase specifies a trial. For more information, see the billing cycle documentation. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + SubscriptionScheduleCreateParams.Phase.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -1314,7 +1328,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleCreateParams.Phase.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -1335,7 +1350,8 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * email your customer an invoice with payment instructions. Defaults to {@code * charge_automatically} on creation. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod( + SubscriptionScheduleCreateParams.Phase.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -1465,7 +1481,8 @@ public Builder putAllExtraParam(Map map) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings( + SubscriptionScheduleCreateParams.Phase.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -1475,7 +1492,7 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleCreateParams.Phase#items} for the field documentation. */ - public Builder addItem(Item element) { + public Builder addItem(SubscriptionScheduleCreateParams.Phase.Item element) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1488,7 +1505,7 @@ public Builder addItem(Item element) { * and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleCreateParams.Phase#items} for the field documentation. */ - public Builder addAllItem(List elements) { + public Builder addAllItem(List elements) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1538,7 +1555,8 @@ public Builder putAllMetadata(Map map) { * href="https://stripe.com/docs/billing/subscriptions/prorations">prorations when * transitioning to this phase. The default value is {@code create_prorations}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionScheduleCreateParams.Phase.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -1547,7 +1565,8 @@ public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { * The data with which to automatically create a Transfer for each of the associated * subscription's invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + SubscriptionScheduleCreateParams.Phase.TransferData transferData) { this.transferData = transferData; return this; } @@ -1633,8 +1652,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public AddInvoiceItem build() { - return new AddInvoiceItem( + public SubscriptionScheduleCreateParams.Phase.AddInvoiceItem build() { + return new SubscriptionScheduleCreateParams.Phase.AddInvoiceItem( this.extraParams, this.price, this.priceData, this.quantity, this.taxRates); } @@ -1676,7 +1695,8 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1816,8 +1836,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.PriceData build() { + return new SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.PriceData( this.currency, this.extraParams, this.product, @@ -1877,7 +1897,9 @@ public Builder setProduct(String product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as * either {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.PriceData.TaxBehavior + taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -1955,8 +1977,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionScheduleCreateParams.Phase.AutomaticTax build() { + return new SubscriptionScheduleCreateParams.Phase.AutomaticTax( + this.enabled, this.extraParams); } /** @@ -2040,8 +2063,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionScheduleCreateParams.Phase.BillingThresholds build() { + return new SubscriptionScheduleCreateParams.Phase.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -2125,8 +2148,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public SubscriptionScheduleCreateParams.Phase.InvoiceSettings build() { + return new SubscriptionScheduleCreateParams.Phase.InvoiceSettings( + this.daysUntilDue, this.extraParams); } /** @@ -2259,8 +2283,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public Item build() { - return new Item( + public SubscriptionScheduleCreateParams.Phase.Item build() { + return new SubscriptionScheduleCreateParams.Phase.Item( this.billingThresholds, this.extraParams, this.plan, @@ -2275,7 +2299,8 @@ public Item build() { * new billing period. When updating, pass an empty string to remove previously-defined * thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleCreateParams.Phase.Item.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -2337,7 +2362,8 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData( + SubscriptionScheduleCreateParams.Phase.Item.PriceData priceData) { this.priceData = priceData; return this; } @@ -2435,8 +2461,9 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public SubscriptionScheduleCreateParams.Phase.Item.BillingThresholds build() { + return new SubscriptionScheduleCreateParams.Phase.Item.BillingThresholds( + this.extraParams, this.usageGte); } /** @@ -2567,8 +2594,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionScheduleCreateParams.Phase.Item.PriceData build() { + return new SubscriptionScheduleCreateParams.Phase.Item.PriceData( this.currency, this.extraParams, this.product, @@ -2626,7 +2653,8 @@ public Builder setProduct(String product) { * The recurring components of a price such as {@code interval} and {@code * interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring( + SubscriptionScheduleCreateParams.Phase.Item.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -2636,7 +2664,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as * either {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionScheduleCreateParams.Phase.Item.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2707,8 +2736,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public SubscriptionScheduleCreateParams.Phase.Item.PriceData.Recurring build() { + return new SubscriptionScheduleCreateParams.Phase.Item.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -2745,7 +2775,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or * {@code year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionScheduleCreateParams.Phase.Item.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -2845,8 +2876,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionScheduleCreateParams.Phase.TransferData build() { + return new SubscriptionScheduleCreateParams.Phase.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleListParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleListParams.java index 087a1d8d10d..2f5364d2f18 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleListParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleListParams.java @@ -142,7 +142,7 @@ public SubscriptionScheduleListParams build() { } /** Only return subscription schedules that were created canceled the given date interval. */ - public Builder setCanceledAt(CanceledAt canceledAt) { + public Builder setCanceledAt(SubscriptionScheduleListParams.CanceledAt canceledAt) { this.canceledAt = canceledAt; return this; } @@ -154,7 +154,7 @@ public Builder setCanceledAt(Long canceledAt) { } /** Only return subscription schedules that completed during the given date interval. */ - public Builder setCompletedAt(CompletedAt completedAt) { + public Builder setCompletedAt(SubscriptionScheduleListParams.CompletedAt completedAt) { this.completedAt = completedAt; return this; } @@ -166,7 +166,7 @@ public Builder setCompletedAt(Long completedAt) { } /** Only return subscription schedules that were created during the given date interval. */ - public Builder setCreated(Created created) { + public Builder setCreated(SubscriptionScheduleListParams.Created created) { this.created = created; return this; } @@ -256,7 +256,7 @@ public Builder setLimit(Long limit) { } /** Only return subscription schedules that were released during the given date interval. */ - public Builder setReleasedAt(ReleasedAt releasedAt) { + public Builder setReleasedAt(SubscriptionScheduleListParams.ReleasedAt releasedAt) { this.releasedAt = releasedAt; return this; } @@ -336,8 +336,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public CanceledAt build() { - return new CanceledAt(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public SubscriptionScheduleListParams.CanceledAt build() { + return new SubscriptionScheduleListParams.CanceledAt( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -444,8 +445,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public CompletedAt build() { - return new CompletedAt(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public SubscriptionScheduleListParams.CompletedAt build() { + return new SubscriptionScheduleListParams.CompletedAt( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -552,8 +554,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public SubscriptionScheduleListParams.Created build() { + return new SubscriptionScheduleListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -659,8 +662,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public ReleasedAt build() { - return new ReleasedAt(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public SubscriptionScheduleListParams.ReleasedAt build() { + return new SubscriptionScheduleListParams.ReleasedAt( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java index 8f598340f24..117a0d1f03c 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java @@ -55,7 +55,7 @@ public class SubscriptionScheduleUpdateParams extends ApiRequestParams { * be omitted. */ @SerializedName("phases") - List phases; + List phases; /** * If the update changes the current phase, indicates whether the changes should be prorated. The @@ -70,7 +70,7 @@ private SubscriptionScheduleUpdateParams( List expand, Map extraParams, Object metadata, - List phases, + List phases, ProrationBehavior prorationBehavior) { this.defaultSettings = defaultSettings; this.endBehavior = endBehavior; @@ -96,7 +96,7 @@ public static class Builder { private Object metadata; - private List phases; + private List phases; private ProrationBehavior prorationBehavior; @@ -113,7 +113,8 @@ public SubscriptionScheduleUpdateParams build() { } /** Object representing the subscription schedule's default settings. */ - public Builder setDefaultSettings(DefaultSettings defaultSettings) { + public Builder setDefaultSettings( + SubscriptionScheduleUpdateParams.DefaultSettings defaultSettings) { this.defaultSettings = defaultSettings; return this; } @@ -124,7 +125,7 @@ public Builder setDefaultSettings(DefaultSettings defaultSettings) { * the subscription schedule and keep the underlying subscription running.{@code cancel} will * end the subscription schedule and cancel the underlying subscription. */ - public Builder setEndBehavior(EndBehavior endBehavior) { + public Builder setEndBehavior(SubscriptionScheduleUpdateParams.EndBehavior endBehavior) { this.endBehavior = endBehavior; return this; } @@ -236,7 +237,7 @@ public Builder setMetadata(Map metadata) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleUpdateParams#phases} for the field documentation. */ - public Builder addPhase(Phase element) { + public Builder addPhase(SubscriptionScheduleUpdateParams.Phase element) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -249,7 +250,7 @@ public Builder addPhase(Phase element) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleUpdateParams#phases} for the field documentation. */ - public Builder addAllPhase(List elements) { + public Builder addAllPhase(List elements) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -261,7 +262,8 @@ public Builder addAllPhase(List elements) { * If the update changes the current phase, indicates whether the changes should be prorated. * The default value is {@code create_prorations}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionScheduleUpdateParams.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -394,8 +396,8 @@ public static class Builder { private Object transferData; /** Finalize and obtain parameter instance from this builder. */ - public DefaultSettings build() { - return new DefaultSettings( + public SubscriptionScheduleUpdateParams.DefaultSettings build() { + return new SubscriptionScheduleUpdateParams.DefaultSettings( this.applicationFeePercent, this.automaticTax, this.billingCycleAnchor, @@ -422,7 +424,8 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { } /** Default settings for automatic tax computation. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax( + SubscriptionScheduleUpdateParams.DefaultSettings.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -433,7 +436,8 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * this phase specifies a trial. For more information, see the billing cycle documentation. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + SubscriptionScheduleUpdateParams.DefaultSettings.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -442,7 +446,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleUpdateParams.DefaultSettings.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -463,7 +468,8 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * email your customer an invoice with payment instructions. Defaults to {@code * charge_automatically} on creation. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod( + SubscriptionScheduleUpdateParams.DefaultSettings.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -534,7 +540,8 @@ public Builder putAllExtraParam(Map map) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings( + SubscriptionScheduleUpdateParams.DefaultSettings.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -543,7 +550,8 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * The data with which to automatically create a Transfer for each of the associated * subscription's invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + SubscriptionScheduleUpdateParams.DefaultSettings.TransferData transferData) { this.transferData = transferData; return this; } @@ -591,8 +599,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionScheduleUpdateParams.DefaultSettings.AutomaticTax build() { + return new SubscriptionScheduleUpdateParams.DefaultSettings.AutomaticTax( + this.enabled, this.extraParams); } /** @@ -678,8 +687,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionScheduleUpdateParams.DefaultSettings.BillingThresholds build() { + return new SubscriptionScheduleUpdateParams.DefaultSettings.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -765,8 +774,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public SubscriptionScheduleUpdateParams.DefaultSettings.InvoiceSettings build() { + return new SubscriptionScheduleUpdateParams.DefaultSettings.InvoiceSettings( + this.daysUntilDue, this.extraParams); } /** @@ -853,8 +863,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionScheduleUpdateParams.DefaultSettings.TransferData build() { + return new SubscriptionScheduleUpdateParams.DefaultSettings.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** @@ -950,7 +961,7 @@ public static class Phase { * for this phase. You may pass up to 20 items. */ @SerializedName("add_invoice_items") - List addInvoiceItems; + List addInvoiceItems; /** * A non-negative decimal between 0 and 100, with at most two decimal places. This represents @@ -1056,7 +1067,7 @@ public static class Phase { * subscription schedule. */ @SerializedName("items") - List items; + List items; /** * Integer representing the multiplier applied to the price interval. For example, {@code @@ -1116,7 +1127,7 @@ public static class Phase { Object trialEnd; private Phase( - List addInvoiceItems, + List addInvoiceItems, BigDecimal applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, @@ -1130,7 +1141,7 @@ private Phase( Object endDate, Map extraParams, InvoiceSettings invoiceSettings, - List items, + List items, Long iterations, Map metadata, ProrationBehavior prorationBehavior, @@ -1167,7 +1178,7 @@ public static Builder builder() { } public static class Builder { - private List addInvoiceItems; + private List addInvoiceItems; private BigDecimal applicationFeePercent; @@ -1195,7 +1206,7 @@ public static class Builder { private InvoiceSettings invoiceSettings; - private List items; + private List items; private Long iterations; @@ -1212,8 +1223,8 @@ public static class Builder { private Object trialEnd; /** Finalize and obtain parameter instance from this builder. */ - public Phase build() { - return new Phase( + public SubscriptionScheduleUpdateParams.Phase build() { + return new SubscriptionScheduleUpdateParams.Phase( this.addInvoiceItems, this.applicationFeePercent, this.automaticTax, @@ -1243,7 +1254,8 @@ public Phase build() { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleUpdateParams.Phase#addInvoiceItems} for the field documentation. */ - public Builder addAddInvoiceItem(AddInvoiceItem element) { + public Builder addAddInvoiceItem( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem element) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -1256,7 +1268,8 @@ public Builder addAddInvoiceItem(AddInvoiceItem element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link SubscriptionScheduleUpdateParams.Phase#addInvoiceItems} for the field documentation. */ - public Builder addAllAddInvoiceItem(List elements) { + public Builder addAllAddInvoiceItem( + List elements) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -1278,7 +1291,8 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { } /** Automatic tax settings for this phase. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax( + SubscriptionScheduleUpdateParams.Phase.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -1289,7 +1303,8 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * this phase specifies a trial. For more information, see the billing cycle documentation. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + SubscriptionScheduleUpdateParams.Phase.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -1298,7 +1313,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleUpdateParams.Phase.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -1319,7 +1335,8 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * email your customer an invoice with payment instructions. Defaults to {@code * charge_automatically} on creation. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod( + SubscriptionScheduleUpdateParams.Phase.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -1461,7 +1478,7 @@ public Builder setEndDate(Long endDate) { * The date at which this phase of the subscription schedule ends. If set, {@code iterations} * must not be set. */ - public Builder setEndDate(EndDate endDate) { + public Builder setEndDate(SubscriptionScheduleUpdateParams.Phase.EndDate endDate) { this.endDate = endDate; return this; } @@ -1493,7 +1510,8 @@ public Builder putAllExtraParam(Map map) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings( + SubscriptionScheduleUpdateParams.Phase.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -1503,7 +1521,7 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleUpdateParams.Phase#items} for the field documentation. */ - public Builder addItem(Item element) { + public Builder addItem(SubscriptionScheduleUpdateParams.Phase.Item element) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1516,7 +1534,7 @@ public Builder addItem(Item element) { * and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleUpdateParams.Phase#items} for the field documentation. */ - public Builder addAllItem(List elements) { + public Builder addAllItem(List elements) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1566,7 +1584,8 @@ public Builder putAllMetadata(Map map) { * href="https://stripe.com/docs/billing/subscriptions/prorations">prorations when * transitioning to this phase. The default value is {@code create_prorations}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionScheduleUpdateParams.Phase.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -1584,7 +1603,7 @@ public Builder setStartDate(Long startDate) { * The date at which this phase of the subscription schedule starts or {@code now}. Must be * set on the first phase. */ - public Builder setStartDate(StartDate startDate) { + public Builder setStartDate(SubscriptionScheduleUpdateParams.Phase.StartDate startDate) { this.startDate = startDate; return this; } @@ -1593,7 +1612,8 @@ public Builder setStartDate(StartDate startDate) { * The data with which to automatically create a Transfer for each of the associated * subscription's invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + SubscriptionScheduleUpdateParams.Phase.TransferData transferData) { this.transferData = transferData; return this; } @@ -1620,7 +1640,7 @@ public Builder setTrialEnd(Long trialEnd) { * Sets the phase to trialing from the start date to this date. Must be before the phase end * date, can not be combined with {@code trial} */ - public Builder setTrialEnd(TrialEnd trialEnd) { + public Builder setTrialEnd(SubscriptionScheduleUpdateParams.Phase.TrialEnd trialEnd) { this.trialEnd = trialEnd; return this; } @@ -1688,8 +1708,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public AddInvoiceItem build() { - return new AddInvoiceItem( + public SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem build() { + return new SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem( this.extraParams, this.price, this.priceData, this.quantity, this.taxRates); } @@ -1737,7 +1757,8 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1877,8 +1898,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.PriceData build() { + return new SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.PriceData( this.currency, this.extraParams, this.product, @@ -1954,7 +1975,9 @@ public Builder setProduct(EmptyParam product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as * either {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.PriceData.TaxBehavior + taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2042,8 +2065,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionScheduleUpdateParams.Phase.AutomaticTax build() { + return new SubscriptionScheduleUpdateParams.Phase.AutomaticTax( + this.enabled, this.extraParams); } /** @@ -2127,8 +2151,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionScheduleUpdateParams.Phase.BillingThresholds build() { + return new SubscriptionScheduleUpdateParams.Phase.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -2212,8 +2236,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public SubscriptionScheduleUpdateParams.Phase.InvoiceSettings build() { + return new SubscriptionScheduleUpdateParams.Phase.InvoiceSettings( + this.daysUntilDue, this.extraParams); } /** @@ -2346,8 +2371,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public Item build() { - return new Item( + public SubscriptionScheduleUpdateParams.Phase.Item build() { + return new SubscriptionScheduleUpdateParams.Phase.Item( this.billingThresholds, this.extraParams, this.plan, @@ -2362,7 +2387,8 @@ public Item build() { * new billing period. When updating, pass an empty string to remove previously-defined * thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleUpdateParams.Phase.Item.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -2439,7 +2465,8 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData( + SubscriptionScheduleUpdateParams.Phase.Item.PriceData priceData) { this.priceData = priceData; return this; } @@ -2537,8 +2564,9 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public SubscriptionScheduleUpdateParams.Phase.Item.BillingThresholds build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.BillingThresholds( + this.extraParams, this.usageGte); } /** @@ -2669,8 +2697,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionScheduleUpdateParams.Phase.Item.PriceData build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.PriceData( this.currency, this.extraParams, this.product, @@ -2744,7 +2772,8 @@ public Builder setProduct(EmptyParam product) { * The recurring components of a price such as {@code interval} and {@code * interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring( + SubscriptionScheduleUpdateParams.Phase.Item.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -2754,7 +2783,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as * either {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionScheduleUpdateParams.Phase.Item.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2835,8 +2865,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public SubscriptionScheduleUpdateParams.Phase.Item.PriceData.Recurring build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -2873,7 +2904,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or * {@code year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionScheduleUpdateParams.Phase.Item.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -2973,8 +3005,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionScheduleUpdateParams.Phase.TransferData build() { + return new SubscriptionScheduleUpdateParams.Phase.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index 3469405c580..de7619b95b4 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -18,7 +18,7 @@ public class SubscriptionUpdateParams extends ApiRequestParams { * for this subscription. You may pass up to 20 items. */ @SerializedName("add_invoice_items") - List addInvoiceItems; + List addInvoiceItems; /** * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the @@ -145,7 +145,7 @@ public class SubscriptionUpdateParams extends ApiRequestParams { /** A list of up to 20 subscription items, each with an attached price. */ @SerializedName("items") - List items; + List items; /** * Set of key-value pairs that you can attach @@ -262,7 +262,7 @@ public class SubscriptionUpdateParams extends ApiRequestParams { Boolean trialFromPlan; private SubscriptionUpdateParams( - List addInvoiceItems, + List addInvoiceItems, BigDecimal applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, @@ -278,7 +278,7 @@ private SubscriptionUpdateParams( Object description, List expand, Map extraParams, - List items, + List items, Object metadata, Boolean offSession, Object pauseCollection, @@ -327,7 +327,7 @@ public static Builder builder() { } public static class Builder { - private List addInvoiceItems; + private List addInvoiceItems; private BigDecimal applicationFeePercent; @@ -359,7 +359,7 @@ public static class Builder { private Map extraParams; - private List items; + private List items; private Object metadata; @@ -424,7 +424,7 @@ public SubscriptionUpdateParams build() { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionUpdateParams#addInvoiceItems} for the field documentation. */ - public Builder addAddInvoiceItem(AddInvoiceItem element) { + public Builder addAddInvoiceItem(SubscriptionUpdateParams.AddInvoiceItem element) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -437,7 +437,7 @@ public Builder addAddInvoiceItem(AddInvoiceItem element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionUpdateParams#addInvoiceItems} for the field documentation. */ - public Builder addAllAddInvoiceItem(List elements) { + public Builder addAllAddInvoiceItem(List elements) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -462,7 +462,7 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { * Automatic tax settings for this subscription. We recommend you only include this parameter * when the existing value is being changed. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(SubscriptionUpdateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -473,7 +473,8 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * the billing cycle documentation. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + SubscriptionUpdateParams.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -482,7 +483,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionUpdateParams.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -532,7 +534,7 @@ public Builder setCancelAtPeriodEnd(Boolean cancelAtPeriodEnd) { * attached to the customer. When sending an invoice, Stripe will email your customer an invoice * with payment instructions. Defaults to {@code charge_automatically}. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(SubscriptionUpdateParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -741,7 +743,7 @@ public Builder putAllExtraParam(Map map) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionUpdateParams#items} for the field documentation. */ - public Builder addItem(Item element) { + public Builder addItem(SubscriptionUpdateParams.Item element) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -754,7 +756,7 @@ public Builder addItem(Item element) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionUpdateParams#items} for the field documentation. */ - public Builder addAllItem(List elements) { + public Builder addAllItem(List elements) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -819,7 +821,7 @@ public Builder setOffSession(Boolean offSession) { } /** If specified, payment collection for this subscription will be paused. */ - public Builder setPauseCollection(PauseCollection pauseCollection) { + public Builder setPauseCollection(SubscriptionUpdateParams.PauseCollection pauseCollection) { this.pauseCollection = pauseCollection; return this; } @@ -858,13 +860,13 @@ public Builder setPauseCollection(EmptyParam pauseCollection) { * API versions prior to 2019-03-14. See the changelog to learn more. */ - public Builder setPaymentBehavior(PaymentBehavior paymentBehavior) { + public Builder setPaymentBehavior(SubscriptionUpdateParams.PaymentBehavior paymentBehavior) { this.paymentBehavior = paymentBehavior; return this; } /** Payment settings to pass to invoices created by the subscription. */ - public Builder setPaymentSettings(PaymentSettings paymentSettings) { + public Builder setPaymentSettings(SubscriptionUpdateParams.PaymentSettings paymentSettings) { this.paymentSettings = paymentSettings; return this; } @@ -875,7 +877,7 @@ public Builder setPaymentSettings(PaymentSettings paymentSettings) { * given subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval( - PendingInvoiceItemInterval pendingInvoiceItemInterval) { + SubscriptionUpdateParams.PendingInvoiceItemInterval pendingInvoiceItemInterval) { this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; return this; } @@ -914,7 +916,8 @@ public Builder setPromotionCode(EmptyParam promotionCode) { * billing cycle changes (e.g., when switching plans, resetting {@code * billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionUpdateParams.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -936,7 +939,7 @@ public Builder setProrationDate(Long prorationDate) { * destination and the ID of the resulting transfers will be found on the resulting charges. * This will be unset if you POST an empty value. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(SubscriptionUpdateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -958,7 +961,7 @@ public Builder setTransferData(EmptyParam transferData) { * customer is being subscribed to. The special value {@code now} can be provided to end the * customer's trial immediately. Can be at most two years from {@code billing_cycle_anchor}. */ - public Builder setTrialEnd(TrialEnd trialEnd) { + public Builder setTrialEnd(SubscriptionUpdateParams.TrialEnd trialEnd) { this.trialEnd = trialEnd; return this; } @@ -1050,8 +1053,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public AddInvoiceItem build() { - return new AddInvoiceItem( + public SubscriptionUpdateParams.AddInvoiceItem build() { + return new SubscriptionUpdateParams.AddInvoiceItem( this.extraParams, this.price, this.priceData, this.quantity, this.taxRates); } @@ -1098,7 +1101,7 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(SubscriptionUpdateParams.AddInvoiceItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1235,8 +1238,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionUpdateParams.AddInvoiceItem.PriceData build() { + return new SubscriptionUpdateParams.AddInvoiceItem.PriceData( this.currency, this.extraParams, this.product, @@ -1310,7 +1313,8 @@ public Builder setProduct(EmptyParam product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionUpdateParams.AddInvoiceItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -1398,8 +1402,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionUpdateParams.AutomaticTax build() { + return new SubscriptionUpdateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -1481,8 +1485,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionUpdateParams.BillingThresholds build() { + return new SubscriptionUpdateParams.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -1658,8 +1662,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public Item build() { - return new Item( + public SubscriptionUpdateParams.Item build() { + return new SubscriptionUpdateParams.Item( this.billingThresholds, this.clearUsage, this.deleted, @@ -1678,7 +1682,8 @@ public Item build() { * billing period. When updating, pass an empty string to remove previously-defined * thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionUpdateParams.Item.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -1830,7 +1835,7 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(SubscriptionUpdateParams.Item.PriceData priceData) { this.priceData = priceData; return this; } @@ -1924,8 +1929,9 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public SubscriptionUpdateParams.Item.BillingThresholds build() { + return new SubscriptionUpdateParams.Item.BillingThresholds( + this.extraParams, this.usageGte); } /** @@ -2053,8 +2059,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionUpdateParams.Item.PriceData build() { + return new SubscriptionUpdateParams.Item.PriceData( this.currency, this.extraParams, this.product, @@ -2127,7 +2133,7 @@ public Builder setProduct(EmptyParam product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(SubscriptionUpdateParams.Item.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -2137,7 +2143,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionUpdateParams.Item.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2217,8 +2224,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public SubscriptionUpdateParams.Item.PriceData.Recurring build() { + return new SubscriptionUpdateParams.Item.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -2253,7 +2261,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionUpdateParams.Item.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -2351,15 +2360,16 @@ public static class Builder { private Long resumesAt; /** Finalize and obtain parameter instance from this builder. */ - public PauseCollection build() { - return new PauseCollection(this.behavior, this.extraParams, this.resumesAt); + public SubscriptionUpdateParams.PauseCollection build() { + return new SubscriptionUpdateParams.PauseCollection( + this.behavior, this.extraParams, this.resumesAt); } /** * The payment collection behavior for this subscription while paused. One of {@code * keep_as_draft}, {@code mark_uncollectible}, or {@code void}. */ - public Builder setBehavior(Behavior behavior) { + public Builder setBehavior(SubscriptionUpdateParams.PauseCollection.Behavior behavior) { this.behavior = behavior; return this; } @@ -2474,8 +2484,8 @@ public static class Builder { private SaveDefaultPaymentMethod saveDefaultPaymentMethod; /** Finalize and obtain parameter instance from this builder. */ - public PaymentSettings build() { - return new PaymentSettings( + public SubscriptionUpdateParams.PaymentSettings build() { + return new SubscriptionUpdateParams.PaymentSettings( this.extraParams, this.paymentMethodOptions, this.paymentMethodTypes, @@ -2512,7 +2522,8 @@ public Builder putAllExtraParam(Map map) { /** * Payment-method-specific configuration to provide to invoices created by the subscription. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -2524,7 +2535,8 @@ public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions * documentation. */ @SuppressWarnings("unchecked") - public Builder addPaymentMethodType(PaymentMethodType element) { + public Builder addPaymentMethodType( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodType element) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -2541,7 +2553,8 @@ public Builder addPaymentMethodType(PaymentMethodType element) { * documentation. */ @SuppressWarnings("unchecked") - public Builder addAllPaymentMethodType(List elements) { + public Builder addAllPaymentMethodType( + List elements) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -2570,7 +2583,8 @@ public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) { * default payment method, and your invoice template settings. */ - public Builder setPaymentMethodTypes(List paymentMethodTypes) { + public Builder setPaymentMethodTypes( + List paymentMethodTypes) { this.paymentMethodTypes = paymentMethodTypes; return this; } @@ -2580,7 +2594,8 @@ public Builder setPaymentMethodTypes(List paymentMethodTypes) * {@code subscription.default_payment_method} when a subscription payment succeeds. */ public Builder setSaveDefaultPaymentMethod( - SaveDefaultPaymentMethod saveDefaultPaymentMethod) { + SubscriptionUpdateParams.PaymentSettings.SaveDefaultPaymentMethod + saveDefaultPaymentMethod) { this.saveDefaultPaymentMethod = saveDefaultPaymentMethod; return this; } @@ -2676,8 +2691,8 @@ public static class Builder { private Object usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions( this.acssDebit, this.bancontact, this.card, @@ -2691,7 +2706,8 @@ public PaymentMethodOptions build() { * This sub-hash contains details about the Canadian pre-authorized debit payment method * options to pass to the invoice’s PaymentIntent. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -2709,7 +2725,8 @@ public Builder setAcssDebit(EmptyParam acssDebit) { * This sub-hash contains details about the Bancontact payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -2727,7 +2744,8 @@ public Builder setBancontact(EmptyParam bancontact) { * This sub-hash contains details about the Card payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setCard(Card card) { + public Builder setCard( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -2745,7 +2763,9 @@ public Builder setCard(EmptyParam card) { * This sub-hash contains details about the Bank transfer payment method options to pass to * the invoice’s PaymentIntent. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + customerBalance) { this.customerBalance = customerBalance; return this; } @@ -2793,7 +2813,8 @@ public Builder putAllExtraParam(Map map) { * This sub-hash contains details about the Konbini payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini konbini) { this.konbini = konbini; return this; } @@ -2811,7 +2832,9 @@ public Builder setKonbini(EmptyParam konbini) { * This sub-hash contains details about the ACH direct debit payment method options to pass * to the invoice’s PaymentIntent. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -2867,8 +2890,9 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit(this.extraParams, this.mandateOptions, this.verificationMethod); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit( + this.extraParams, this.mandateOptions, this.verificationMethod); } /** @@ -2902,13 +2926,18 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -2945,8 +2974,11 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams, this.transactionType); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions(this.extraParams, this.transactionType); } /** @@ -2980,7 +3012,10 @@ public Builder putAllExtraParam(Map map) { } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions.TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -3055,8 +3090,9 @@ public static class Builder { private PreferredLanguage preferredLanguage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams, this.preferredLanguage); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact( + this.extraParams, this.preferredLanguage); } /** @@ -3093,7 +3129,10 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Bancontact authorization page that the customer is redirected * to. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact + .PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -3182,8 +3221,8 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card( this.extraParams, this.mandateOptions, this.network, this.requestThreeDSecure); } @@ -3218,7 +3257,9 @@ public Builder putAllExtraParam(Map map) { } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -3227,7 +3268,8 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * Selected network to process this Subscription on. Depends on the available networks of * the card attached to the Subscription. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -3242,7 +3284,9 @@ public Builder setNetwork(Network network) { * 3D Secure for more information on how this configuration interacts with Radar and * our SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -3304,9 +3348,10 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( - this.amount, this.amountType, this.description, this.extraParams); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card + .MandateOptions(this.amount, this.amountType, this.description, this.extraParams); } /** Amount to be charged for future payments. */ @@ -3320,7 +3365,10 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + .AmountType + amountType) { this.amountType = amountType; return this; } @@ -3490,15 +3538,20 @@ public static class Builder { private Object fundingType; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.bankTransfer, this.extraParams, this.fundingType); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance(this.bankTransfer, this.extraParams, this.fundingType); } /** * Configuration for the bank transfer funding type, if the {@code funding_type} is set to * {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer + bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -3595,12 +3648,18 @@ public static class Builder { private Object type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer(this.euBankTransfer, this.extraParams, this.type); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance.BankTransfer(this.euBankTransfer, this.extraParams, this.type); } /** Configuration for eu_bank_transfer funding type. */ - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -3690,8 +3749,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance.BankTransfer.EuBankTransfer(this.country, this.extraParams); } /** @@ -3770,8 +3832,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini( + this.extraParams); } /** @@ -3847,8 +3910,9 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.verificationMethod); } @@ -3883,13 +3947,19 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -3913,10 +3983,17 @@ public static class FinancialConnections { * balances}, {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; private FinancialConnections( - Map extraParams, List permissions) { + Map extraParams, + List< + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions) { this.extraParams = extraParams; this.permissions = permissions; } @@ -3928,11 +4005,17 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions); } /** @@ -3972,7 +4055,10 @@ public Builder putAllExtraParam(Map map) { * SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -3987,7 +4073,11 @@ public Builder addPermission(Permission element) { * SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -4174,8 +4264,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public PendingInvoiceItemInterval build() { - return new PendingInvoiceItemInterval(this.extraParams, this.interval, this.intervalCount); + public SubscriptionUpdateParams.PendingInvoiceItemInterval build() { + return new SubscriptionUpdateParams.PendingInvoiceItemInterval( + this.extraParams, this.interval, this.intervalCount); } /** @@ -4210,7 +4301,8 @@ public Builder putAllExtraParam(Map map) { * Specifies invoicing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionUpdateParams.PendingInvoiceItemInterval.Interval interval) { this.interval = interval; return this; } @@ -4290,8 +4382,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionUpdateParams.TransferData build() { + return new SubscriptionUpdateParams.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java index 03cf0577faa..60c6c77004a 100644 --- a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java @@ -131,7 +131,7 @@ public Builder putAllExtraParam(Map map) { * {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code th_vat}, {@code * tw_vat}, {@code ua_vat}, {@code us_ein}, or {@code za_vat}. */ - public Builder setType(Type type) { + public Builder setType(TaxIdCollectionCreateParams.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/TaxRateCreateParams.java b/src/main/java/com/stripe/param/TaxRateCreateParams.java index 71426ce6d75..0df25403157 100644 --- a/src/main/java/com/stripe/param/TaxRateCreateParams.java +++ b/src/main/java/com/stripe/param/TaxRateCreateParams.java @@ -302,7 +302,7 @@ public Builder setState(String state) { } /** The high-level tax type, such as {@code vat} or {@code sales_tax}. */ - public Builder setTaxType(TaxType taxType) { + public Builder setTaxType(TaxRateCreateParams.TaxType taxType) { this.taxType = taxType; return this; } diff --git a/src/main/java/com/stripe/param/TaxRateListParams.java b/src/main/java/com/stripe/param/TaxRateListParams.java index 275931ba7c3..3bb1538942c 100644 --- a/src/main/java/com/stripe/param/TaxRateListParams.java +++ b/src/main/java/com/stripe/param/TaxRateListParams.java @@ -121,7 +121,7 @@ public Builder setActive(Boolean active) { } /** Optional range for filtering created date. */ - public Builder setCreated(Created created) { + public Builder setCreated(TaxRateListParams.Created created) { this.created = created; return this; } @@ -275,8 +275,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public TaxRateListParams.Created build() { + return new TaxRateListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/TaxRateUpdateParams.java b/src/main/java/com/stripe/param/TaxRateUpdateParams.java index 120154f2071..30372d9adcb 100644 --- a/src/main/java/com/stripe/param/TaxRateUpdateParams.java +++ b/src/main/java/com/stripe/param/TaxRateUpdateParams.java @@ -338,7 +338,7 @@ public Builder setState(EmptyParam state) { } /** The high-level tax type, such as {@code vat} or {@code sales_tax}. */ - public Builder setTaxType(TaxType taxType) { + public Builder setTaxType(TaxRateUpdateParams.TaxType taxType) { this.taxType = taxType; return this; } diff --git a/src/main/java/com/stripe/param/TokenCreateParams.java b/src/main/java/com/stripe/param/TokenCreateParams.java index f830288a695..ffe94f8caf1 100644 --- a/src/main/java/com/stripe/param/TokenCreateParams.java +++ b/src/main/java/com/stripe/param/TokenCreateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; import java.util.ArrayList; @@ -119,18 +118,18 @@ public TokenCreateParams build() { } /** Information for the account this token will represent. */ - public Builder setAccount(Account account) { + public Builder setAccount(TokenCreateParams.Account account) { this.account = account; return this; } /** The bank account this token will represent. */ - public Builder setBankAccount(BankAccount bankAccount) { + public Builder setBankAccount(TokenCreateParams.BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - public Builder setCard(Card card) { + public Builder setCard(TokenCreateParams.Card card) { this.card = card; return this; } @@ -154,7 +153,7 @@ public Builder setCustomer(String customer) { } /** The updated CVC value this token will represent. */ - public Builder setCvcUpdate(CvcUpdate cvcUpdate) { + public Builder setCvcUpdate(TokenCreateParams.CvcUpdate cvcUpdate) { this.cvcUpdate = cvcUpdate; return this; } @@ -212,13 +211,13 @@ public Builder putAllExtraParam(Map map) { } /** Information for the person this token will represent. */ - public Builder setPerson(Person person) { + public Builder setPerson(TokenCreateParams.Person person) { this.person = person; return this; } /** The PII this token will represent. */ - public Builder setPii(Pii pii) { + public Builder setPii(TokenCreateParams.Pii pii) { this.pii = pii; return this; } @@ -285,8 +284,8 @@ public static class Builder { private Boolean tosShownAndAccepted; /** Finalize and obtain parameter instance from this builder. */ - public Account build() { - return new Account( + public TokenCreateParams.Account build() { + return new TokenCreateParams.Account( this.businessType, this.company, this.extraParams, @@ -295,13 +294,13 @@ public Account build() { } /** The business type. */ - public Builder setBusinessType(BusinessType businessType) { + public Builder setBusinessType(TokenCreateParams.Account.BusinessType businessType) { this.businessType = businessType; return this; } /** Information about the company or business. */ - public Builder setCompany(Company company) { + public Builder setCompany(TokenCreateParams.Account.Company company) { this.company = company; return this; } @@ -333,7 +332,7 @@ public Builder putAllExtraParam(Map map) { } /** Information about the person represented by the account. */ - public Builder setIndividual(Individual individual) { + public Builder setIndividual(TokenCreateParams.Account.Individual individual) { this.individual = individual; return this; } @@ -445,7 +444,7 @@ public static class Company { * structure for more details. */ @SerializedName("structure") - EnumParam structure; + ApiRequestParams.EnumParam structure; /** * The business ID number of the company, as appropriate for the company’s country. (Examples @@ -484,7 +483,7 @@ private Company( Boolean ownershipDeclarationShownAndSigned, String phone, String registrationNumber, - EnumParam structure, + ApiRequestParams.EnumParam structure, String taxId, String taxIdRegistrar, String vatId, @@ -543,7 +542,7 @@ public static class Builder { private String registrationNumber; - private EnumParam structure; + private ApiRequestParams.EnumParam structure; private String taxId; @@ -554,8 +553,8 @@ public static class Builder { private Verification verification; /** Finalize and obtain parameter instance from this builder. */ - public Company build() { - return new Company( + public TokenCreateParams.Account.Company build() { + return new TokenCreateParams.Account.Company( this.address, this.addressKana, this.addressKanji, @@ -578,19 +577,20 @@ public Company build() { } /** The company's primary address. */ - public Builder setAddress(Address address) { + public Builder setAddress(TokenCreateParams.Account.Company.Address address) { this.address = address; return this; } /** The Kana variation of the company's primary address (Japan only). */ - public Builder setAddressKana(AddressKana addressKana) { + public Builder setAddressKana(TokenCreateParams.Account.Company.AddressKana addressKana) { this.addressKana = addressKana; return this; } /** The Kanji variation of the company's primary address (Japan only). */ - public Builder setAddressKanji(AddressKanji addressKanji) { + public Builder setAddressKanji( + TokenCreateParams.Account.Company.AddressKanji addressKanji) { this.addressKanji = addressKanji; return this; } @@ -679,7 +679,8 @@ public Builder setOwnersProvided(Boolean ownersProvided) { * This hash is used to attest that the beneficial owner information provided to Stripe is * both current and correct. */ - public Builder setOwnershipDeclaration(OwnershipDeclaration ownershipDeclaration) { + public Builder setOwnershipDeclaration( + TokenCreateParams.Account.Company.OwnershipDeclaration ownershipDeclaration) { this.ownershipDeclaration = ownershipDeclaration; return this; } @@ -716,7 +717,7 @@ public Builder setRegistrationNumber(String registrationNumber) { * href="https://stripe.com/docs/connect/identity-verification#business-structure">Business * structure for more details. */ - public Builder setStructure(Structure structure) { + public Builder setStructure(TokenCreateParams.Account.Company.Structure structure) { this.structure = structure; return this; } @@ -757,7 +758,8 @@ public Builder setVatId(String vatId) { } /** Information on the verification state of the company. */ - public Builder setVerification(Verification verification) { + public Builder setVerification( + TokenCreateParams.Account.Company.Verification verification) { this.verification = verification; return this; } @@ -839,8 +841,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public TokenCreateParams.Account.Company.Address build() { + return new TokenCreateParams.Account.Company.Address( this.city, this.country, this.extraParams, @@ -1003,8 +1005,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKana build() { - return new AddressKana( + public TokenCreateParams.Account.Company.AddressKana build() { + return new TokenCreateParams.Account.Company.AddressKana( this.city, this.country, this.extraParams, @@ -1174,8 +1176,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKanji build() { - return new AddressKanji( + public TokenCreateParams.Account.Company.AddressKanji build() { + return new TokenCreateParams.Account.Company.AddressKanji( this.city, this.country, this.extraParams, @@ -1307,8 +1309,9 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public OwnershipDeclaration build() { - return new OwnershipDeclaration(this.date, this.extraParams, this.ip, this.userAgent); + public TokenCreateParams.Account.Company.OwnershipDeclaration build() { + return new TokenCreateParams.Account.Company.OwnershipDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); } /** The Unix timestamp marking when the beneficial owner attestation was made. */ @@ -1390,12 +1393,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Verification build() { - return new Verification(this.document, this.extraParams); + public TokenCreateParams.Account.Company.Verification build() { + return new TokenCreateParams.Account.Company.Verification( + this.document, this.extraParams); } /** A document verifying the business. */ - public Builder setDocument(Document document) { + public Builder setDocument( + TokenCreateParams.Account.Company.Verification.Document document) { this.document = document; return this; } @@ -1479,8 +1484,9 @@ public static class Builder { private String front; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document(this.back, this.extraParams, this.front); + public TokenCreateParams.Account.Company.Verification.Document build() { + return new TokenCreateParams.Account.Company.Verification.Document( + this.back, this.extraParams, this.front); } /** @@ -1835,8 +1841,8 @@ public static class Builder { private Verification verification; /** Finalize and obtain parameter instance from this builder. */ - public Individual build() { - return new Individual( + public TokenCreateParams.Account.Individual build() { + return new TokenCreateParams.Account.Individual( this.address, this.addressKana, this.addressKanji, @@ -1863,25 +1869,27 @@ public Individual build() { } /** The individual's primary address. */ - public Builder setAddress(Address address) { + public Builder setAddress(TokenCreateParams.Account.Individual.Address address) { this.address = address; return this; } /** The Kana variation of the the individual's primary address (Japan only). */ - public Builder setAddressKana(AddressKana addressKana) { + public Builder setAddressKana( + TokenCreateParams.Account.Individual.AddressKana addressKana) { this.addressKana = addressKana; return this; } /** The Kanji variation of the the individual's primary address (Japan only). */ - public Builder setAddressKanji(AddressKanji addressKanji) { + public Builder setAddressKanji( + TokenCreateParams.Account.Individual.AddressKanji addressKanji) { this.addressKanji = addressKanji; return this; } /** The individual's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(TokenCreateParams.Account.Individual.Dob dob) { this.dob = dob; return this; } @@ -2106,13 +2114,15 @@ public Builder setPhone(String phone) { * related persons, declares that they hold or have held an important public job or * function, in any jurisdiction. */ - public Builder setPoliticalExposure(PoliticalExposure politicalExposure) { + public Builder setPoliticalExposure( + TokenCreateParams.Account.Individual.PoliticalExposure politicalExposure) { this.politicalExposure = politicalExposure; return this; } /** The individual's registered address. */ - public Builder setRegisteredAddress(RegisteredAddress registeredAddress) { + public Builder setRegisteredAddress( + TokenCreateParams.Account.Individual.RegisteredAddress registeredAddress) { this.registeredAddress = registeredAddress; return this; } @@ -2124,7 +2134,8 @@ public Builder setSsnLast4(String ssnLast4) { } /** The individual's verification document information. */ - public Builder setVerification(Verification verification) { + public Builder setVerification( + TokenCreateParams.Account.Individual.Verification verification) { this.verification = verification; return this; } @@ -2206,8 +2217,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public TokenCreateParams.Account.Individual.Address build() { + return new TokenCreateParams.Account.Individual.Address( this.city, this.country, this.extraParams, @@ -2370,8 +2381,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKana build() { - return new AddressKana( + public TokenCreateParams.Account.Individual.AddressKana build() { + return new TokenCreateParams.Account.Individual.AddressKana( this.city, this.country, this.extraParams, @@ -2541,8 +2552,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKanji build() { - return new AddressKanji( + public TokenCreateParams.Account.Individual.AddressKanji build() { + return new TokenCreateParams.Account.Individual.AddressKanji( this.city, this.country, this.extraParams, @@ -2673,8 +2684,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public TokenCreateParams.Account.Individual.Dob build() { + return new TokenCreateParams.Account.Individual.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -2801,8 +2813,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public RegisteredAddress build() { - return new RegisteredAddress( + public TokenCreateParams.Account.Individual.RegisteredAddress build() { + return new TokenCreateParams.Account.Individual.RegisteredAddress( this.city, this.country, this.extraParams, @@ -2925,21 +2937,25 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Verification build() { - return new Verification(this.additionalDocument, this.document, this.extraParams); + public TokenCreateParams.Account.Individual.Verification build() { + return new TokenCreateParams.Account.Individual.Verification( + this.additionalDocument, this.document, this.extraParams); } /** * A document showing address, either a passport, local ID card, or utility bill from a * well-known utility company. */ - public Builder setAdditionalDocument(AdditionalDocument additionalDocument) { + public Builder setAdditionalDocument( + TokenCreateParams.Account.Individual.Verification.AdditionalDocument + additionalDocument) { this.additionalDocument = additionalDocument; return this; } /** An identifying document, either a passport or local ID card. */ - public Builder setDocument(Document document) { + public Builder setDocument( + TokenCreateParams.Account.Individual.Verification.Document document) { this.document = document; return this; } @@ -3021,8 +3037,9 @@ public static class Builder { private String front; /** Finalize and obtain parameter instance from this builder. */ - public AdditionalDocument build() { - return new AdditionalDocument(this.back, this.extraParams, this.front); + public TokenCreateParams.Account.Individual.Verification.AdditionalDocument build() { + return new TokenCreateParams.Account.Individual.Verification.AdditionalDocument( + this.back, this.extraParams, this.front); } /** @@ -3129,8 +3146,9 @@ public static class Builder { private String front; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document(this.back, this.extraParams, this.front); + public TokenCreateParams.Account.Individual.Verification.Document build() { + return new TokenCreateParams.Account.Individual.Verification.Document( + this.back, this.extraParams, this.front); } /** @@ -3325,8 +3343,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public BankAccount build() { - return new BankAccount( + public TokenCreateParams.BankAccount build() { + return new TokenCreateParams.BankAccount( this.accountHolderName, this.accountHolderType, this.accountNumber, @@ -3350,7 +3368,8 @@ public Builder setAccountHolderName(String accountHolderName) { * The type of entity that holds the account. It can be {@code company} or {@code individual}. * This field is required when attaching the bank account to a {@code Customer} object. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + TokenCreateParams.BankAccount.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -3365,7 +3384,7 @@ public Builder setAccountNumber(String accountNumber) { * The bank account type. This can only be {@code checking} or {@code savings} in most * countries. In Japan, this can only be {@code futsu} or {@code toza}. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType(TokenCreateParams.BankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -3568,8 +3587,8 @@ public static class Builder { private String number; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public TokenCreateParams.Card build() { + return new TokenCreateParams.Card( this.addressCity, this.addressCountry, this.addressLine1, @@ -3703,8 +3722,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CvcUpdate build() { - return new CvcUpdate(this.cvc, this.extraParams); + public TokenCreateParams.CvcUpdate build() { + return new TokenCreateParams.CvcUpdate(this.cvc, this.extraParams); } /** The CVC value, in string form. */ @@ -3993,8 +4012,8 @@ public static class Builder { private Verification verification; /** Finalize and obtain parameter instance from this builder. */ - public Person build() { - return new Person( + public TokenCreateParams.Person build() { + return new TokenCreateParams.Person( this.address, this.addressKana, this.addressKanji, @@ -4024,25 +4043,25 @@ public Person build() { } /** The person's address. */ - public Builder setAddress(Address address) { + public Builder setAddress(TokenCreateParams.Person.Address address) { this.address = address; return this; } /** The Kana variation of the person's address (Japan only). */ - public Builder setAddressKana(AddressKana addressKana) { + public Builder setAddressKana(TokenCreateParams.Person.AddressKana addressKana) { this.addressKana = addressKana; return this; } /** The Kanji variation of the person's address (Japan only). */ - public Builder setAddressKanji(AddressKanji addressKanji) { + public Builder setAddressKanji(TokenCreateParams.Person.AddressKanji addressKanji) { this.addressKanji = addressKanji; return this; } /** The person's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(TokenCreateParams.Person.Dob dob) { this.dob = dob; return this; } @@ -4054,7 +4073,7 @@ public Builder setDob(EmptyParam dob) { } /** Documents that may be submitted to satisfy various informational requests. */ - public Builder setDocuments(Documents documents) { + public Builder setDocuments(TokenCreateParams.Person.Documents documents) { this.documents = documents; return this; } @@ -4283,13 +4302,14 @@ public Builder setPoliticalExposure(String politicalExposure) { } /** The person's registered address. */ - public Builder setRegisteredAddress(RegisteredAddress registeredAddress) { + public Builder setRegisteredAddress( + TokenCreateParams.Person.RegisteredAddress registeredAddress) { this.registeredAddress = registeredAddress; return this; } /** The relationship that this person has with the account's legal entity. */ - public Builder setRelationship(Relationship relationship) { + public Builder setRelationship(TokenCreateParams.Person.Relationship relationship) { this.relationship = relationship; return this; } @@ -4301,7 +4321,7 @@ public Builder setSsnLast4(String ssnLast4) { } /** The person's verification status. */ - public Builder setVerification(Verification verification) { + public Builder setVerification(TokenCreateParams.Person.Verification verification) { this.verification = verification; return this; } @@ -4382,8 +4402,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public TokenCreateParams.Person.Address build() { + return new TokenCreateParams.Person.Address( this.city, this.country, this.extraParams, @@ -4545,8 +4565,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKana build() { - return new AddressKana( + public TokenCreateParams.Person.AddressKana build() { + return new TokenCreateParams.Person.AddressKana( this.city, this.country, this.extraParams, @@ -4715,8 +4735,8 @@ public static class Builder { private String town; /** Finalize and obtain parameter instance from this builder. */ - public AddressKanji build() { - return new AddressKanji( + public TokenCreateParams.Person.AddressKanji build() { + return new TokenCreateParams.Person.AddressKanji( this.city, this.country, this.extraParams, @@ -4846,8 +4866,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public TokenCreateParams.Person.Dob build() { + return new TokenCreateParams.Person.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -4950,8 +4971,8 @@ public static class Builder { private Visa visa; /** Finalize and obtain parameter instance from this builder. */ - public Documents build() { - return new Documents( + public TokenCreateParams.Person.Documents build() { + return new TokenCreateParams.Person.Documents( this.companyAuthorization, this.extraParams, this.passport, this.visa); } @@ -4959,7 +4980,8 @@ public Documents build() { * One or more documents that demonstrate proof that this person is authorized to represent * the company. */ - public Builder setCompanyAuthorization(CompanyAuthorization companyAuthorization) { + public Builder setCompanyAuthorization( + TokenCreateParams.Person.Documents.CompanyAuthorization companyAuthorization) { this.companyAuthorization = companyAuthorization; return this; } @@ -4995,7 +5017,7 @@ public Builder putAllExtraParam(Map map) { /** * One or more documents showing the person's passport page with photo and personal data. */ - public Builder setPassport(Passport passport) { + public Builder setPassport(TokenCreateParams.Person.Documents.Passport passport) { this.passport = passport; return this; } @@ -5004,7 +5026,7 @@ public Builder setPassport(Passport passport) { * One or more documents showing the person's visa required for living in the country where * they are residing. */ - public Builder setVisa(Visa visa) { + public Builder setVisa(TokenCreateParams.Person.Documents.Visa visa) { this.visa = visa; return this; } @@ -5045,8 +5067,9 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public CompanyAuthorization build() { - return new CompanyAuthorization(this.extraParams, this.files); + public TokenCreateParams.Person.Documents.CompanyAuthorization build() { + return new TokenCreateParams.Person.Documents.CompanyAuthorization( + this.extraParams, this.files); } /** @@ -5142,8 +5165,8 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public Passport build() { - return new Passport(this.extraParams, this.files); + public TokenCreateParams.Person.Documents.Passport build() { + return new TokenCreateParams.Person.Documents.Passport(this.extraParams, this.files); } /** @@ -5237,8 +5260,8 @@ public static class Builder { private List files; /** Finalize and obtain parameter instance from this builder. */ - public Visa build() { - return new Visa(this.extraParams, this.files); + public TokenCreateParams.Person.Documents.Visa build() { + return new TokenCreateParams.Person.Documents.Visa(this.extraParams, this.files); } /** @@ -5373,8 +5396,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public RegisteredAddress build() { - return new RegisteredAddress( + public TokenCreateParams.Person.RegisteredAddress build() { + return new TokenCreateParams.Person.RegisteredAddress( this.city, this.country, this.extraParams, @@ -5538,8 +5561,8 @@ public static class Builder { private String title; /** Finalize and obtain parameter instance from this builder. */ - public Relationship build() { - return new Relationship( + public TokenCreateParams.Person.Relationship build() { + return new TokenCreateParams.Person.Relationship( this.director, this.executive, this.extraParams, @@ -5677,21 +5700,23 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Verification build() { - return new Verification(this.additionalDocument, this.document, this.extraParams); + public TokenCreateParams.Person.Verification build() { + return new TokenCreateParams.Person.Verification( + this.additionalDocument, this.document, this.extraParams); } /** * A document showing address, either a passport, local ID card, or utility bill from a * well-known utility company. */ - public Builder setAdditionalDocument(AdditionalDocument additionalDocument) { + public Builder setAdditionalDocument( + TokenCreateParams.Person.Verification.AdditionalDocument additionalDocument) { this.additionalDocument = additionalDocument; return this; } /** An identifying document, either a passport or local ID card. */ - public Builder setDocument(Document document) { + public Builder setDocument(TokenCreateParams.Person.Verification.Document document) { this.document = document; return this; } @@ -5773,8 +5798,9 @@ public static class Builder { private String front; /** Finalize and obtain parameter instance from this builder. */ - public AdditionalDocument build() { - return new AdditionalDocument(this.back, this.extraParams, this.front); + public TokenCreateParams.Person.Verification.AdditionalDocument build() { + return new TokenCreateParams.Person.Verification.AdditionalDocument( + this.back, this.extraParams, this.front); } /** @@ -5877,8 +5903,9 @@ public static class Builder { private String front; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document(this.back, this.extraParams, this.front); + public TokenCreateParams.Person.Verification.Document build() { + return new TokenCreateParams.Person.Verification.Document( + this.back, this.extraParams, this.front); } /** @@ -5965,8 +5992,8 @@ public static class Builder { private String idNumber; /** Finalize and obtain parameter instance from this builder. */ - public Pii build() { - return new Pii(this.extraParams, this.idNumber); + public TokenCreateParams.Pii build() { + return new TokenCreateParams.Pii(this.extraParams, this.idNumber); } /** diff --git a/src/main/java/com/stripe/param/TopupListParams.java b/src/main/java/com/stripe/param/TopupListParams.java index 0cbe4ce3042..15f39d90282 100644 --- a/src/main/java/com/stripe/param/TopupListParams.java +++ b/src/main/java/com/stripe/param/TopupListParams.java @@ -121,7 +121,7 @@ public TopupListParams build() { } /** A positive integer representing how much to transfer. */ - public Builder setAmount(Amount amount) { + public Builder setAmount(TopupListParams.Amount amount) { this.amount = amount; return this; } @@ -137,7 +137,7 @@ public Builder setAmount(Long amount) { * with an integer Unix timestamp, or it can be a dictionary with a number of different query * options. */ - public Builder setCreated(Created created) { + public Builder setCreated(TopupListParams.Created created) { this.created = created; return this; } @@ -239,7 +239,7 @@ public Builder setStartingAfter(String startingAfter) { * Only return top-ups that have the given status. One of {@code canceled}, {@code failed}, * {@code pending} or {@code succeeded}. */ - public Builder setStatus(Status status) { + public Builder setStatus(TopupListParams.Status status) { this.status = status; return this; } @@ -296,8 +296,8 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Amount build() { - return new Amount(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public TopupListParams.Amount build() { + return new TopupListParams.Amount(this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -403,8 +403,8 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public TopupListParams.Created build() { + return new TopupListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/TransferCreateParams.java b/src/main/java/com/stripe/param/TransferCreateParams.java index 8ec8414cb76..16351a52e29 100644 --- a/src/main/java/com/stripe/param/TransferCreateParams.java +++ b/src/main/java/com/stripe/param/TransferCreateParams.java @@ -263,7 +263,7 @@ public Builder setSourceTransaction(String sourceTransaction) { * The source balance to use for this transfer. One of {@code bank_account}, {@code card}, or * {@code fpx}. For most users, this will default to {@code card}. */ - public Builder setSourceType(SourceType sourceType) { + public Builder setSourceType(TransferCreateParams.SourceType sourceType) { this.sourceType = sourceType; return this; } diff --git a/src/main/java/com/stripe/param/TransferListParams.java b/src/main/java/com/stripe/param/TransferListParams.java index 7ae48fd65b1..00b1c1c2f28 100644 --- a/src/main/java/com/stripe/param/TransferListParams.java +++ b/src/main/java/com/stripe/param/TransferListParams.java @@ -113,7 +113,7 @@ public TransferListParams build() { this.transferGroup); } - public Builder setCreated(Created created) { + public Builder setCreated(TransferListParams.Created created) { this.created = created; return this; } @@ -270,8 +270,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public TransferListParams.Created build() { + return new TransferListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/UsageRecordCreateOnSubscriptionItemParams.java b/src/main/java/com/stripe/param/UsageRecordCreateOnSubscriptionItemParams.java index 3d878efd722..f45d96bd865 100644 --- a/src/main/java/com/stripe/param/UsageRecordCreateOnSubscriptionItemParams.java +++ b/src/main/java/com/stripe/param/UsageRecordCreateOnSubscriptionItemParams.java @@ -88,7 +88,7 @@ public UsageRecordCreateOnSubscriptionItemParams build() { * href="https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds">billing * thresholds, {@code increment} is the only allowed value. */ - public Builder setAction(Action action) { + public Builder setAction(UsageRecordCreateOnSubscriptionItemParams.Action action) { this.action = action; return this; } @@ -158,7 +158,7 @@ public Builder setQuantity(Long quantity) { * When passing {@code "now"}, Stripe records usage for the current time. Default is {@code * "now"} if a value is not provided. */ - public Builder setTimestamp(Timestamp timestamp) { + public Builder setTimestamp(UsageRecordCreateOnSubscriptionItemParams.Timestamp timestamp) { this.timestamp = timestamp; return this; } diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index d335f2a720c..4ac63f41ded 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -35,7 +35,7 @@ public class WebhookEndpointCreateParams extends ApiRequestParams { * events, except those that require explicit selection. */ @SerializedName("enabled_events") - List enabledEvents; + List enabledEvents; /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") @@ -67,7 +67,7 @@ private WebhookEndpointCreateParams( ApiVersion apiVersion, Boolean connect, String description, - List enabledEvents, + List enabledEvents, List expand, Map extraParams, Object metadata, @@ -93,7 +93,7 @@ public static class Builder { private String description; - private List enabledEvents; + private List enabledEvents; private List expand; @@ -120,7 +120,7 @@ public WebhookEndpointCreateParams build() { * Events sent to this endpoint will be generated with this Stripe Version instead of your * account's default Stripe Version. */ - public Builder setApiVersion(ApiVersion apiVersion) { + public Builder setApiVersion(WebhookEndpointCreateParams.ApiVersion apiVersion) { this.apiVersion = apiVersion; return this; } @@ -145,7 +145,7 @@ public Builder setDescription(String description) { * call, and subsequent calls adds additional elements to the original list. See {@link * WebhookEndpointCreateParams#enabledEvents} for the field documentation. */ - public Builder addEnabledEvent(EnabledEvent element) { + public Builder addEnabledEvent(WebhookEndpointCreateParams.EnabledEvent element) { if (this.enabledEvents == null) { this.enabledEvents = new ArrayList<>(); } @@ -158,7 +158,7 @@ public Builder addEnabledEvent(EnabledEvent element) { * call, and subsequent calls adds additional elements to the original list. See {@link * WebhookEndpointCreateParams#enabledEvents} for the field documentation. */ - public Builder addAllEnabledEvent(List elements) { + public Builder addAllEnabledEvent(List elements) { if (this.enabledEvents == null) { this.enabledEvents = new ArrayList<>(); } diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index 64921c0301b..7bef45fff49 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -25,7 +25,7 @@ public class WebhookEndpointUpdateParams extends ApiRequestParams { * events, except those that require explicit selection. */ @SerializedName("enabled_events") - List enabledEvents; + List enabledEvents; /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") @@ -56,7 +56,7 @@ public class WebhookEndpointUpdateParams extends ApiRequestParams { private WebhookEndpointUpdateParams( Object description, Boolean disabled, - List enabledEvents, + List enabledEvents, List expand, Map extraParams, Object metadata, @@ -79,7 +79,7 @@ public static class Builder { private Boolean disabled; - private List enabledEvents; + private List enabledEvents; private List expand; @@ -124,7 +124,7 @@ public Builder setDisabled(Boolean disabled) { * call, and subsequent calls adds additional elements to the original list. See {@link * WebhookEndpointUpdateParams#enabledEvents} for the field documentation. */ - public Builder addEnabledEvent(EnabledEvent element) { + public Builder addEnabledEvent(WebhookEndpointUpdateParams.EnabledEvent element) { if (this.enabledEvents == null) { this.enabledEvents = new ArrayList<>(); } @@ -137,7 +137,7 @@ public Builder addEnabledEvent(EnabledEvent element) { * call, and subsequent calls adds additional elements to the original list. See {@link * WebhookEndpointUpdateParams#enabledEvents} for the field documentation. */ - public Builder addAllEnabledEvent(List elements) { + public Builder addAllEnabledEvent(List elements) { if (this.enabledEvents == null) { this.enabledEvents = new ArrayList<>(); } diff --git a/src/main/java/com/stripe/param/apps/SecretCreateParams.java b/src/main/java/com/stripe/param/apps/SecretCreateParams.java index 946e5b1c2ad..7ef9ded0ab6 100644 --- a/src/main/java/com/stripe/param/apps/SecretCreateParams.java +++ b/src/main/java/com/stripe/param/apps/SecretCreateParams.java @@ -155,7 +155,7 @@ public Builder setPayload(String payload) { * Specifies the scoping of the secret. Requests originating from UI extensions can only access * account-scoped secrets or secrets scoped to their own user. */ - public Builder setScope(Scope scope) { + public Builder setScope(SecretCreateParams.Scope scope) { this.scope = scope; return this; } @@ -201,8 +201,8 @@ public static class Builder { private String user; /** Finalize and obtain parameter instance from this builder. */ - public Scope build() { - return new Scope(this.extraParams, this.type, this.user); + public SecretCreateParams.Scope build() { + return new SecretCreateParams.Scope(this.extraParams, this.type, this.user); } /** @@ -232,7 +232,7 @@ public Builder putAllExtraParam(Map map) { } /** The secret scope type. */ - public Builder setType(Type type) { + public Builder setType(SecretCreateParams.Scope.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/apps/SecretDeleteWhereParams.java b/src/main/java/com/stripe/param/apps/SecretDeleteWhereParams.java index 0c1737f776f..de6a5e581b9 100644 --- a/src/main/java/com/stripe/param/apps/SecretDeleteWhereParams.java +++ b/src/main/java/com/stripe/param/apps/SecretDeleteWhereParams.java @@ -123,7 +123,7 @@ public Builder setName(String name) { * Specifies the scoping of the secret. Requests originating from UI extensions can only access * account-scoped secrets or secrets scoped to their own user. */ - public Builder setScope(Scope scope) { + public Builder setScope(SecretDeleteWhereParams.Scope scope) { this.scope = scope; return this; } @@ -169,8 +169,8 @@ public static class Builder { private String user; /** Finalize and obtain parameter instance from this builder. */ - public Scope build() { - return new Scope(this.extraParams, this.type, this.user); + public SecretDeleteWhereParams.Scope build() { + return new SecretDeleteWhereParams.Scope(this.extraParams, this.type, this.user); } /** @@ -200,7 +200,7 @@ public Builder putAllExtraParam(Map map) { } /** The secret scope type. */ - public Builder setType(Type type) { + public Builder setType(SecretDeleteWhereParams.Scope.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/apps/SecretFindParams.java b/src/main/java/com/stripe/param/apps/SecretFindParams.java index c16c9c9368b..5c4ace15345 100644 --- a/src/main/java/com/stripe/param/apps/SecretFindParams.java +++ b/src/main/java/com/stripe/param/apps/SecretFindParams.java @@ -123,7 +123,7 @@ public Builder setName(String name) { * Specifies the scoping of the secret. Requests originating from UI extensions can only access * account-scoped secrets or secrets scoped to their own user. */ - public Builder setScope(Scope scope) { + public Builder setScope(SecretFindParams.Scope scope) { this.scope = scope; return this; } @@ -169,8 +169,8 @@ public static class Builder { private String user; /** Finalize and obtain parameter instance from this builder. */ - public Scope build() { - return new Scope(this.extraParams, this.type, this.user); + public SecretFindParams.Scope build() { + return new SecretFindParams.Scope(this.extraParams, this.type, this.user); } /** @@ -200,7 +200,7 @@ public Builder putAllExtraParam(Map map) { } /** The secret scope type. */ - public Builder setType(Type type) { + public Builder setType(SecretFindParams.Scope.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/apps/SecretListParams.java b/src/main/java/com/stripe/param/apps/SecretListParams.java index 6d20d4b5fd6..4ec1cd9ce1e 100644 --- a/src/main/java/com/stripe/param/apps/SecretListParams.java +++ b/src/main/java/com/stripe/param/apps/SecretListParams.java @@ -175,7 +175,7 @@ public Builder setLimit(Long limit) { * Specifies the scoping of the secret. Requests originating from UI extensions can only access * account-scoped secrets or secrets scoped to their own user. */ - public Builder setScope(Scope scope) { + public Builder setScope(SecretListParams.Scope scope) { this.scope = scope; return this; } @@ -232,8 +232,8 @@ public static class Builder { private String user; /** Finalize and obtain parameter instance from this builder. */ - public Scope build() { - return new Scope(this.extraParams, this.type, this.user); + public SecretListParams.Scope build() { + return new SecretListParams.Scope(this.extraParams, this.type, this.user); } /** @@ -263,7 +263,7 @@ public Builder putAllExtraParam(Map map) { } /** The secret scope type. */ - public Builder setType(Type type) { + public Builder setType(SecretListParams.Scope.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java b/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java index 10dc3fda731..333376f474a 100644 --- a/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java @@ -108,7 +108,7 @@ public ConfigurationCreateParams build() { } /** The business information shown to customers in the portal. */ - public Builder setBusinessProfile(BusinessProfile businessProfile) { + public Builder setBusinessProfile(ConfigurationCreateParams.BusinessProfile businessProfile) { this.businessProfile = businessProfile; return this; } @@ -188,7 +188,7 @@ public Builder putAllExtraParam(Map map) { } /** Information about the features available in the portal. */ - public Builder setFeatures(Features features) { + public Builder setFeatures(ConfigurationCreateParams.Features features) { this.features = features; return this; } @@ -199,7 +199,7 @@ public Builder setFeatures(Features features) { * href="https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share">integration * docs. */ - public Builder setLoginPage(LoginPage loginPage) { + public Builder setLoginPage(ConfigurationCreateParams.LoginPage loginPage) { this.loginPage = loginPage; return this; } @@ -279,8 +279,8 @@ public static class Builder { private String termsOfServiceUrl; /** Finalize and obtain parameter instance from this builder. */ - public BusinessProfile build() { - return new BusinessProfile( + public ConfigurationCreateParams.BusinessProfile build() { + return new ConfigurationCreateParams.BusinessProfile( this.extraParams, this.headline, this.privacyPolicyUrl, this.termsOfServiceUrl); } @@ -403,8 +403,8 @@ public static class Builder { private SubscriptionUpdate subscriptionUpdate; /** Finalize and obtain parameter instance from this builder. */ - public Features build() { - return new Features( + public ConfigurationCreateParams.Features build() { + return new ConfigurationCreateParams.Features( this.customerUpdate, this.extraParams, this.invoiceHistory, @@ -415,7 +415,8 @@ public Features build() { } /** Information about updating the customer details in the portal. */ - public Builder setCustomerUpdate(CustomerUpdate customerUpdate) { + public Builder setCustomerUpdate( + ConfigurationCreateParams.Features.CustomerUpdate customerUpdate) { this.customerUpdate = customerUpdate; return this; } @@ -447,31 +448,36 @@ public Builder putAllExtraParam(Map map) { } /** Information about showing the billing history in the portal. */ - public Builder setInvoiceHistory(InvoiceHistory invoiceHistory) { + public Builder setInvoiceHistory( + ConfigurationCreateParams.Features.InvoiceHistory invoiceHistory) { this.invoiceHistory = invoiceHistory; return this; } /** Information about updating payment methods in the portal. */ - public Builder setPaymentMethodUpdate(PaymentMethodUpdate paymentMethodUpdate) { + public Builder setPaymentMethodUpdate( + ConfigurationCreateParams.Features.PaymentMethodUpdate paymentMethodUpdate) { this.paymentMethodUpdate = paymentMethodUpdate; return this; } /** Information about canceling subscriptions in the portal. */ - public Builder setSubscriptionCancel(SubscriptionCancel subscriptionCancel) { + public Builder setSubscriptionCancel( + ConfigurationCreateParams.Features.SubscriptionCancel subscriptionCancel) { this.subscriptionCancel = subscriptionCancel; return this; } /** Information about pausing subscriptions in the portal. */ - public Builder setSubscriptionPause(SubscriptionPause subscriptionPause) { + public Builder setSubscriptionPause( + ConfigurationCreateParams.Features.SubscriptionPause subscriptionPause) { this.subscriptionPause = subscriptionPause; return this; } /** Information about updating subscriptions in the portal. */ - public Builder setSubscriptionUpdate(SubscriptionUpdate subscriptionUpdate) { + public Builder setSubscriptionUpdate( + ConfigurationCreateParams.Features.SubscriptionUpdate subscriptionUpdate) { this.subscriptionUpdate = subscriptionUpdate; return this; } @@ -517,8 +523,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerUpdate build() { - return new CustomerUpdate(this.allowedUpdates, this.enabled, this.extraParams); + public ConfigurationCreateParams.Features.CustomerUpdate build() { + return new ConfigurationCreateParams.Features.CustomerUpdate( + this.allowedUpdates, this.enabled, this.extraParams); } /** @@ -528,7 +535,8 @@ public CustomerUpdate build() { * documentation. */ @SuppressWarnings("unchecked") - public Builder addAllowedUpdate(AllowedUpdate element) { + public Builder addAllowedUpdate( + ConfigurationCreateParams.Features.CustomerUpdate.AllowedUpdate element) { if (this.allowedUpdates == null || this.allowedUpdates instanceof EmptyParam) { this.allowedUpdates = new ArrayList(); @@ -546,7 +554,8 @@ public Builder addAllowedUpdate(AllowedUpdate element) { * field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllAllowedUpdate(List elements) { + public Builder addAllAllowedUpdate( + List elements) { if (this.allowedUpdates == null || this.allowedUpdates instanceof EmptyParam) { this.allowedUpdates = new ArrayList(); @@ -570,7 +579,8 @@ public Builder setAllowedUpdates(EmptyParam allowedUpdates) { * The types of customer updates that are supported. When empty, customers are not * updateable. */ - public Builder setAllowedUpdates(List allowedUpdates) { + public Builder setAllowedUpdates( + List allowedUpdates) { this.allowedUpdates = allowedUpdates; return this; } @@ -665,8 +675,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceHistory build() { - return new InvoiceHistory(this.enabled, this.extraParams); + public ConfigurationCreateParams.Features.InvoiceHistory build() { + return new ConfigurationCreateParams.Features.InvoiceHistory( + this.enabled, this.extraParams); } /** Whether the feature is enabled. */ @@ -735,8 +746,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodUpdate build() { - return new PaymentMethodUpdate(this.enabled, this.extraParams); + public ConfigurationCreateParams.Features.PaymentMethodUpdate build() { + return new ConfigurationCreateParams.Features.PaymentMethodUpdate( + this.enabled, this.extraParams); } /** Whether the feature is enabled. */ @@ -839,8 +851,8 @@ public static class Builder { private ProrationBehavior prorationBehavior; /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionCancel build() { - return new SubscriptionCancel( + public ConfigurationCreateParams.Features.SubscriptionCancel build() { + return new ConfigurationCreateParams.Features.SubscriptionCancel( this.cancellationReason, this.enabled, this.extraParams, @@ -852,7 +864,9 @@ public SubscriptionCancel build() { * Whether the cancellation reasons will be collected in the portal and which options are * exposed to the customer. */ - public Builder setCancellationReason(CancellationReason cancellationReason) { + public Builder setCancellationReason( + ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason + cancellationReason) { this.cancellationReason = cancellationReason; return this; } @@ -892,7 +906,7 @@ public Builder putAllExtraParam(Map map) { } /** Whether to cancel subscriptions immediately or at the end of the billing period. */ - public Builder setMode(Mode mode) { + public Builder setMode(ConfigurationCreateParams.Features.SubscriptionCancel.Mode mode) { this.mode = mode; return this; } @@ -903,7 +917,9 @@ public Builder setMode(Mode mode) { * mode=immediately}. No prorations are generated when canceling a subscription at the end * of its natural billing period. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + ConfigurationCreateParams.Features.SubscriptionCancel.ProrationBehavior + prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -948,8 +964,9 @@ public static class Builder { private Object options; /** Finalize and obtain parameter instance from this builder. */ - public CancellationReason build() { - return new CancellationReason(this.enabled, this.extraParams, this.options); + public ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason build() { + return new ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason( + this.enabled, this.extraParams, this.options); } /** Whether the feature is enabled. */ @@ -995,7 +1012,9 @@ public Builder putAllExtraParam(Map map) { * the field documentation. */ @SuppressWarnings("unchecked") - public Builder addOption(Option element) { + public Builder addOption( + ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason.Option + element) { if (this.options == null || this.options instanceof EmptyParam) { this.options = new ArrayList< @@ -1015,7 +1034,9 @@ public Builder addOption(Option element) { * the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllOption(List

Can only be set in {@code payment} and {@code setup} mode. */ - public Builder setCustomerCreation(CustomerCreation customerCreation) { + public Builder setCustomerCreation(SessionCreateParams.CustomerCreation customerCreation) { this.customerCreation = customerCreation; return this; } @@ -586,7 +587,7 @@ public Builder setCustomerEmail(String customerEmail) { * Controls what fields on Customer can be updated by the Checkout Session. Can only be provided * when {@code customer} is provided. */ - public Builder setCustomerUpdate(CustomerUpdate customerUpdate) { + public Builder setCustomerUpdate(SessionCreateParams.CustomerUpdate customerUpdate) { this.customerUpdate = customerUpdate; return this; } @@ -596,7 +597,7 @@ public Builder setCustomerUpdate(CustomerUpdate customerUpdate) { * and subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams#discounts} for the field documentation. */ - public Builder addDiscount(Discount element) { + public Builder addDiscount(SessionCreateParams.Discount element) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -609,7 +610,7 @@ public Builder addDiscount(Discount element) { * and subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams#discounts} for the field documentation. */ - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -684,7 +685,7 @@ public Builder putAllExtraParam(Map map) { * and subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(SessionCreateParams.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -697,7 +698,7 @@ public Builder addLineItem(LineItem element) { * and subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -709,7 +710,7 @@ public Builder addAllLineItem(List elements) { * The IETF language tag of the locale Checkout is displayed in. If blank or {@code auto}, the * browser's locale is used. */ - public Builder setLocale(Locale locale) { + public Builder setLocale(SessionCreateParams.Locale locale) { this.locale = locale; return this; } @@ -744,7 +745,7 @@ public Builder putAllMetadata(Map map) { * The mode of the Checkout Session. Required when using prices or {@code setup} mode. Pass * {@code subscription} if the Checkout Session includes at least one recurring item. */ - public Builder setMode(Mode mode) { + public Builder setMode(SessionCreateParams.Mode mode) { this.mode = mode; return this; } @@ -753,7 +754,7 @@ public Builder setMode(Mode mode) { * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code * payment} mode. */ - public Builder setPaymentIntentData(PaymentIntentData paymentIntentData) { + public Builder setPaymentIntentData(SessionCreateParams.PaymentIntentData paymentIntentData) { this.paymentIntentData = paymentIntentData; return this; } @@ -770,13 +771,15 @@ public Builder setPaymentIntentData(PaymentIntentData paymentIntentData) { * href="https://stripe.com/docs/payments/checkout/free-trials">subscriptions with a free * trial. */ - public Builder setPaymentMethodCollection(PaymentMethodCollection paymentMethodCollection) { + public Builder setPaymentMethodCollection( + SessionCreateParams.PaymentMethodCollection paymentMethodCollection) { this.paymentMethodCollection = paymentMethodCollection; return this; } /** Payment-method-specific configuration. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + SessionCreateParams.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -786,7 +789,7 @@ public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions * call, and subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams#paymentMethodTypes} for the field documentation. */ - public Builder addPaymentMethodType(PaymentMethodType element) { + public Builder addPaymentMethodType(SessionCreateParams.PaymentMethodType element) { if (this.paymentMethodTypes == null) { this.paymentMethodTypes = new ArrayList<>(); } @@ -799,7 +802,7 @@ public Builder addPaymentMethodType(PaymentMethodType element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link SessionCreateParams#paymentMethodTypes} for the field documentation. */ - public Builder addAllPaymentMethodType(List elements) { + public Builder addAllPaymentMethodType(List elements) { if (this.paymentMethodTypes == null) { this.paymentMethodTypes = new ArrayList<>(); } @@ -815,7 +818,8 @@ public Builder addAllPaymentMethodType(List elements) { * href="https://stripe.com/docs/payments/checkout/phone-numbers">collecting phone numbers with * Checkout. */ - public Builder setPhoneNumberCollection(PhoneNumberCollection phoneNumberCollection) { + public Builder setPhoneNumberCollection( + SessionCreateParams.PhoneNumberCollection phoneNumberCollection) { this.phoneNumberCollection = phoneNumberCollection; return this; } @@ -824,7 +828,7 @@ public Builder setPhoneNumberCollection(PhoneNumberCollection phoneNumberCollect * A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in {@code * setup} mode. */ - public Builder setSetupIntentData(SetupIntentData setupIntentData) { + public Builder setSetupIntentData(SessionCreateParams.SetupIntentData setupIntentData) { this.setupIntentData = setupIntentData; return this; } @@ -833,7 +837,7 @@ public Builder setSetupIntentData(SetupIntentData setupIntentData) { * When set, provides configuration for Checkout to collect a shipping address from a customer. */ public Builder setShippingAddressCollection( - ShippingAddressCollection shippingAddressCollection) { + SessionCreateParams.ShippingAddressCollection shippingAddressCollection) { this.shippingAddressCollection = shippingAddressCollection; return this; } @@ -843,7 +847,7 @@ public Builder setShippingAddressCollection( * call, and subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams#shippingOptions} for the field documentation. */ - public Builder addShippingOption(ShippingOption element) { + public Builder addShippingOption(SessionCreateParams.ShippingOption element) { if (this.shippingOptions == null) { this.shippingOptions = new ArrayList<>(); } @@ -856,7 +860,7 @@ public Builder addShippingOption(ShippingOption element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams#shippingOptions} for the field documentation. */ - public Builder addAllShippingOption(List elements) { + public Builder addAllShippingOption(List elements) { if (this.shippingOptions == null) { this.shippingOptions = new ArrayList<>(); } @@ -896,7 +900,7 @@ public Builder addAllShippingRate(List elements) { * Checkout Sessions in {@code payment} mode, but not Checkout Sessions in {@code subscription} * or {@code setup} mode. */ - public Builder setSubmitType(SubmitType submitType) { + public Builder setSubmitType(SessionCreateParams.SubmitType submitType) { this.submitType = submitType; return this; } @@ -905,7 +909,7 @@ public Builder setSubmitType(SubmitType submitType) { * A subset of parameters to be passed to subscription creation for Checkout Sessions in {@code * subscription} mode. */ - public Builder setSubscriptionData(SubscriptionData subscriptionData) { + public Builder setSubscriptionData(SessionCreateParams.SubscriptionData subscriptionData) { this.subscriptionData = subscriptionData; return this; } @@ -922,7 +926,7 @@ public Builder setSuccessUrl(String successUrl) { } /** Controls tax ID collection settings for the session. */ - public Builder setTaxIdCollection(TaxIdCollection taxIdCollection) { + public Builder setTaxIdCollection(SessionCreateParams.TaxIdCollection taxIdCollection) { this.taxIdCollection = taxIdCollection; return this; } @@ -958,8 +962,8 @@ public static class Builder { private Recovery recovery; /** Finalize and obtain parameter instance from this builder. */ - public AfterExpiration build() { - return new AfterExpiration(this.extraParams, this.recovery); + public SessionCreateParams.AfterExpiration build() { + return new SessionCreateParams.AfterExpiration(this.extraParams, this.recovery); } /** @@ -989,7 +993,7 @@ public Builder putAllExtraParam(Map map) { } /** Configure a Checkout Session that can be used to recover an expired session. */ - public Builder setRecovery(Recovery recovery) { + public Builder setRecovery(SessionCreateParams.AfterExpiration.Recovery recovery) { this.recovery = recovery; return this; } @@ -1040,8 +1044,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Recovery build() { - return new Recovery(this.allowPromotionCodes, this.enabled, this.extraParams); + public SessionCreateParams.AfterExpiration.Recovery build() { + return new SessionCreateParams.AfterExpiration.Recovery( + this.allowPromotionCodes, this.enabled, this.extraParams); } /** @@ -1124,8 +1129,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SessionCreateParams.AutomaticTax build() { + return new SessionCreateParams.AutomaticTax(this.enabled, this.extraParams); } /** Set to true to enable automatic taxes. */ @@ -1182,9 +1187,19 @@ public static class ConsentCollection { @SerializedName("promotions") Promotions promotions; - private ConsentCollection(Map extraParams, Promotions promotions) { + /** + * If set to {@code required}, it requires customers to check a terms of service checkbox before + * being able to pay. There must be a valid terms of service URL set in your Dashboard settings. + */ + @SerializedName("terms_of_service") + TermsOfService termsOfService; + + private ConsentCollection( + Map extraParams, Promotions promotions, TermsOfService termsOfService) { this.extraParams = extraParams; this.promotions = promotions; + this.termsOfService = termsOfService; } public static Builder builder() { @@ -1196,9 +1211,12 @@ public static class Builder { private Promotions promotions; + private TermsOfService termsOfService; + /** Finalize and obtain parameter instance from this builder. */ - public ConsentCollection build() { - return new ConsentCollection(this.extraParams, this.promotions); + public SessionCreateParams.ConsentCollection build() { + return new SessionCreateParams.ConsentCollection( + this.extraParams, this.promotions, this.termsOfService); } /** @@ -1233,10 +1251,21 @@ public Builder putAllExtraParam(Map map) { * into promotional communication from the merchant depending on the customer's locale. Only * available to US merchants. */ - public Builder setPromotions(Promotions promotions) { + public Builder setPromotions(SessionCreateParams.ConsentCollection.Promotions promotions) { this.promotions = promotions; return this; } + + /** + * If set to {@code required}, it requires customers to check a terms of service checkbox + * before being able to pay. There must be a valid terms of service URL set in your Dashboard settings. + */ + public Builder setTermsOfService( + SessionCreateParams.ConsentCollection.TermsOfService termsOfService) { + this.termsOfService = termsOfService; + return this; + } } public enum Promotions implements ApiRequestParams.EnumParam { @@ -1253,6 +1282,21 @@ public enum Promotions implements ApiRequestParams.EnumParam { this.value = value; } } + + public enum TermsOfService implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("required") + REQUIRED("required"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TermsOfService(String value) { + this.value = value; + } + } } @Getter @@ -1311,8 +1355,9 @@ public static class Builder { private Shipping shipping; /** Finalize and obtain parameter instance from this builder. */ - public CustomerUpdate build() { - return new CustomerUpdate(this.address, this.extraParams, this.name, this.shipping); + public SessionCreateParams.CustomerUpdate build() { + return new SessionCreateParams.CustomerUpdate( + this.address, this.extraParams, this.name, this.shipping); } /** @@ -1320,7 +1365,7 @@ public CustomerUpdate build() { * always collect a full billing address, use {@code billing_address_collection}. Defaults to * {@code never}. */ - public Builder setAddress(Address address) { + public Builder setAddress(SessionCreateParams.CustomerUpdate.Address address) { this.address = address; return this; } @@ -1355,7 +1400,7 @@ public Builder putAllExtraParam(Map map) { * Describes whether Checkout saves the name onto {@code customer.name}. Defaults to {@code * never}. */ - public Builder setName(Name name) { + public Builder setName(SessionCreateParams.CustomerUpdate.Name name) { this.name = name; return this; } @@ -1365,7 +1410,7 @@ public Builder setName(Name name) { * collect shipping information, use {@code shipping_address_collection}. Defaults to {@code * never}. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(SessionCreateParams.CustomerUpdate.Shipping shipping) { this.shipping = shipping; return this; } @@ -1454,8 +1499,8 @@ public static class Builder { private String promotionCode; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.extraParams, this.promotionCode); + public SessionCreateParams.Discount build() { + return new SessionCreateParams.Discount(this.coupon, this.extraParams, this.promotionCode); } /** The ID of the coupon to apply to this Session. */ @@ -1645,8 +1690,8 @@ public static class Builder { private List taxRates; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem( + public SessionCreateParams.LineItem build() { + return new SessionCreateParams.LineItem( this.adjustableQuantity, this.amount, this.currency, @@ -1665,7 +1710,8 @@ public LineItem build() { * When set, provides configuration for this item’s quantity to be adjusted by the customer * during Checkout. */ - public Builder setAdjustableQuantity(AdjustableQuantity adjustableQuantity) { + public Builder setAdjustableQuantity( + SessionCreateParams.LineItem.AdjustableQuantity adjustableQuantity) { this.adjustableQuantity = adjustableQuantity; return this; } @@ -1797,7 +1843,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. One of {@code price} or {@code price_data} is required. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(SessionCreateParams.LineItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1892,8 +1938,9 @@ public static class Builder { private Long minimum; /** Finalize and obtain parameter instance from this builder. */ - public AdjustableQuantity build() { - return new AdjustableQuantity(this.enabled, this.extraParams, this.maximum, this.minimum); + public SessionCreateParams.LineItem.AdjustableQuantity build() { + return new SessionCreateParams.LineItem.AdjustableQuantity( + this.enabled, this.extraParams, this.maximum, this.minimum); } /** @@ -2056,8 +2103,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SessionCreateParams.LineItem.PriceData build() { + return new SessionCreateParams.LineItem.PriceData( this.currency, this.extraParams, this.product, @@ -2119,7 +2166,8 @@ public Builder setProduct(String product) { * Data used to generate a new product object inline. One of {@code product} or {@code * product_data} is required. */ - public Builder setProductData(ProductData productData) { + public Builder setProductData( + SessionCreateParams.LineItem.PriceData.ProductData productData) { this.productData = productData; return this; } @@ -2127,7 +2175,7 @@ public Builder setProductData(ProductData productData) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(SessionCreateParams.LineItem.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -2137,7 +2185,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SessionCreateParams.LineItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2239,8 +2288,8 @@ public static class Builder { private String taxCode; /** Finalize and obtain parameter instance from this builder. */ - public ProductData build() { - return new ProductData( + public SessionCreateParams.LineItem.PriceData.ProductData build() { + return new SessionCreateParams.LineItem.PriceData.ProductData( this.description, this.extraParams, this.images, @@ -2400,8 +2449,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public SessionCreateParams.LineItem.PriceData.Recurring build() { + return new SessionCreateParams.LineItem.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -2436,7 +2486,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SessionCreateParams.LineItem.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -2670,8 +2721,8 @@ public static class Builder { private String transferGroup; /** Finalize and obtain parameter instance from this builder. */ - public PaymentIntentData build() { - return new PaymentIntentData( + public SessionCreateParams.PaymentIntentData build() { + return new SessionCreateParams.PaymentIntentData( this.applicationFeeAmount, this.captureMethod, this.description, @@ -2700,7 +2751,8 @@ public Builder setApplicationFeeAmount(Long applicationFeeAmount) { } /** Controls when the funds will be captured from the customer's account. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + SessionCreateParams.PaymentIntentData.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -2805,13 +2857,14 @@ public Builder setReceiptEmail(String receiptEmail) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentIntentData.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } /** Shipping information for this payment. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(SessionCreateParams.PaymentIntentData.Shipping shipping) { this.shipping = shipping; return this; } @@ -2842,7 +2895,8 @@ public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) { * href="https://stripe.com/docs/payments/connected-accounts">use case for connected * accounts. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + SessionCreateParams.PaymentIntentData.TransferData transferData) { this.transferData = transferData; return this; } @@ -2925,8 +2979,8 @@ public static class Builder { private String trackingNumber; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping( + public SessionCreateParams.PaymentIntentData.Shipping build() { + return new SessionCreateParams.PaymentIntentData.Shipping( this.address, this.carrier, this.extraParams, @@ -2936,7 +2990,7 @@ public Shipping build() { } /** Shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(SessionCreateParams.PaymentIntentData.Shipping.Address address) { this.address = address; return this; } @@ -3074,8 +3128,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public SessionCreateParams.PaymentIntentData.Shipping.Address build() { + return new SessionCreateParams.PaymentIntentData.Shipping.Address( this.city, this.country, this.extraParams, @@ -3197,8 +3251,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.destination, this.extraParams); + public SessionCreateParams.PaymentIntentData.TransferData build() { + return new SessionCreateParams.PaymentIntentData.TransferData( + this.amount, this.destination, this.extraParams); } /** The amount that will be transferred automatically when a charge succeeds. */ @@ -3503,8 +3558,8 @@ public static class Builder { private WechatPay wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public SessionCreateParams.PaymentMethodOptions build() { + return new SessionCreateParams.PaymentMethodOptions( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -3534,67 +3589,70 @@ public PaymentMethodOptions build() { } /** contains details about the ACSS Debit payment method options. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(SessionCreateParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } /** contains details about the Affirm payment method options. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(SessionCreateParams.PaymentMethodOptions.Affirm affirm) { this.affirm = affirm; return this; } /** contains details about the Afterpay Clearpay payment method options. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + SessionCreateParams.PaymentMethodOptions.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } /** contains details about the Alipay payment method options. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(SessionCreateParams.PaymentMethodOptions.Alipay alipay) { this.alipay = alipay; return this; } /** contains details about the AU Becs Debit payment method options. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + SessionCreateParams.PaymentMethodOptions.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } /** contains details about the Bacs Debit payment method options. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(SessionCreateParams.PaymentMethodOptions.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } /** contains details about the Bancontact payment method options. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact(SessionCreateParams.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } /** contains details about the Boleto payment method options. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(SessionCreateParams.PaymentMethodOptions.Boleto boleto) { this.boleto = boleto; return this; } /** contains details about the Card payment method options. */ - public Builder setCard(Card card) { + public Builder setCard(SessionCreateParams.PaymentMethodOptions.Card card) { this.card = card; return this; } /** contains details about the Customer Balance payment method options. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + SessionCreateParams.PaymentMethodOptions.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } /** contains details about the EPS payment method options. */ - public Builder setEps(Eps eps) { + public Builder setEps(SessionCreateParams.PaymentMethodOptions.Eps eps) { this.eps = eps; return this; } @@ -3627,85 +3685,86 @@ public Builder putAllExtraParam(Map map) { } /** contains details about the FPX payment method options. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(SessionCreateParams.PaymentMethodOptions.Fpx fpx) { this.fpx = fpx; return this; } /** contains details about the Giropay payment method options. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(SessionCreateParams.PaymentMethodOptions.Giropay giropay) { this.giropay = giropay; return this; } /** contains details about the Grabpay payment method options. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(SessionCreateParams.PaymentMethodOptions.Grabpay grabpay) { this.grabpay = grabpay; return this; } /** contains details about the Ideal payment method options. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(SessionCreateParams.PaymentMethodOptions.Ideal ideal) { this.ideal = ideal; return this; } /** contains details about the Klarna payment method options. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(SessionCreateParams.PaymentMethodOptions.Klarna klarna) { this.klarna = klarna; return this; } /** contains details about the Konbini payment method options. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(SessionCreateParams.PaymentMethodOptions.Konbini konbini) { this.konbini = konbini; return this; } /** contains details about the OXXO payment method options. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(SessionCreateParams.PaymentMethodOptions.Oxxo oxxo) { this.oxxo = oxxo; return this; } /** contains details about the P24 payment method options. */ - public Builder setP24(P24 p24) { + public Builder setP24(SessionCreateParams.PaymentMethodOptions.P24 p24) { this.p24 = p24; return this; } /** contains details about the PayNow payment method options. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(SessionCreateParams.PaymentMethodOptions.Paynow paynow) { this.paynow = paynow; return this; } /** contains details about the Pix payment method options. */ - public Builder setPix(Pix pix) { + public Builder setPix(SessionCreateParams.PaymentMethodOptions.Pix pix) { this.pix = pix; return this; } /** contains details about the Sepa Debit payment method options. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(SessionCreateParams.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } /** contains details about the Sofort payment method options. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(SessionCreateParams.PaymentMethodOptions.Sofort sofort) { this.sofort = sofort; return this; } /** contains details about the Us Bank Account payment method options. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SessionCreateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } /** contains details about the WeChat Pay payment method options. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay(SessionCreateParams.PaymentMethodOptions.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -3785,8 +3844,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SessionCreateParams.PaymentMethodOptions.AcssDebit build() { + return new SessionCreateParams.PaymentMethodOptions.AcssDebit( this.currency, this.extraParams, this.mandateOptions, @@ -3799,7 +3858,8 @@ public AcssDebit build() { * code, in lowercase. Must be a supported * currency. This is only accepted for Checkout Sessions in {@code setup} mode. */ - public Builder setCurrency(Currency currency) { + public Builder setCurrency( + SessionCreateParams.PaymentMethodOptions.AcssDebit.Currency currency) { this.currency = currency; return this; } @@ -3833,7 +3893,8 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SessionCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -3854,13 +3915,16 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.AcssDebit.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SessionCreateParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -3882,7 +3946,8 @@ public static class MandateOptions { * {@code setup} mode. */ @SerializedName("default_for") - List defaultFor; + List + defaultFor; /** * Map of extra parameters for custom features not available in this client library. The @@ -3911,7 +3976,8 @@ public static class MandateOptions { private MandateOptions( Object customMandateUrl, - List defaultFor, + List + defaultFor, Map extraParams, String intervalDescription, PaymentSchedule paymentSchedule, @@ -3931,7 +3997,8 @@ public static Builder builder() { public static class Builder { private Object customMandateUrl; - private List defaultFor; + private List + defaultFor; private Map extraParams; @@ -3942,8 +4009,8 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SessionCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions build() { + return new SessionCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions( this.customMandateUrl, this.defaultFor, this.extraParams, @@ -3980,7 +4047,9 @@ public Builder setCustomMandateUrl(EmptyParam customMandateUrl) { * SessionCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for the * field documentation. */ - public Builder addDefaultFor(DefaultFor element) { + public Builder addDefaultFor( + SessionCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor + element) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -3994,7 +4063,9 @@ public Builder addDefaultFor(DefaultFor element) { * SessionCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for the * field documentation. */ - public Builder addAllDefaultFor(List elements) { + public Builder addAllDefaultFor( + List + elements) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4042,13 +4113,17 @@ public Builder setIntervalDescription(String intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + SessionCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions.PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + SessionCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions.TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -4199,8 +4274,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Affirm build() { + return new SessionCreateParams.PaymentMethodOptions.Affirm( + this.extraParams, this.setupFutureUsage); } /** @@ -4247,7 +4323,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Affirm.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4310,8 +4387,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.AfterpayClearpay build() { + return new SessionCreateParams.PaymentMethodOptions.AfterpayClearpay( + this.extraParams, this.setupFutureUsage); } /** @@ -4358,7 +4436,9 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.AfterpayClearpay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4421,8 +4501,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Alipay build() { + return new SessionCreateParams.PaymentMethodOptions.Alipay( + this.extraParams, this.setupFutureUsage); } /** @@ -4469,7 +4550,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Alipay.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4532,8 +4614,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.AuBecsDebit build() { + return new SessionCreateParams.PaymentMethodOptions.AuBecsDebit( + this.extraParams, this.setupFutureUsage); } /** @@ -4580,7 +4663,9 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.AuBecsDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4643,8 +4728,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.BacsDebit build() { + return new SessionCreateParams.PaymentMethodOptions.BacsDebit( + this.extraParams, this.setupFutureUsage); } /** @@ -4691,7 +4777,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.BacsDebit.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4760,8 +4847,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Bancontact build() { + return new SessionCreateParams.PaymentMethodOptions.Bancontact( + this.extraParams, this.setupFutureUsage); } /** @@ -4808,7 +4896,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Bancontact.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4885,8 +4974,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.expiresAfterDays, this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Boleto build() { + return new SessionCreateParams.PaymentMethodOptions.Boleto( + this.expiresAfterDays, this.extraParams, this.setupFutureUsage); } /** @@ -4943,7 +5033,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Boleto.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5050,8 +5141,8 @@ public static class Builder { private String statementDescriptorSuffixKanji; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public SessionCreateParams.PaymentMethodOptions.Card build() { + return new SessionCreateParams.PaymentMethodOptions.Card( this.extraParams, this.installments, this.setupFutureUsage, @@ -5088,7 +5179,8 @@ public Builder putAllExtraParam(Map map) { } /** Installment options for card payments. */ - public Builder setInstallments(Installments installments) { + public Builder setInstallments( + SessionCreateParams.PaymentMethodOptions.Card.Installments installments) { this.installments = installments; return this; } @@ -5109,7 +5201,8 @@ public Builder setInstallments(Installments installments) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Card.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5142,9 +5235,8 @@ public Builder setStatementDescriptorSuffixKanji(String statementDescriptorSuffi @Getter public static class Installments { /** - * Setting to true enables installments for this PaymentIntent. This will cause the response - * to contain a list of available installment plans. Setting to false will prevent any - * selected plan from applying to a charge. + * Setting to true enables installments for this Checkout Session. Setting to false will + * prevent any installment plan from applying to a payment. */ @SerializedName("enabled") Boolean enabled; @@ -5159,17 +5251,9 @@ public static class Installments { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The selected installment plan to use for this payment attempt. This parameter can only be - * provided during confirmation. - */ - @SerializedName("plan") - Object plan; - - private Installments(Boolean enabled, Map extraParams, Object plan) { + private Installments(Boolean enabled, Map extraParams) { this.enabled = enabled; this.extraParams = extraParams; - this.plan = plan; } public static Builder builder() { @@ -5181,17 +5265,15 @@ public static class Builder { private Map extraParams; - private Object plan; - /** Finalize and obtain parameter instance from this builder. */ - public Installments build() { - return new Installments(this.enabled, this.extraParams, this.plan); + public SessionCreateParams.PaymentMethodOptions.Card.Installments build() { + return new SessionCreateParams.PaymentMethodOptions.Card.Installments( + this.enabled, this.extraParams); } /** - * Setting to true enables installments for this PaymentIntent. This will cause the - * response to contain a list of available installment plans. Setting to false will - * prevent any selected plan from applying to a charge. + * Setting to true enables installments for this Checkout Session. Setting to false will + * prevent any installment plan from applying to a payment. */ public Builder setEnabled(Boolean enabled) { this.enabled = enabled; @@ -5225,159 +5307,6 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } - - /** - * The selected installment plan to use for this payment attempt. This parameter can only - * be provided during confirmation. - */ - public Builder setPlan(Plan plan) { - this.plan = plan; - return this; - } - - /** - * The selected installment plan to use for this payment attempt. This parameter can only - * be provided during confirmation. - */ - public Builder setPlan(EmptyParam plan) { - this.plan = plan; - return this; - } - } - - @Getter - public static class Plan { - /** - * For {@code fixed_count} installment plans, this is the number of installment payments - * your customer will make to their credit card. - */ - @SerializedName("count") - Long count; - - /** - * 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; - - /** - * For {@code fixed_count} installment plans, this is the interval between installment - * payments your customer will make to their credit card. One of {@code month}. - */ - @SerializedName("interval") - Interval interval; - - /** Type of installment plan, one of {@code fixed_count}. */ - @SerializedName("type") - Type type; - - private Plan(Long count, Map extraParams, Interval interval, Type type) { - this.count = count; - this.extraParams = extraParams; - this.interval = interval; - this.type = type; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Long count; - - private Map extraParams; - - private Interval interval; - - private Type type; - - /** Finalize and obtain parameter instance from this builder. */ - public Plan build() { - return new Plan(this.count, this.extraParams, this.interval, this.type); - } - - /** - * For {@code fixed_count} installment plans, this is the number of installment payments - * your customer will make to their credit card. - */ - public Builder setCount(Long count) { - this.count = count; - 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.Card.Installments.Plan#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.Card.Installments.Plan#extraParams} for the - * field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * For {@code fixed_count} installment plans, this is the interval between installment - * payments your customer will make to their credit card. One of {@code month}. - */ - public Builder setInterval(Interval interval) { - this.interval = interval; - return this; - } - - /** Type of installment plan, one of {@code fixed_count}. */ - public Builder setType(Type type) { - this.type = type; - return this; - } - } - - public enum Interval implements ApiRequestParams.EnumParam { - @SerializedName("month") - MONTH("month"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - Interval(String value) { - this.value = value; - } - } - - public enum Type implements ApiRequestParams.EnumParam { - @SerializedName("fixed_count") - FIXED_COUNT("fixed_count"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - Type(String value) { - this.value = value; - } - } } } @@ -5465,8 +5394,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance( + public SessionCreateParams.PaymentMethodOptions.CustomerBalance build() { + return new SessionCreateParams.PaymentMethodOptions.CustomerBalance( this.bankTransfer, this.extraParams, this.fundingType, this.setupFutureUsage); } @@ -5474,7 +5403,8 @@ public CustomerBalance build() { * Configuration for the bank transfer funding type, if the {@code funding_type} is set to * {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -5511,7 +5441,8 @@ public Builder putAllExtraParam(Map map) { * The funding method type to be used when there are not enough funds in the customer * balance. Permitted values include: {@code bank_transfer}. */ - public Builder setFundingType(FundingType fundingType) { + public Builder setFundingType( + SessionCreateParams.PaymentMethodOptions.CustomerBalance.FundingType fundingType) { this.fundingType = fundingType; return this; } @@ -5532,7 +5463,9 @@ public Builder setFundingType(FundingType fundingType) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.CustomerBalance.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5562,7 +5495,10 @@ public static class BankTransfer { * spei}. */ @SerializedName("requested_address_types") - List requestedAddressTypes; + List< + SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes; /** * The list of bank transfer types that this PaymentIntent is allowed to use for funding. @@ -5578,7 +5514,10 @@ public static class BankTransfer { private BankTransfer( EuBankTransfer euBankTransfer, Map extraParams, - List requestedAddressTypes, + List< + SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes, Type type) { this.euBankTransfer = euBankTransfer; this.extraParams = extraParams; @@ -5595,18 +5534,23 @@ public static class Builder { private Map extraParams; - private List requestedAddressTypes; + private List< + SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + requestedAddressTypes; private Type type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer( + public SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer build() { + return new SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer( this.euBankTransfer, this.extraParams, this.requestedAddressTypes, this.type); } /** Configuration for eu_bank_transfer funding type. */ - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -5648,7 +5592,10 @@ public Builder putAllExtraParam(Map map) { * SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addRequestedAddressType(RequestedAddressType element) { + public Builder addRequestedAddressType( + SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType + element) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -5663,7 +5610,11 @@ public Builder addRequestedAddressType(RequestedAddressType element) { * SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addAllRequestedAddressType(List elements) { + public Builder addAllRequestedAddressType( + List< + SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .RequestedAddressType> + elements) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -5679,7 +5630,8 @@ public Builder addAllRequestedAddressType(List elements) { * id_bank_transfer}, {@code jp_bank_transfer}, {@code mx_bank_transfer}, or {@code * us_bank_transfer}. */ - public Builder setType(Type type) { + public Builder setType( + SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.Type type) { this.type = type; return this; } @@ -5719,8 +5671,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer + build() { + return new SessionCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer + .EuBankTransfer(this.country, this.extraParams); } /** @@ -5879,8 +5834,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Eps build() { + return new SessionCreateParams.PaymentMethodOptions.Eps( + this.extraParams, this.setupFutureUsage); } /** @@ -5927,7 +5883,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Eps.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5990,8 +5947,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Fpx build() { + return new SessionCreateParams.PaymentMethodOptions.Fpx( + this.extraParams, this.setupFutureUsage); } /** @@ -6038,7 +5996,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Fpx.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6101,8 +6060,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Giropay build() { + return new SessionCreateParams.PaymentMethodOptions.Giropay( + this.extraParams, this.setupFutureUsage); } /** @@ -6149,7 +6109,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Giropay.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6212,8 +6173,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Grabpay build() { + return new SessionCreateParams.PaymentMethodOptions.Grabpay( + this.extraParams, this.setupFutureUsage); } /** @@ -6260,7 +6222,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Grabpay.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6323,8 +6286,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Ideal build() { + return new SessionCreateParams.PaymentMethodOptions.Ideal( + this.extraParams, this.setupFutureUsage); } /** @@ -6371,7 +6335,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Ideal.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6434,8 +6399,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Klarna build() { + return new SessionCreateParams.PaymentMethodOptions.Klarna( + this.extraParams, this.setupFutureUsage); } /** @@ -6482,7 +6448,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Klarna.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6560,8 +6527,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.expiresAfterDays, this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Konbini build() { + return new SessionCreateParams.PaymentMethodOptions.Konbini( + this.expiresAfterDays, this.extraParams, this.setupFutureUsage); } /** @@ -6619,7 +6587,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Konbini.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6696,8 +6665,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.expiresAfterDays, this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Oxxo build() { + return new SessionCreateParams.PaymentMethodOptions.Oxxo( + this.expiresAfterDays, this.extraParams, this.setupFutureUsage); } /** @@ -6754,7 +6724,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Oxxo.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6827,8 +6798,9 @@ public static class Builder { private Boolean tosShownAndAccepted; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); + public SessionCreateParams.PaymentMethodOptions.P24 build() { + return new SessionCreateParams.PaymentMethodOptions.P24( + this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); } /** @@ -6875,7 +6847,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.P24.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6954,8 +6927,9 @@ public static class Builder { private Boolean tosShownAndAccepted; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); + public SessionCreateParams.PaymentMethodOptions.Paynow build() { + return new SessionCreateParams.PaymentMethodOptions.Paynow( + this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); } /** @@ -7002,7 +6976,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Paynow.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7060,8 +7035,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pix build() { - return new Pix(this.expiresAfterSeconds, this.extraParams); + public SessionCreateParams.PaymentMethodOptions.Pix build() { + return new SessionCreateParams.PaymentMethodOptions.Pix( + this.expiresAfterSeconds, this.extraParams); } /** @@ -7147,8 +7123,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.SepaDebit build() { + return new SessionCreateParams.PaymentMethodOptions.SepaDebit( + this.extraParams, this.setupFutureUsage); } /** @@ -7195,7 +7172,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.SepaDebit.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7264,8 +7242,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.Sofort build() { + return new SessionCreateParams.PaymentMethodOptions.Sofort( + this.extraParams, this.setupFutureUsage); } /** @@ -7312,7 +7291,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Sofort.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7393,8 +7373,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SessionCreateParams.PaymentMethodOptions.UsBankAccount build() { + return new SessionCreateParams.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.setupFutureUsage, @@ -7430,7 +7410,9 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } @@ -7451,13 +7433,17 @@ public Builder setFinancialConnections(FinancialConnections financialConnections * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.UsBankAccount.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SessionCreateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -7481,10 +7467,15 @@ public static class FinancialConnections { * {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List + permissions; private FinancialConnections( - Map extraParams, List permissions) { + Map extraParams, + List< + SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions) { this.extraParams = extraParams; this.permissions = permissions; } @@ -7496,11 +7487,16 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions); + public SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + build() { + return new SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections( + this.extraParams, this.permissions); } /** @@ -7539,7 +7535,9 @@ public Builder putAllExtraParam(Map map) { * SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections.Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -7554,7 +7552,11 @@ public Builder addPermission(Permission element) { * SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + SessionCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -7681,8 +7683,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.appId, this.client, this.extraParams, this.setupFutureUsage); + public SessionCreateParams.PaymentMethodOptions.WechatPay build() { + return new SessionCreateParams.PaymentMethodOptions.WechatPay( + this.appId, this.client, this.extraParams, this.setupFutureUsage); } /** The app ID registered with WeChat Pay. Only required when client is ios or android. */ @@ -7692,7 +7695,7 @@ public Builder setAppId(String appId) { } /** The client type that the end customer will pay from. */ - public Builder setClient(Client client) { + public Builder setClient(SessionCreateParams.PaymentMethodOptions.WechatPay.Client client) { this.client = client; return this; } @@ -7741,7 +7744,8 @@ public Builder putAllExtraParam(Map map) { * dynamically optimize your payment flow and comply with regional legislation and network * rules, such as SCA. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.WechatPay.SetupFutureUsage setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -7809,8 +7813,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PhoneNumberCollection build() { - return new PhoneNumberCollection(this.enabled, this.extraParams); + public SessionCreateParams.PhoneNumberCollection build() { + return new SessionCreateParams.PhoneNumberCollection(this.enabled, this.extraParams); } /** Set to {@code true} to enable phone number collection. */ @@ -7901,8 +7905,8 @@ public static class Builder { private String onBehalfOf; /** Finalize and obtain parameter instance from this builder. */ - public SetupIntentData build() { - return new SetupIntentData( + public SessionCreateParams.SetupIntentData build() { + return new SessionCreateParams.SetupIntentData( this.description, this.extraParams, this.metadata, this.onBehalfOf); } @@ -7980,7 +7984,7 @@ public static class ShippingAddressCollection { * KP, MH, FM, NF, MP, PW, SD, SY, UM, VI}. */ @SerializedName("allowed_countries") - List allowedCountries; + List allowedCountries; /** * Map of extra parameters for custom features not available in this client library. The content @@ -7992,7 +7996,8 @@ public static class ShippingAddressCollection { Map extraParams; private ShippingAddressCollection( - List allowedCountries, Map extraParams) { + List allowedCountries, + Map extraParams) { this.allowedCountries = allowedCountries; this.extraParams = extraParams; } @@ -8002,13 +8007,14 @@ public static Builder builder() { } public static class Builder { - private List allowedCountries; + private List allowedCountries; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public ShippingAddressCollection build() { - return new ShippingAddressCollection(this.allowedCountries, this.extraParams); + public SessionCreateParams.ShippingAddressCollection build() { + return new SessionCreateParams.ShippingAddressCollection( + this.allowedCountries, this.extraParams); } /** @@ -8017,7 +8023,8 @@ public ShippingAddressCollection build() { * SessionCreateParams.ShippingAddressCollection#allowedCountries} for the field * documentation. */ - public Builder addAllowedCountry(AllowedCountry element) { + public Builder addAllowedCountry( + SessionCreateParams.ShippingAddressCollection.AllowedCountry element) { if (this.allowedCountries == null) { this.allowedCountries = new ArrayList<>(); } @@ -8031,7 +8038,8 @@ public Builder addAllowedCountry(AllowedCountry element) { * {@link SessionCreateParams.ShippingAddressCollection#allowedCountries} for the field * documentation. */ - public Builder addAllAllowedCountry(List elements) { + public Builder addAllAllowedCountry( + List elements) { if (this.allowedCountries == null) { this.allowedCountries = new ArrayList<>(); } @@ -8826,8 +8834,9 @@ public static class Builder { private ShippingRateData shippingRateData; /** Finalize and obtain parameter instance from this builder. */ - public ShippingOption build() { - return new ShippingOption(this.extraParams, this.shippingRate, this.shippingRateData); + public SessionCreateParams.ShippingOption build() { + return new SessionCreateParams.ShippingOption( + this.extraParams, this.shippingRate, this.shippingRateData); } /** @@ -8863,7 +8872,8 @@ public Builder setShippingRate(String shippingRate) { } /** Parameters to be passed to Shipping Rate creation for this shipping option. */ - public Builder setShippingRateData(ShippingRateData shippingRateData) { + public Builder setShippingRateData( + SessionCreateParams.ShippingOption.ShippingRateData shippingRateData) { this.shippingRateData = shippingRateData; return this; } @@ -8972,8 +8982,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public ShippingRateData build() { - return new ShippingRateData( + public SessionCreateParams.ShippingOption.ShippingRateData build() { + return new SessionCreateParams.ShippingOption.ShippingRateData( this.deliveryEstimate, this.displayName, this.extraParams, @@ -8988,7 +8998,8 @@ public ShippingRateData build() { * The estimated range for how long shipping will take, meant to be displayable to the * customer. This will appear on CheckoutSessions. */ - public Builder setDeliveryEstimate(DeliveryEstimate deliveryEstimate) { + public Builder setDeliveryEstimate( + SessionCreateParams.ShippingOption.ShippingRateData.DeliveryEstimate deliveryEstimate) { this.deliveryEstimate = deliveryEstimate; return this; } @@ -9034,7 +9045,8 @@ public Builder putAllExtraParam(Map map) { * Describes a fixed amount to charge for shipping. Must be present if type is {@code * fixed_amount}. */ - public Builder setFixedAmount(FixedAmount fixedAmount) { + public Builder setFixedAmount( + SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount fixedAmount) { this.fixedAmount = fixedAmount; return this; } @@ -9071,7 +9083,8 @@ public Builder putAllMetadata(Map map) { * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of * {@code inclusive}, {@code exclusive}, or {@code unspecified}. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SessionCreateParams.ShippingOption.ShippingRateData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -9089,7 +9102,7 @@ public Builder setTaxCode(String taxCode) { * The type of calculation to use on the shipping rate. Can only be {@code fixed_amount} for * now. */ - public Builder setType(Type type) { + public Builder setType(SessionCreateParams.ShippingOption.ShippingRateData.Type type) { this.type = type; return this; } @@ -9137,8 +9150,9 @@ public static class Builder { private Minimum minimum; /** Finalize and obtain parameter instance from this builder. */ - public DeliveryEstimate build() { - return new DeliveryEstimate(this.extraParams, this.maximum, this.minimum); + public SessionCreateParams.ShippingOption.ShippingRateData.DeliveryEstimate build() { + return new SessionCreateParams.ShippingOption.ShippingRateData.DeliveryEstimate( + this.extraParams, this.maximum, this.minimum); } /** @@ -9175,13 +9189,17 @@ public Builder putAllExtraParam(Map map) { * The upper bound of the estimated range. If empty, represents no upper bound i.e., * infinite. */ - public Builder setMaximum(Maximum maximum) { + public Builder setMaximum( + SessionCreateParams.ShippingOption.ShippingRateData.DeliveryEstimate.Maximum + maximum) { this.maximum = maximum; return this; } /** The lower bound of the estimated range. If empty, represents no lower bound. */ - public Builder setMinimum(Minimum minimum) { + public Builder setMinimum( + SessionCreateParams.ShippingOption.ShippingRateData.DeliveryEstimate.Minimum + minimum) { this.minimum = minimum; return this; } @@ -9225,8 +9243,10 @@ public static class Builder { private Long value; /** Finalize and obtain parameter instance from this builder. */ - public Maximum build() { - return new Maximum(this.extraParams, this.unit, this.value); + public SessionCreateParams.ShippingOption.ShippingRateData.DeliveryEstimate.Maximum + build() { + return new SessionCreateParams.ShippingOption.ShippingRateData.DeliveryEstimate + .Maximum(this.extraParams, this.unit, this.value); } /** @@ -9260,7 +9280,9 @@ public Builder putAllExtraParam(Map map) { } /** A unit of time. */ - public Builder setUnit(Unit unit) { + public Builder setUnit( + SessionCreateParams.ShippingOption.ShippingRateData.DeliveryEstimate.Maximum.Unit + unit) { this.unit = unit; return this; } @@ -9335,8 +9357,10 @@ public static class Builder { private Long value; /** Finalize and obtain parameter instance from this builder. */ - public Minimum build() { - return new Minimum(this.extraParams, this.unit, this.value); + public SessionCreateParams.ShippingOption.ShippingRateData.DeliveryEstimate.Minimum + build() { + return new SessionCreateParams.ShippingOption.ShippingRateData.DeliveryEstimate + .Minimum(this.extraParams, this.unit, this.value); } /** @@ -9370,7 +9394,9 @@ public Builder putAllExtraParam(Map map) { } /** A unit of time. */ - public Builder setUnit(Unit unit) { + public Builder setUnit( + SessionCreateParams.ShippingOption.ShippingRateData.DeliveryEstimate.Minimum.Unit + unit) { this.unit = unit; return this; } @@ -9428,7 +9454,8 @@ public static class FixedAmount { * href="https://stripe.com/docs/currencies">supported currency. */ @SerializedName("currency_options") - Map currencyOptions; + Map + currencyOptions; /** * Map of extra parameters for custom features not available in this client library. The @@ -9443,7 +9470,10 @@ public static class FixedAmount { private FixedAmount( Long amount, String currency, - Map currencyOptions, + Map< + String, + SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount.CurrencyOption> + currencyOptions, Map extraParams) { this.amount = amount; this.currency = currency; @@ -9460,13 +9490,16 @@ public static class Builder { private String currency; - private Map currencyOptions; + private Map< + String, + SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount.CurrencyOption> + currencyOptions; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public FixedAmount build() { - return new FixedAmount( + public SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount build() { + return new SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount( this.amount, this.currency, this.currencyOptions, this.extraParams); } @@ -9493,7 +9526,10 @@ public Builder setCurrency(String currency) { * SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount#currencyOptions} for * the field documentation. */ - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption( + String key, + SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount.CurrencyOption + value) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -9508,7 +9544,12 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount#currencyOptions} for * the field documentation. */ - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption( + Map< + String, + SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount + .CurrencyOption> + map) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -9589,8 +9630,10 @@ public static class Builder { private TaxBehavior taxBehavior; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption(this.amount, this.extraParams, this.taxBehavior); + public SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount.CurrencyOption + build() { + return new SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount + .CurrencyOption(this.amount, this.extraParams, this.taxBehavior); } /** A non-negative integer in cents representing how much to charge. */ @@ -9633,7 +9676,10 @@ public Builder putAllExtraParam(Map map) { * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. * One of {@code inclusive}, {@code exclusive}, or {@code unspecified}. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SessionCreateParams.ShippingOption.ShippingRateData.FixedAmount.CurrencyOption + .TaxBehavior + taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -9740,7 +9786,7 @@ public static class SubscriptionData { * using {@code line_items}. */ @SerializedName("items") - List items; + List items; /** * Set of key-value pairs that you can attach @@ -9786,7 +9832,7 @@ private SubscriptionData( List defaultTaxRates, String description, Map extraParams, - List items, + List items, Map metadata, TransferData transferData, Long trialEnd, @@ -9820,7 +9866,7 @@ public static class Builder { private Map extraParams; - private List items; + private List items; private Map metadata; @@ -9833,8 +9879,8 @@ public static class Builder { private Long trialPeriodDays; /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionData build() { - return new SubscriptionData( + public SessionCreateParams.SubscriptionData build() { + return new SessionCreateParams.SubscriptionData( this.applicationFeePercent, this.coupon, this.defaultTaxRates, @@ -9937,7 +9983,7 @@ public Builder putAllExtraParam(Map map) { * subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams.SubscriptionData#items} for the field documentation. */ - public Builder addItem(Item element) { + public Builder addItem(SessionCreateParams.SubscriptionData.Item element) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -9950,7 +9996,7 @@ public Builder addItem(Item element) { * and subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams.SubscriptionData#items} for the field documentation. */ - public Builder addAllItem(List elements) { + public Builder addAllItem(List elements) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -9988,7 +10034,8 @@ public Builder putAllMetadata(Map map) { * If specified, the funds from the subscription's invoices will be transferred to the * destination and the ID of the resulting transfers will be found on the resulting charges. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + SessionCreateParams.SubscriptionData.TransferData transferData) { this.transferData = transferData; return this; } @@ -10073,8 +10120,9 @@ public static class Builder { private List taxRates; /** Finalize and obtain parameter instance from this builder. */ - public Item build() { - return new Item(this.extraParams, this.plan, this.quantity, this.taxRates); + public SessionCreateParams.SubscriptionData.Item build() { + return new SessionCreateParams.SubscriptionData.Item( + this.extraParams, this.plan, this.quantity, this.taxRates); } /** @@ -10190,8 +10238,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SessionCreateParams.SubscriptionData.TransferData build() { + return new SessionCreateParams.SubscriptionData.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** @@ -10272,8 +10321,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TaxIdCollection build() { - return new TaxIdCollection(this.enabled, this.extraParams); + public SessionCreateParams.TaxIdCollection build() { + return new SessionCreateParams.TaxIdCollection(this.enabled, this.extraParams); } /** Set to true to enable Tax ID collection. */ diff --git a/src/main/java/com/stripe/param/checkout/SessionListParams.java b/src/main/java/com/stripe/param/checkout/SessionListParams.java index ddd9cbd233f..27de846cadb 100644 --- a/src/main/java/com/stripe/param/checkout/SessionListParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionListParams.java @@ -130,7 +130,7 @@ public Builder setCustomer(String customer) { } /** Only return the Checkout Sessions for the Customer details specified. */ - public Builder setCustomerDetails(CustomerDetails customerDetails) { + public Builder setCustomerDetails(SessionListParams.CustomerDetails customerDetails) { this.customerDetails = customerDetails; return this; } @@ -261,8 +261,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerDetails build() { - return new CustomerDetails(this.email, this.extraParams); + public SessionListParams.CustomerDetails build() { + return new SessionListParams.CustomerDetails(this.email, this.extraParams); } /** Customer's email address. */ diff --git a/src/main/java/com/stripe/param/financialconnections/AccountListParams.java b/src/main/java/com/stripe/param/financialconnections/AccountListParams.java index c97079af5f7..176a132eb83 100644 --- a/src/main/java/com/stripe/param/financialconnections/AccountListParams.java +++ b/src/main/java/com/stripe/param/financialconnections/AccountListParams.java @@ -112,7 +112,7 @@ public AccountListParams build() { * If present, only return accounts that belong to the specified account holder. {@code * account_holder[customer]} and {@code account_holder[account]} are mutually exclusive. */ - public Builder setAccountHolder(AccountHolder accountHolder) { + public Builder setAccountHolder(AccountListParams.AccountHolder accountHolder) { this.accountHolder = accountHolder; return this; } @@ -244,8 +244,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AccountHolder build() { - return new AccountHolder(this.account, this.customer, this.extraParams); + public AccountListParams.AccountHolder build() { + return new AccountListParams.AccountHolder(this.account, this.customer, this.extraParams); } /** The ID of the Stripe account whose accounts will be retrieved. */ diff --git a/src/main/java/com/stripe/param/financialconnections/AccountRefreshParams.java b/src/main/java/com/stripe/param/financialconnections/AccountRefreshParams.java index 420b797040c..d2fbdc5ce5f 100644 --- a/src/main/java/com/stripe/param/financialconnections/AccountRefreshParams.java +++ b/src/main/java/com/stripe/param/financialconnections/AccountRefreshParams.java @@ -24,15 +24,14 @@ public class AccountRefreshParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The list of account features that you would like to refresh. Either: {@code balance} or {@code - * ownership}. - */ + /** The list of account features that you would like to refresh. */ @SerializedName("features") - List features; + List features; private AccountRefreshParams( - List expand, Map extraParams, List features) { + List expand, + Map extraParams, + List features) { this.expand = expand; this.extraParams = extraParams; this.features = features; @@ -47,7 +46,7 @@ public static class Builder { private Map extraParams; - private List features; + private List features; /** Finalize and obtain parameter instance from this builder. */ public AccountRefreshParams build() { @@ -111,7 +110,7 @@ public Builder putAllExtraParam(Map map) { * subsequent calls adds additional elements to the original list. See {@link * AccountRefreshParams#features} for the field documentation. */ - public Builder addFeature(Feature element) { + public Builder addFeature(AccountRefreshParams.Feature element) { if (this.features == null) { this.features = new ArrayList<>(); } @@ -124,7 +123,7 @@ public Builder addFeature(Feature element) { * and subsequent calls adds additional elements to the original list. See {@link * AccountRefreshParams#features} for the field documentation. */ - public Builder addAllFeature(List elements) { + public Builder addAllFeature(List elements) { if (this.features == null) { this.features = new ArrayList<>(); } diff --git a/src/main/java/com/stripe/param/financialconnections/SessionCreateParams.java b/src/main/java/com/stripe/param/financialconnections/SessionCreateParams.java index fe3e2023ead..3cda76defe2 100644 --- a/src/main/java/com/stripe/param/financialconnections/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/financialconnections/SessionCreateParams.java @@ -39,7 +39,7 @@ public class SessionCreateParams extends ApiRequestParams { * payment_method}. */ @SerializedName("permissions") - List permissions; + List permissions; /** * For webview integrations only. Upon completing OAuth login in the native browser, the user will @@ -53,7 +53,7 @@ private SessionCreateParams( List expand, Map extraParams, Filters filters, - List permissions, + List permissions, String returnUrl) { this.accountHolder = accountHolder; this.expand = expand; @@ -76,7 +76,7 @@ public static class Builder { private Filters filters; - private List permissions; + private List permissions; private String returnUrl; @@ -92,7 +92,7 @@ public SessionCreateParams build() { } /** The account holder to link accounts for. */ - public Builder setAccountHolder(AccountHolder accountHolder) { + public Builder setAccountHolder(SessionCreateParams.AccountHolder accountHolder) { this.accountHolder = accountHolder; return this; } @@ -150,7 +150,7 @@ public Builder putAllExtraParam(Map map) { } /** Filters to restrict the kinds of accounts to collect. */ - public Builder setFilters(Filters filters) { + public Builder setFilters(SessionCreateParams.Filters filters) { this.filters = filters; return this; } @@ -160,7 +160,7 @@ public Builder setFilters(Filters filters) { * and subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams#permissions} for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission(SessionCreateParams.Permission element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -173,7 +173,7 @@ public Builder addPermission(Permission element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams#permissions} for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission(List elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -242,8 +242,9 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public AccountHolder build() { - return new AccountHolder(this.account, this.customer, this.extraParams, this.type); + public SessionCreateParams.AccountHolder build() { + return new SessionCreateParams.AccountHolder( + this.account, this.customer, this.extraParams, this.type); } /** @@ -291,7 +292,7 @@ public Builder putAllExtraParam(Map map) { } /** Type of account holder to collect accounts for. */ - public Builder setType(Type type) { + public Builder setType(SessionCreateParams.AccountHolder.Type type) { this.type = type; return this; } @@ -343,8 +344,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Filters build() { - return new Filters(this.countries, this.extraParams); + public SessionCreateParams.Filters build() { + return new SessionCreateParams.Filters(this.countries, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/identity/VerificationReportListParams.java b/src/main/java/com/stripe/param/identity/VerificationReportListParams.java index ea45acc8b69..385b7da2e0e 100644 --- a/src/main/java/com/stripe/param/identity/VerificationReportListParams.java +++ b/src/main/java/com/stripe/param/identity/VerificationReportListParams.java @@ -116,7 +116,7 @@ public VerificationReportListParams build() { this.verificationSession); } - public Builder setCreated(Created created) { + public Builder setCreated(VerificationReportListParams.Created created) { this.created = created; return this; } @@ -210,7 +210,7 @@ public Builder setStartingAfter(String startingAfter) { } /** Only return VerificationReports of this type. */ - public Builder setType(Type type) { + public Builder setType(VerificationReportListParams.Type type) { this.type = type; return this; } @@ -276,8 +276,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public VerificationReportListParams.Created build() { + return new VerificationReportListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java b/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java index a941b3f0321..d51e31a3d40 100644 --- a/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java +++ b/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java @@ -166,7 +166,7 @@ public Builder putAllMetadata(Map map) { } /** A set of options for the session’s verification checks. */ - public Builder setOptions(Options options) { + public Builder setOptions(VerificationSessionCreateParams.Options options) { this.options = options; return this; } @@ -181,7 +181,7 @@ public Builder setReturnUrl(String returnUrl) { * The type of verification * check to be performed. */ - public Builder setType(Type type) { + public Builder setType(VerificationSessionCreateParams.Type type) { this.type = type; return this; } @@ -220,8 +220,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Options build() { - return new Options(this.document, this.extraParams); + public VerificationSessionCreateParams.Options build() { + return new VerificationSessionCreateParams.Options(this.document, this.extraParams); } /** @@ -229,7 +229,7 @@ public Options build() { * href="https://stripe.com/docs/identity/verification-checks?type=document">document * check. */ - public Builder setDocument(Document document) { + public Builder setDocument(VerificationSessionCreateParams.Options.Document document) { this.document = document; return this; } @@ -280,7 +280,7 @@ public static class Document { * document_type_not_allowed error code. */ @SerializedName("allowed_types") - List allowedTypes; + List allowedTypes; /** * Map of extra parameters for custom features not available in this client library. The @@ -316,7 +316,7 @@ public static class Document { Boolean requireMatchingSelfie; private Document( - List allowedTypes, + List allowedTypes, Map extraParams, Boolean requireIdNumber, Boolean requireLiveCapture, @@ -333,7 +333,7 @@ public static Builder builder() { } public static class Builder { - private List allowedTypes; + private List allowedTypes; private Map extraParams; @@ -344,8 +344,8 @@ public static class Builder { private Boolean requireMatchingSelfie; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document( + public VerificationSessionCreateParams.Options.Document build() { + return new VerificationSessionCreateParams.Options.Document( this.allowedTypes, this.extraParams, this.requireIdNumber, @@ -359,7 +359,8 @@ public Document build() { * VerificationSessionCreateParams.Options.Document#allowedTypes} for the field * documentation. */ - public Builder addAllowedType(AllowedType element) { + public Builder addAllowedType( + VerificationSessionCreateParams.Options.Document.AllowedType element) { if (this.allowedTypes == null) { this.allowedTypes = new ArrayList<>(); } @@ -373,7 +374,8 @@ public Builder addAllowedType(AllowedType element) { * VerificationSessionCreateParams.Options.Document#allowedTypes} for the field * documentation. */ - public Builder addAllAllowedType(List elements) { + public Builder addAllAllowedType( + List elements) { if (this.allowedTypes == null) { this.allowedTypes = new ArrayList<>(); } diff --git a/src/main/java/com/stripe/param/identity/VerificationSessionListParams.java b/src/main/java/com/stripe/param/identity/VerificationSessionListParams.java index 7545e6fbb33..835433bdb71 100644 --- a/src/main/java/com/stripe/param/identity/VerificationSessionListParams.java +++ b/src/main/java/com/stripe/param/identity/VerificationSessionListParams.java @@ -108,7 +108,7 @@ public VerificationSessionListParams build() { this.status); } - public Builder setCreated(Created created) { + public Builder setCreated(VerificationSessionListParams.Created created) { this.created = created; return this; } @@ -206,7 +206,7 @@ public Builder setStartingAfter(String startingAfter) { * href="https://stripe.com/docs/identity/how-sessions-work">Learn more about the lifecycle of * sessions. */ - public Builder setStatus(Status status) { + public Builder setStatus(VerificationSessionListParams.Status status) { this.status = status; return this; } @@ -263,8 +263,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public VerificationSessionListParams.Created build() { + return new VerificationSessionListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/identity/VerificationSessionUpdateParams.java b/src/main/java/com/stripe/param/identity/VerificationSessionUpdateParams.java index 34b913a1a24..75df41201ac 100644 --- a/src/main/java/com/stripe/param/identity/VerificationSessionUpdateParams.java +++ b/src/main/java/com/stripe/param/identity/VerificationSessionUpdateParams.java @@ -158,7 +158,7 @@ public Builder putAllMetadata(Map map) { } /** A set of options for the session’s verification checks. */ - public Builder setOptions(Options options) { + public Builder setOptions(VerificationSessionUpdateParams.Options options) { this.options = options; return this; } @@ -167,7 +167,7 @@ public Builder setOptions(Options options) { * The type of verification * check to be performed. */ - public Builder setType(Type type) { + public Builder setType(VerificationSessionUpdateParams.Type type) { this.type = type; return this; } @@ -206,8 +206,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Options build() { - return new Options(this.document, this.extraParams); + public VerificationSessionUpdateParams.Options build() { + return new VerificationSessionUpdateParams.Options(this.document, this.extraParams); } /** @@ -215,7 +215,7 @@ public Options build() { * href="https://stripe.com/docs/identity/verification-checks?type=document">document * check. */ - public Builder setDocument(Document document) { + public Builder setDocument(VerificationSessionUpdateParams.Options.Document document) { this.document = document; return this; } @@ -266,7 +266,7 @@ public static class Document { * document_type_not_allowed error code. */ @SerializedName("allowed_types") - List allowedTypes; + List allowedTypes; /** * Map of extra parameters for custom features not available in this client library. The @@ -302,7 +302,7 @@ public static class Document { Boolean requireMatchingSelfie; private Document( - List allowedTypes, + List allowedTypes, Map extraParams, Boolean requireIdNumber, Boolean requireLiveCapture, @@ -319,7 +319,7 @@ public static Builder builder() { } public static class Builder { - private List allowedTypes; + private List allowedTypes; private Map extraParams; @@ -330,8 +330,8 @@ public static class Builder { private Boolean requireMatchingSelfie; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document( + public VerificationSessionUpdateParams.Options.Document build() { + return new VerificationSessionUpdateParams.Options.Document( this.allowedTypes, this.extraParams, this.requireIdNumber, @@ -345,7 +345,8 @@ public Document build() { * VerificationSessionUpdateParams.Options.Document#allowedTypes} for the field * documentation. */ - public Builder addAllowedType(AllowedType element) { + public Builder addAllowedType( + VerificationSessionUpdateParams.Options.Document.AllowedType element) { if (this.allowedTypes == null) { this.allowedTypes = new ArrayList<>(); } @@ -359,7 +360,8 @@ public Builder addAllowedType(AllowedType element) { * VerificationSessionUpdateParams.Options.Document#allowedTypes} for the field * documentation. */ - public Builder addAllAllowedType(List elements) { + public Builder addAllAllowedType( + List elements) { if (this.allowedTypes == null) { this.allowedTypes = new ArrayList<>(); } diff --git a/src/main/java/com/stripe/param/issuing/AuthorizationListParams.java b/src/main/java/com/stripe/param/issuing/AuthorizationListParams.java index c45c854e718..a7cf195ff8f 100644 --- a/src/main/java/com/stripe/param/issuing/AuthorizationListParams.java +++ b/src/main/java/com/stripe/param/issuing/AuthorizationListParams.java @@ -139,7 +139,7 @@ public Builder setCardholder(String cardholder) { } /** Only return authorizations that were created during the given date interval. */ - public Builder setCreated(Created created) { + public Builder setCreated(AuthorizationListParams.Created created) { this.created = created; return this; } @@ -237,7 +237,7 @@ public Builder setStartingAfter(String startingAfter) { * Only return authorizations with the given status. One of {@code pending}, {@code closed}, or * {@code reversed}. */ - public Builder setStatus(Status status) { + public Builder setStatus(AuthorizationListParams.Status status) { this.status = status; return this; } @@ -294,8 +294,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public AuthorizationListParams.Created build() { + return new AuthorizationListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/issuing/CardCreateParams.java b/src/main/java/com/stripe/param/issuing/CardCreateParams.java index d9a7b434b96..af2beb07f89 100644 --- a/src/main/java/com/stripe/param/issuing/CardCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardCreateParams.java @@ -258,13 +258,13 @@ public Builder setReplacementFor(String replacementFor) { * If {@code replacement_for} is specified, this should indicate why that card is being * replaced. */ - public Builder setReplacementReason(ReplacementReason replacementReason) { + public Builder setReplacementReason(CardCreateParams.ReplacementReason replacementReason) { this.replacementReason = replacementReason; return this; } /** The address where the card will be shipped. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(CardCreateParams.Shipping shipping) { this.shipping = shipping; return this; } @@ -274,19 +274,19 @@ public Builder setShipping(Shipping shipping) { * href="https://stripe.com/docs/issuing/controls/spending-controls">documentation for more * details. */ - public Builder setSpendingControls(SpendingControls spendingControls) { + public Builder setSpendingControls(CardCreateParams.SpendingControls spendingControls) { this.spendingControls = spendingControls; return this; } /** Whether authorizations can be approved on this card. Defaults to {@code inactive}. */ - public Builder setStatus(Status status) { + public Builder setStatus(CardCreateParams.Status status) { this.status = status; return this; } /** The type of card to issue. Possible values are {@code physical} or {@code virtual}. */ - public Builder setType(Type type) { + public Builder setType(CardCreateParams.Type type) { this.type = type; return this; } @@ -372,8 +372,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping( + public CardCreateParams.Shipping build() { + return new CardCreateParams.Shipping( this.address, this.customs, this.extraParams, @@ -385,13 +385,13 @@ public Shipping build() { } /** The address that the card is shipped to. */ - public Builder setAddress(Address address) { + public Builder setAddress(CardCreateParams.Shipping.Address address) { this.address = address; return this; } /** Customs information for the shipment. */ - public Builder setCustoms(Customs customs) { + public Builder setCustoms(CardCreateParams.Shipping.Customs customs) { this.customs = customs; return this; } @@ -441,13 +441,13 @@ public Builder setRequireSignature(Boolean requireSignature) { } /** Shipment service. */ - public Builder setService(Service service) { + public Builder setService(CardCreateParams.Shipping.Service service) { this.service = service; return this; } /** Packaging options. */ - public Builder setType(Type type) { + public Builder setType(CardCreateParams.Shipping.Type type) { this.type = type; return this; } @@ -528,8 +528,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public CardCreateParams.Shipping.Address build() { + return new CardCreateParams.Shipping.Address( this.city, this.country, this.extraParams, @@ -641,8 +641,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Customs build() { - return new Customs(this.eoriNumber, this.extraParams); + public CardCreateParams.Shipping.Customs build() { + return new CardCreateParams.Shipping.Customs(this.eoriNumber, this.extraParams); } /** @@ -727,7 +727,7 @@ public static class SpendingControls { * blocked_categories}. */ @SerializedName("allowed_categories") - List allowedCategories; + List allowedCategories; /** * Array of strings containing blockedCategories; + List blockedCategories; /** * Map of extra parameters for custom features not available in this client library. The content @@ -753,13 +753,13 @@ public static class SpendingControls { * the chain). */ @SerializedName("spending_limits") - List spendingLimits; + List spendingLimits; private SpendingControls( - List allowedCategories, - List blockedCategories, + List allowedCategories, + List blockedCategories, Map extraParams, - List spendingLimits) { + List spendingLimits) { this.allowedCategories = allowedCategories; this.blockedCategories = blockedCategories; this.extraParams = extraParams; @@ -771,17 +771,17 @@ public static Builder builder() { } public static class Builder { - private List allowedCategories; + private List allowedCategories; - private List blockedCategories; + private List blockedCategories; private Map extraParams; - private List spendingLimits; + private List spendingLimits; /** Finalize and obtain parameter instance from this builder. */ - public SpendingControls build() { - return new SpendingControls( + public CardCreateParams.SpendingControls build() { + return new CardCreateParams.SpendingControls( this.allowedCategories, this.blockedCategories, this.extraParams, this.spendingLimits); } @@ -790,7 +790,7 @@ public SpendingControls build() { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardCreateParams.SpendingControls#allowedCategories} for the field documentation. */ - public Builder addAllowedCategory(AllowedCategory element) { + public Builder addAllowedCategory(CardCreateParams.SpendingControls.AllowedCategory element) { if (this.allowedCategories == null) { this.allowedCategories = new ArrayList<>(); } @@ -803,7 +803,8 @@ public Builder addAllowedCategory(AllowedCategory element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardCreateParams.SpendingControls#allowedCategories} for the field documentation. */ - public Builder addAllAllowedCategory(List elements) { + public Builder addAllAllowedCategory( + List elements) { if (this.allowedCategories == null) { this.allowedCategories = new ArrayList<>(); } @@ -816,7 +817,7 @@ public Builder addAllAllowedCategory(List elements) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardCreateParams.SpendingControls#blockedCategories} for the field documentation. */ - public Builder addBlockedCategory(BlockedCategory element) { + public Builder addBlockedCategory(CardCreateParams.SpendingControls.BlockedCategory element) { if (this.blockedCategories == null) { this.blockedCategories = new ArrayList<>(); } @@ -829,7 +830,8 @@ public Builder addBlockedCategory(BlockedCategory element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardCreateParams.SpendingControls#blockedCategories} for the field documentation. */ - public Builder addAllBlockedCategory(List elements) { + public Builder addAllBlockedCategory( + List elements) { if (this.blockedCategories == null) { this.blockedCategories = new ArrayList<>(); } @@ -868,7 +870,7 @@ public Builder putAllExtraParam(Map map) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardCreateParams.SpendingControls#spendingLimits} for the field documentation. */ - public Builder addSpendingLimit(SpendingLimit element) { + public Builder addSpendingLimit(CardCreateParams.SpendingControls.SpendingLimit element) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } @@ -881,7 +883,8 @@ public Builder addSpendingLimit(SpendingLimit element) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardCreateParams.SpendingControls#spendingLimits} for the field documentation. */ - public Builder addAllSpendingLimit(List elements) { + public Builder addAllSpendingLimit( + List elements) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } @@ -902,7 +905,7 @@ public static class SpendingLimit { * this limit applies to. Omitting this field will apply the limit to all categories. */ @SerializedName("categories") - List categories; + List categories; /** * Map of extra parameters for custom features not available in this client library. The @@ -919,7 +922,7 @@ public static class SpendingLimit { private SpendingLimit( Long amount, - List categories, + List categories, Map extraParams, Interval interval) { this.amount = amount; @@ -935,15 +938,16 @@ public static Builder builder() { public static class Builder { private Long amount; - private List categories; + private List categories; private Map extraParams; private Interval interval; /** Finalize and obtain parameter instance from this builder. */ - public SpendingLimit build() { - return new SpendingLimit(this.amount, this.categories, this.extraParams, this.interval); + public CardCreateParams.SpendingControls.SpendingLimit build() { + return new CardCreateParams.SpendingControls.SpendingLimit( + this.amount, this.categories, this.extraParams, this.interval); } /** Maximum amount allowed to spend per interval. */ @@ -957,7 +961,8 @@ public Builder setAmount(Long amount) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardCreateParams.SpendingControls.SpendingLimit#categories} for the field documentation. */ - public Builder addCategory(Category element) { + public Builder addCategory( + CardCreateParams.SpendingControls.SpendingLimit.Category element) { if (this.categories == null) { this.categories = new ArrayList<>(); } @@ -970,7 +975,8 @@ public Builder addCategory(Category element) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardCreateParams.SpendingControls.SpendingLimit#categories} for the field documentation. */ - public Builder addAllCategory(List elements) { + public Builder addAllCategory( + List elements) { if (this.categories == null) { this.categories = new ArrayList<>(); } @@ -1007,7 +1013,8 @@ public Builder putAllExtraParam(Map map) { } /** Interval (or event) to which the amount applies. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + CardCreateParams.SpendingControls.SpendingLimit.Interval interval) { this.interval = interval; return this; } diff --git a/src/main/java/com/stripe/param/issuing/CardListParams.java b/src/main/java/com/stripe/param/issuing/CardListParams.java index 0265560b41b..a37b1dce4cc 100644 --- a/src/main/java/com/stripe/param/issuing/CardListParams.java +++ b/src/main/java/com/stripe/param/issuing/CardListParams.java @@ -160,7 +160,7 @@ public Builder setCardholder(String cardholder) { } /** Only return cards that were issued during the given date interval. */ - public Builder setCreated(Created created) { + public Builder setCreated(CardListParams.Created created) { this.created = created; return this; } @@ -276,13 +276,13 @@ public Builder setStartingAfter(String startingAfter) { * Only return cards that have the given status. One of {@code active}, {@code inactive}, or * {@code canceled}. */ - public Builder setStatus(Status status) { + public Builder setStatus(CardListParams.Status status) { this.status = status; return this; } /** Only return cards that have the given type. One of {@code virtual} or {@code physical}. */ - public Builder setType(Type type) { + public Builder setType(CardListParams.Type type) { this.type = type; return this; } @@ -339,8 +339,8 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public CardListParams.Created build() { + return new CardListParams.Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/issuing/CardUpdateParams.java b/src/main/java/com/stripe/param/issuing/CardUpdateParams.java index 44621a12be8..3c6f0355c56 100644 --- a/src/main/java/com/stripe/param/issuing/CardUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardUpdateParams.java @@ -107,7 +107,7 @@ public CardUpdateParams build() { } /** Reason why the {@code status} of this card is {@code canceled}. */ - public Builder setCancellationReason(CancellationReason cancellationReason) { + public Builder setCancellationReason(CardUpdateParams.CancellationReason cancellationReason) { this.cancellationReason = cancellationReason; return this; } @@ -215,7 +215,7 @@ public Builder setMetadata(Map metadata) { } /** The desired new PIN for this card. */ - public Builder setPin(Pin pin) { + public Builder setPin(CardUpdateParams.Pin pin) { this.pin = pin; return this; } @@ -225,7 +225,7 @@ public Builder setPin(Pin pin) { * href="https://stripe.com/docs/issuing/controls/spending-controls">documentation for more * details. */ - public Builder setSpendingControls(SpendingControls spendingControls) { + public Builder setSpendingControls(CardUpdateParams.SpendingControls spendingControls) { this.spendingControls = spendingControls; return this; } @@ -235,7 +235,7 @@ public Builder setSpendingControls(SpendingControls spendingControls) { * because it was lost or stolen, this information should be provided as {@code * cancellation_reason}. */ - public Builder setStatus(Status status) { + public Builder setStatus(CardUpdateParams.Status status) { this.status = status; return this; } @@ -271,8 +271,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Pin build() { - return new Pin(this.encryptedNumber, this.extraParams); + public CardUpdateParams.Pin build() { + return new CardUpdateParams.Pin(this.encryptedNumber, this.extraParams); } /** The card's desired new PIN, encrypted under Stripe's public key. */ @@ -324,7 +324,7 @@ public static class SpendingControls { * blocked_categories}. */ @SerializedName("allowed_categories") - List allowedCategories; + List allowedCategories; /** * Array of strings containing blockedCategories; + List blockedCategories; /** * Map of extra parameters for custom features not available in this client library. The content @@ -350,13 +350,13 @@ public static class SpendingControls { * the chain). */ @SerializedName("spending_limits") - List spendingLimits; + List spendingLimits; private SpendingControls( - List allowedCategories, - List blockedCategories, + List allowedCategories, + List blockedCategories, Map extraParams, - List spendingLimits) { + List spendingLimits) { this.allowedCategories = allowedCategories; this.blockedCategories = blockedCategories; this.extraParams = extraParams; @@ -368,17 +368,17 @@ public static Builder builder() { } public static class Builder { - private List allowedCategories; + private List allowedCategories; - private List blockedCategories; + private List blockedCategories; private Map extraParams; - private List spendingLimits; + private List spendingLimits; /** Finalize and obtain parameter instance from this builder. */ - public SpendingControls build() { - return new SpendingControls( + public CardUpdateParams.SpendingControls build() { + return new CardUpdateParams.SpendingControls( this.allowedCategories, this.blockedCategories, this.extraParams, this.spendingLimits); } @@ -387,7 +387,7 @@ public SpendingControls build() { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardUpdateParams.SpendingControls#allowedCategories} for the field documentation. */ - public Builder addAllowedCategory(AllowedCategory element) { + public Builder addAllowedCategory(CardUpdateParams.SpendingControls.AllowedCategory element) { if (this.allowedCategories == null) { this.allowedCategories = new ArrayList<>(); } @@ -400,7 +400,8 @@ public Builder addAllowedCategory(AllowedCategory element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardUpdateParams.SpendingControls#allowedCategories} for the field documentation. */ - public Builder addAllAllowedCategory(List elements) { + public Builder addAllAllowedCategory( + List elements) { if (this.allowedCategories == null) { this.allowedCategories = new ArrayList<>(); } @@ -413,7 +414,7 @@ public Builder addAllAllowedCategory(List elements) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardUpdateParams.SpendingControls#blockedCategories} for the field documentation. */ - public Builder addBlockedCategory(BlockedCategory element) { + public Builder addBlockedCategory(CardUpdateParams.SpendingControls.BlockedCategory element) { if (this.blockedCategories == null) { this.blockedCategories = new ArrayList<>(); } @@ -426,7 +427,8 @@ public Builder addBlockedCategory(BlockedCategory element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardUpdateParams.SpendingControls#blockedCategories} for the field documentation. */ - public Builder addAllBlockedCategory(List elements) { + public Builder addAllBlockedCategory( + List elements) { if (this.blockedCategories == null) { this.blockedCategories = new ArrayList<>(); } @@ -465,7 +467,7 @@ public Builder putAllExtraParam(Map map) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardUpdateParams.SpendingControls#spendingLimits} for the field documentation. */ - public Builder addSpendingLimit(SpendingLimit element) { + public Builder addSpendingLimit(CardUpdateParams.SpendingControls.SpendingLimit element) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } @@ -478,7 +480,8 @@ public Builder addSpendingLimit(SpendingLimit element) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardUpdateParams.SpendingControls#spendingLimits} for the field documentation. */ - public Builder addAllSpendingLimit(List elements) { + public Builder addAllSpendingLimit( + List elements) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } @@ -499,7 +502,7 @@ public static class SpendingLimit { * this limit applies to. Omitting this field will apply the limit to all categories. */ @SerializedName("categories") - List categories; + List categories; /** * Map of extra parameters for custom features not available in this client library. The @@ -516,7 +519,7 @@ public static class SpendingLimit { private SpendingLimit( Long amount, - List categories, + List categories, Map extraParams, Interval interval) { this.amount = amount; @@ -532,15 +535,16 @@ public static Builder builder() { public static class Builder { private Long amount; - private List categories; + private List categories; private Map extraParams; private Interval interval; /** Finalize and obtain parameter instance from this builder. */ - public SpendingLimit build() { - return new SpendingLimit(this.amount, this.categories, this.extraParams, this.interval); + public CardUpdateParams.SpendingControls.SpendingLimit build() { + return new CardUpdateParams.SpendingControls.SpendingLimit( + this.amount, this.categories, this.extraParams, this.interval); } /** Maximum amount allowed to spend per interval. */ @@ -554,7 +558,8 @@ public Builder setAmount(Long amount) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardUpdateParams.SpendingControls.SpendingLimit#categories} for the field documentation. */ - public Builder addCategory(Category element) { + public Builder addCategory( + CardUpdateParams.SpendingControls.SpendingLimit.Category element) { if (this.categories == null) { this.categories = new ArrayList<>(); } @@ -567,7 +572,8 @@ public Builder addCategory(Category element) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardUpdateParams.SpendingControls.SpendingLimit#categories} for the field documentation. */ - public Builder addAllCategory(List elements) { + public Builder addAllCategory( + List elements) { if (this.categories == null) { this.categories = new ArrayList<>(); } @@ -604,7 +610,8 @@ public Builder putAllExtraParam(Map map) { } /** Interval (or event) to which the amount applies. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + CardUpdateParams.SpendingControls.SpendingLimit.Interval interval) { this.interval = interval; return this; } diff --git a/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java b/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java index 49174d32373..484f88ae009 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java @@ -159,13 +159,13 @@ public CardholderCreateParams build() { } /** The cardholder's billing address. */ - public Builder setBilling(Billing billing) { + public Builder setBilling(CardholderCreateParams.Billing billing) { this.billing = billing; return this; } /** Additional information about a {@code company} cardholder. */ - public Builder setCompany(Company company) { + public Builder setCompany(CardholderCreateParams.Company company) { this.company = company; return this; } @@ -229,7 +229,7 @@ public Builder putAllExtraParam(Map map) { } /** Additional information about an {@code individual} cardholder. */ - public Builder setIndividual(Individual individual) { + public Builder setIndividual(CardholderCreateParams.Individual individual) { this.individual = individual; return this; } @@ -286,7 +286,7 @@ public Builder setPhoneNumber(String phoneNumber) { * href="https://stripe.com/docs/issuing/controls/spending-controls">documentation for more * details. */ - public Builder setSpendingControls(SpendingControls spendingControls) { + public Builder setSpendingControls(CardholderCreateParams.SpendingControls spendingControls) { this.spendingControls = spendingControls; return this; } @@ -295,13 +295,13 @@ public Builder setSpendingControls(SpendingControls spendingControls) { * Specifies whether to permit authorizations on this cardholder's cards. Defaults to {@code * active}. */ - public Builder setStatus(Status status) { + public Builder setStatus(CardholderCreateParams.Status status) { this.status = status; return this; } /** One of {@code individual} or {@code company}. */ - public Builder setType(Type type) { + public Builder setType(CardholderCreateParams.Type type) { this.type = type; return this; } @@ -337,12 +337,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Billing build() { - return new Billing(this.address, this.extraParams); + public CardholderCreateParams.Billing build() { + return new CardholderCreateParams.Billing(this.address, this.extraParams); } /** The cardholder’s billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress(CardholderCreateParams.Billing.Address address) { this.address = address; return this; } @@ -449,8 +449,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public CardholderCreateParams.Billing.Address build() { + return new CardholderCreateParams.Billing.Address( this.city, this.country, this.extraParams, @@ -560,8 +560,8 @@ public static class Builder { private String taxId; /** Finalize and obtain parameter instance from this builder. */ - public Company build() { - return new Company(this.extraParams, this.taxId); + public CardholderCreateParams.Company build() { + return new CardholderCreateParams.Company(this.extraParams, this.taxId); } /** @@ -660,13 +660,13 @@ public static class Builder { private Verification verification; /** Finalize and obtain parameter instance from this builder. */ - public Individual build() { - return new Individual( + public CardholderCreateParams.Individual build() { + return new CardholderCreateParams.Individual( this.dob, this.extraParams, this.firstName, this.lastName, this.verification); } /** The date of birth of this cardholder. */ - public Builder setDob(Dob dob) { + public Builder setDob(CardholderCreateParams.Individual.Dob dob) { this.dob = dob; return this; } @@ -716,7 +716,7 @@ public Builder setLastName(String lastName) { } /** Government-issued ID document for this cardholder. */ - public Builder setVerification(Verification verification) { + public Builder setVerification(CardholderCreateParams.Individual.Verification verification) { this.verification = verification; return this; } @@ -766,8 +766,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public CardholderCreateParams.Individual.Dob build() { + return new CardholderCreateParams.Individual.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -848,12 +849,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Verification build() { - return new Verification(this.document, this.extraParams); + public CardholderCreateParams.Individual.Verification build() { + return new CardholderCreateParams.Individual.Verification( + this.document, this.extraParams); } /** An identifying document, either a passport or local ID card. */ - public Builder setDocument(Document document) { + public Builder setDocument( + CardholderCreateParams.Individual.Verification.Document document) { this.document = document; return this; } @@ -931,8 +934,9 @@ public static class Builder { private String front; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document(this.back, this.extraParams, this.front); + public CardholderCreateParams.Individual.Verification.Document build() { + return new CardholderCreateParams.Individual.Verification.Document( + this.back, this.extraParams, this.front); } /** @@ -994,7 +998,7 @@ public static class SpendingControls { * blocked_categories}. */ @SerializedName("allowed_categories") - List allowedCategories; + List allowedCategories; /** * Array of strings containing blockedCategories; + List blockedCategories; /** * Map of extra parameters for custom features not available in this client library. The content @@ -1016,7 +1020,7 @@ public static class SpendingControls { /** Limit spending with amount-based rules that apply across this cardholder's cards. */ @SerializedName("spending_limits") - List spendingLimits; + List spendingLimits; /** * Currency of amounts within {@code spending_limits}. Defaults to your merchant country's @@ -1026,10 +1030,10 @@ public static class SpendingControls { String spendingLimitsCurrency; private SpendingControls( - List allowedCategories, - List blockedCategories, + List allowedCategories, + List blockedCategories, Map extraParams, - List spendingLimits, + List spendingLimits, String spendingLimitsCurrency) { this.allowedCategories = allowedCategories; this.blockedCategories = blockedCategories; @@ -1043,19 +1047,19 @@ public static Builder builder() { } public static class Builder { - private List allowedCategories; + private List allowedCategories; - private List blockedCategories; + private List blockedCategories; private Map extraParams; - private List spendingLimits; + private List spendingLimits; private String spendingLimitsCurrency; /** Finalize and obtain parameter instance from this builder. */ - public SpendingControls build() { - return new SpendingControls( + public CardholderCreateParams.SpendingControls build() { + return new CardholderCreateParams.SpendingControls( this.allowedCategories, this.blockedCategories, this.extraParams, @@ -1069,7 +1073,8 @@ public SpendingControls build() { * {@link CardholderCreateParams.SpendingControls#allowedCategories} for the field * documentation. */ - public Builder addAllowedCategory(AllowedCategory element) { + public Builder addAllowedCategory( + CardholderCreateParams.SpendingControls.AllowedCategory element) { if (this.allowedCategories == null) { this.allowedCategories = new ArrayList<>(); } @@ -1083,7 +1088,8 @@ public Builder addAllowedCategory(AllowedCategory element) { * {@link CardholderCreateParams.SpendingControls#allowedCategories} for the field * documentation. */ - public Builder addAllAllowedCategory(List elements) { + public Builder addAllAllowedCategory( + List elements) { if (this.allowedCategories == null) { this.allowedCategories = new ArrayList<>(); } @@ -1097,7 +1103,8 @@ public Builder addAllAllowedCategory(List elements) { * {@link CardholderCreateParams.SpendingControls#blockedCategories} for the field * documentation. */ - public Builder addBlockedCategory(BlockedCategory element) { + public Builder addBlockedCategory( + CardholderCreateParams.SpendingControls.BlockedCategory element) { if (this.blockedCategories == null) { this.blockedCategories = new ArrayList<>(); } @@ -1111,7 +1118,8 @@ public Builder addBlockedCategory(BlockedCategory element) { * {@link CardholderCreateParams.SpendingControls#blockedCategories} for the field * documentation. */ - public Builder addAllBlockedCategory(List elements) { + public Builder addAllBlockedCategory( + List elements) { if (this.blockedCategories == null) { this.blockedCategories = new ArrayList<>(); } @@ -1151,7 +1159,8 @@ public Builder putAllExtraParam(Map map) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardholderCreateParams.SpendingControls#spendingLimits} for the field documentation. */ - public Builder addSpendingLimit(SpendingLimit element) { + public Builder addSpendingLimit( + CardholderCreateParams.SpendingControls.SpendingLimit element) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } @@ -1164,7 +1173,8 @@ public Builder addSpendingLimit(SpendingLimit element) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardholderCreateParams.SpendingControls#spendingLimits} for the field documentation. */ - public Builder addAllSpendingLimit(List elements) { + public Builder addAllSpendingLimit( + List elements) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } @@ -1194,7 +1204,7 @@ public static class SpendingLimit { * this limit applies to. Omitting this field will apply the limit to all categories. */ @SerializedName("categories") - List categories; + List categories; /** * Map of extra parameters for custom features not available in this client library. The @@ -1211,7 +1221,7 @@ public static class SpendingLimit { private SpendingLimit( Long amount, - List categories, + List categories, Map extraParams, Interval interval) { this.amount = amount; @@ -1227,15 +1237,16 @@ public static Builder builder() { public static class Builder { private Long amount; - private List categories; + private List categories; private Map extraParams; private Interval interval; /** Finalize and obtain parameter instance from this builder. */ - public SpendingLimit build() { - return new SpendingLimit(this.amount, this.categories, this.extraParams, this.interval); + public CardholderCreateParams.SpendingControls.SpendingLimit build() { + return new CardholderCreateParams.SpendingControls.SpendingLimit( + this.amount, this.categories, this.extraParams, this.interval); } /** Maximum amount allowed to spend per interval. */ @@ -1250,7 +1261,8 @@ public Builder setAmount(Long amount) { * CardholderCreateParams.SpendingControls.SpendingLimit#categories} for the field * documentation. */ - public Builder addCategory(Category element) { + public Builder addCategory( + CardholderCreateParams.SpendingControls.SpendingLimit.Category element) { if (this.categories == null) { this.categories = new ArrayList<>(); } @@ -1264,7 +1276,8 @@ public Builder addCategory(Category element) { * CardholderCreateParams.SpendingControls.SpendingLimit#categories} for the field * documentation. */ - public Builder addAllCategory(List elements) { + public Builder addAllCategory( + List elements) { if (this.categories == null) { this.categories = new ArrayList<>(); } @@ -1301,7 +1314,8 @@ public Builder putAllExtraParam(Map map) { } /** Interval (or event) to which the amount applies. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + CardholderCreateParams.SpendingControls.SpendingLimit.Interval interval) { this.interval = interval; return this; } diff --git a/src/main/java/com/stripe/param/issuing/CardholderListParams.java b/src/main/java/com/stripe/param/issuing/CardholderListParams.java index 88c20e97865..731a34e9939 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderListParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderListParams.java @@ -138,7 +138,7 @@ public CardholderListParams build() { } /** Only return cardholders that were created during the given date interval. */ - public Builder setCreated(Created created) { + public Builder setCreated(CardholderListParams.Created created) { this.created = created; return this; } @@ -248,7 +248,7 @@ public Builder setStartingAfter(String startingAfter) { * Only return cardholders that have the given status. One of {@code active}, {@code inactive}, * or {@code blocked}. */ - public Builder setStatus(Status status) { + public Builder setStatus(CardholderListParams.Status status) { this.status = status; return this; } @@ -257,7 +257,7 @@ public Builder setStatus(Status status) { * Only return cardholders that have the given type. One of {@code individual} or {@code * company}. */ - public Builder setType(Type type) { + public Builder setType(CardholderListParams.Type type) { this.type = type; return this; } @@ -314,8 +314,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public CardholderListParams.Created build() { + return new CardholderListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java b/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java index 4cdb1e5063d..824825e5edf 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java @@ -134,13 +134,13 @@ public CardholderUpdateParams build() { } /** The cardholder's billing address. */ - public Builder setBilling(Billing billing) { + public Builder setBilling(CardholderUpdateParams.Billing billing) { this.billing = billing; return this; } /** Additional information about a {@code company} cardholder. */ - public Builder setCompany(Company company) { + public Builder setCompany(CardholderUpdateParams.Company company) { this.company = company; return this; } @@ -210,7 +210,7 @@ public Builder putAllExtraParam(Map map) { } /** Additional information about an {@code individual} cardholder. */ - public Builder setIndividual(Individual individual) { + public Builder setIndividual(CardholderUpdateParams.Individual individual) { this.individual = individual; return this; } @@ -266,13 +266,13 @@ public Builder setPhoneNumber(EmptyParam phoneNumber) { * href="https://stripe.com/docs/issuing/controls/spending-controls">documentation for more * details. */ - public Builder setSpendingControls(SpendingControls spendingControls) { + public Builder setSpendingControls(CardholderUpdateParams.SpendingControls spendingControls) { this.spendingControls = spendingControls; return this; } /** Specifies whether to permit authorizations on this cardholder's cards. */ - public Builder setStatus(Status status) { + public Builder setStatus(CardholderUpdateParams.Status status) { this.status = status; return this; } @@ -308,12 +308,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Billing build() { - return new Billing(this.address, this.extraParams); + public CardholderUpdateParams.Billing build() { + return new CardholderUpdateParams.Billing(this.address, this.extraParams); } /** The cardholder’s billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress(CardholderUpdateParams.Billing.Address address) { this.address = address; return this; } @@ -420,8 +420,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public CardholderUpdateParams.Billing.Address build() { + return new CardholderUpdateParams.Billing.Address( this.city, this.country, this.extraParams, @@ -570,8 +570,8 @@ public static class Builder { private Object taxId; /** Finalize and obtain parameter instance from this builder. */ - public Company build() { - return new Company(this.extraParams, this.taxId); + public CardholderUpdateParams.Company build() { + return new CardholderUpdateParams.Company(this.extraParams, this.taxId); } /** @@ -676,13 +676,13 @@ public static class Builder { private Verification verification; /** Finalize and obtain parameter instance from this builder. */ - public Individual build() { - return new Individual( + public CardholderUpdateParams.Individual build() { + return new CardholderUpdateParams.Individual( this.dob, this.extraParams, this.firstName, this.lastName, this.verification); } /** The date of birth of this cardholder. */ - public Builder setDob(Dob dob) { + public Builder setDob(CardholderUpdateParams.Individual.Dob dob) { this.dob = dob; return this; } @@ -750,7 +750,7 @@ public Builder setLastName(EmptyParam lastName) { } /** Government-issued ID document for this cardholder. */ - public Builder setVerification(Verification verification) { + public Builder setVerification(CardholderUpdateParams.Individual.Verification verification) { this.verification = verification; return this; } @@ -800,8 +800,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public CardholderUpdateParams.Individual.Dob build() { + return new CardholderUpdateParams.Individual.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -882,12 +883,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Verification build() { - return new Verification(this.document, this.extraParams); + public CardholderUpdateParams.Individual.Verification build() { + return new CardholderUpdateParams.Individual.Verification( + this.document, this.extraParams); } /** An identifying document, either a passport or local ID card. */ - public Builder setDocument(Document document) { + public Builder setDocument( + CardholderUpdateParams.Individual.Verification.Document document) { this.document = document; return this; } @@ -965,8 +968,9 @@ public static class Builder { private Object front; /** Finalize and obtain parameter instance from this builder. */ - public Document build() { - return new Document(this.back, this.extraParams, this.front); + public CardholderUpdateParams.Individual.Verification.Document build() { + return new CardholderUpdateParams.Individual.Verification.Document( + this.back, this.extraParams, this.front); } /** @@ -1046,7 +1050,7 @@ public static class SpendingControls { * blocked_categories}. */ @SerializedName("allowed_categories") - List allowedCategories; + List allowedCategories; /** * Array of strings containing blockedCategories; + List blockedCategories; /** * Map of extra parameters for custom features not available in this client library. The content @@ -1068,7 +1072,7 @@ public static class SpendingControls { /** Limit spending with amount-based rules that apply across this cardholder's cards. */ @SerializedName("spending_limits") - List spendingLimits; + List spendingLimits; /** * Currency of amounts within {@code spending_limits}. Defaults to your merchant country's @@ -1078,10 +1082,10 @@ public static class SpendingControls { Object spendingLimitsCurrency; private SpendingControls( - List allowedCategories, - List blockedCategories, + List allowedCategories, + List blockedCategories, Map extraParams, - List spendingLimits, + List spendingLimits, Object spendingLimitsCurrency) { this.allowedCategories = allowedCategories; this.blockedCategories = blockedCategories; @@ -1095,19 +1099,19 @@ public static Builder builder() { } public static class Builder { - private List allowedCategories; + private List allowedCategories; - private List blockedCategories; + private List blockedCategories; private Map extraParams; - private List spendingLimits; + private List spendingLimits; private Object spendingLimitsCurrency; /** Finalize and obtain parameter instance from this builder. */ - public SpendingControls build() { - return new SpendingControls( + public CardholderUpdateParams.SpendingControls build() { + return new CardholderUpdateParams.SpendingControls( this.allowedCategories, this.blockedCategories, this.extraParams, @@ -1121,7 +1125,8 @@ public SpendingControls build() { * {@link CardholderUpdateParams.SpendingControls#allowedCategories} for the field * documentation. */ - public Builder addAllowedCategory(AllowedCategory element) { + public Builder addAllowedCategory( + CardholderUpdateParams.SpendingControls.AllowedCategory element) { if (this.allowedCategories == null) { this.allowedCategories = new ArrayList<>(); } @@ -1135,7 +1140,8 @@ public Builder addAllowedCategory(AllowedCategory element) { * {@link CardholderUpdateParams.SpendingControls#allowedCategories} for the field * documentation. */ - public Builder addAllAllowedCategory(List elements) { + public Builder addAllAllowedCategory( + List elements) { if (this.allowedCategories == null) { this.allowedCategories = new ArrayList<>(); } @@ -1149,7 +1155,8 @@ public Builder addAllAllowedCategory(List elements) { * {@link CardholderUpdateParams.SpendingControls#blockedCategories} for the field * documentation. */ - public Builder addBlockedCategory(BlockedCategory element) { + public Builder addBlockedCategory( + CardholderUpdateParams.SpendingControls.BlockedCategory element) { if (this.blockedCategories == null) { this.blockedCategories = new ArrayList<>(); } @@ -1163,7 +1170,8 @@ public Builder addBlockedCategory(BlockedCategory element) { * {@link CardholderUpdateParams.SpendingControls#blockedCategories} for the field * documentation. */ - public Builder addAllBlockedCategory(List elements) { + public Builder addAllBlockedCategory( + List elements) { if (this.blockedCategories == null) { this.blockedCategories = new ArrayList<>(); } @@ -1203,7 +1211,8 @@ public Builder putAllExtraParam(Map map) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardholderUpdateParams.SpendingControls#spendingLimits} for the field documentation. */ - public Builder addSpendingLimit(SpendingLimit element) { + public Builder addSpendingLimit( + CardholderUpdateParams.SpendingControls.SpendingLimit element) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } @@ -1216,7 +1225,8 @@ public Builder addSpendingLimit(SpendingLimit element) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardholderUpdateParams.SpendingControls#spendingLimits} for the field documentation. */ - public Builder addAllSpendingLimit(List elements) { + public Builder addAllSpendingLimit( + List elements) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } @@ -1255,7 +1265,7 @@ public static class SpendingLimit { * this limit applies to. Omitting this field will apply the limit to all categories. */ @SerializedName("categories") - List categories; + List categories; /** * Map of extra parameters for custom features not available in this client library. The @@ -1272,7 +1282,7 @@ public static class SpendingLimit { private SpendingLimit( Long amount, - List categories, + List categories, Map extraParams, Interval interval) { this.amount = amount; @@ -1288,15 +1298,16 @@ public static Builder builder() { public static class Builder { private Long amount; - private List categories; + private List categories; private Map extraParams; private Interval interval; /** Finalize and obtain parameter instance from this builder. */ - public SpendingLimit build() { - return new SpendingLimit(this.amount, this.categories, this.extraParams, this.interval); + public CardholderUpdateParams.SpendingControls.SpendingLimit build() { + return new CardholderUpdateParams.SpendingControls.SpendingLimit( + this.amount, this.categories, this.extraParams, this.interval); } /** Maximum amount allowed to spend per interval. */ @@ -1311,7 +1322,8 @@ public Builder setAmount(Long amount) { * CardholderUpdateParams.SpendingControls.SpendingLimit#categories} for the field * documentation. */ - public Builder addCategory(Category element) { + public Builder addCategory( + CardholderUpdateParams.SpendingControls.SpendingLimit.Category element) { if (this.categories == null) { this.categories = new ArrayList<>(); } @@ -1325,7 +1337,8 @@ public Builder addCategory(Category element) { * CardholderUpdateParams.SpendingControls.SpendingLimit#categories} for the field * documentation. */ - public Builder addAllCategory(List elements) { + public Builder addAllCategory( + List elements) { if (this.categories == null) { this.categories = new ArrayList<>(); } @@ -1362,7 +1375,8 @@ public Builder putAllExtraParam(Map map) { } /** Interval (or event) to which the amount applies. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + CardholderUpdateParams.SpendingControls.SpendingLimit.Interval interval) { this.interval = interval; return this; } diff --git a/src/main/java/com/stripe/param/issuing/DisputeCreateParams.java b/src/main/java/com/stripe/param/issuing/DisputeCreateParams.java index 65522a7e6d1..2def571adba 100644 --- a/src/main/java/com/stripe/param/issuing/DisputeCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/DisputeCreateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -13,6 +12,14 @@ @Getter public class DisputeCreateParams extends ApiRequestParams { + /** + * The dispute amount in the card's currency and in the smallest currency unit. If not set, + * defaults to the full transaction amount. + */ + @SerializedName("amount") + Long amount; + /** Evidence provided for the dispute. */ @SerializedName("evidence") Evidence evidence; @@ -51,12 +58,14 @@ public class DisputeCreateParams extends ApiRequestParams { Treasury treasury; private DisputeCreateParams( + Long amount, Evidence evidence, List expand, Map extraParams, Map metadata, String transaction, Treasury treasury) { + this.amount = amount; this.evidence = evidence; this.expand = expand; this.extraParams = extraParams; @@ -70,6 +79,8 @@ public static Builder builder() { } public static class Builder { + private Long amount; + private Evidence evidence; private List expand; @@ -85,6 +96,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public DisputeCreateParams build() { return new DisputeCreateParams( + this.amount, this.evidence, this.expand, this.extraParams, @@ -93,8 +105,18 @@ public DisputeCreateParams build() { this.treasury); } + /** + * The dispute amount in the card's currency and in the smallest currency unit. If not + * set, defaults to the full transaction amount. + */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + /** Evidence provided for the dispute. */ - public Builder setEvidence(Evidence evidence) { + public Builder setEvidence(DisputeCreateParams.Evidence evidence) { this.evidence = evidence; return this; } @@ -187,7 +209,7 @@ public Builder setTransaction(String transaction) { } /** Params for disputes related to Treasury FinancialAccounts. */ - public Builder setTreasury(Treasury treasury) { + public Builder setTreasury(DisputeCreateParams.Treasury treasury) { this.treasury = treasury; return this; } @@ -284,8 +306,8 @@ public static class Builder { private Object serviceNotAsDescribed; /** Finalize and obtain parameter instance from this builder. */ - public Evidence build() { - return new Evidence( + public DisputeCreateParams.Evidence build() { + return new DisputeCreateParams.Evidence( this.canceled, this.duplicate, this.extraParams, @@ -298,7 +320,7 @@ public Evidence build() { } /** Evidence provided when {@code reason} is 'canceled'. */ - public Builder setCanceled(Canceled canceled) { + public Builder setCanceled(DisputeCreateParams.Evidence.Canceled canceled) { this.canceled = canceled; return this; } @@ -310,7 +332,7 @@ public Builder setCanceled(EmptyParam canceled) { } /** Evidence provided when {@code reason} is 'duplicate'. */ - public Builder setDuplicate(Duplicate duplicate) { + public Builder setDuplicate(DisputeCreateParams.Evidence.Duplicate duplicate) { this.duplicate = duplicate; return this; } @@ -348,7 +370,7 @@ public Builder putAllExtraParam(Map map) { } /** Evidence provided when {@code reason} is 'fraudulent'. */ - public Builder setFraudulent(Fraudulent fraudulent) { + public Builder setFraudulent(DisputeCreateParams.Evidence.Fraudulent fraudulent) { this.fraudulent = fraudulent; return this; } @@ -361,7 +383,7 @@ public Builder setFraudulent(EmptyParam fraudulent) { /** Evidence provided when {@code reason} is 'merchandise_not_as_described'. */ public Builder setMerchandiseNotAsDescribed( - MerchandiseNotAsDescribed merchandiseNotAsDescribed) { + DisputeCreateParams.Evidence.MerchandiseNotAsDescribed merchandiseNotAsDescribed) { this.merchandiseNotAsDescribed = merchandiseNotAsDescribed; return this; } @@ -373,7 +395,7 @@ public Builder setMerchandiseNotAsDescribed(EmptyParam merchandiseNotAsDescribed } /** Evidence provided when {@code reason} is 'not_received'. */ - public Builder setNotReceived(NotReceived notReceived) { + public Builder setNotReceived(DisputeCreateParams.Evidence.NotReceived notReceived) { this.notReceived = notReceived; return this; } @@ -385,7 +407,7 @@ public Builder setNotReceived(EmptyParam notReceived) { } /** Evidence provided when {@code reason} is 'other'. */ - public Builder setOther(Other other) { + public Builder setOther(DisputeCreateParams.Evidence.Other other) { this.other = other; return this; } @@ -400,13 +422,14 @@ public Builder setOther(EmptyParam other) { * The reason for filing the dispute. The evidence should be submitted in the field of the * same name. */ - public Builder setReason(Reason reason) { + public Builder setReason(DisputeCreateParams.Evidence.Reason reason) { this.reason = reason; return this; } /** Evidence provided when {@code reason} is 'service_not_as_described'. */ - public Builder setServiceNotAsDescribed(ServiceNotAsDescribed serviceNotAsDescribed) { + public Builder setServiceNotAsDescribed( + DisputeCreateParams.Evidence.ServiceNotAsDescribed serviceNotAsDescribed) { this.serviceNotAsDescribed = serviceNotAsDescribed; return this; } @@ -462,11 +485,11 @@ public static class Canceled { /** Whether the product was a merchandise or service. */ @SerializedName("product_type") - EnumParam productType; + ApiRequestParams.EnumParam productType; /** Result of cardholder's attempt to return the product. */ @SerializedName("return_status") - EnumParam returnStatus; + ApiRequestParams.EnumParam returnStatus; /** Date when the product was returned or attempted to be returned. */ @SerializedName("returned_at") @@ -481,8 +504,8 @@ private Canceled( String explanation, Map extraParams, String productDescription, - EnumParam productType, - EnumParam returnStatus, + ApiRequestParams.EnumParam productType, + ApiRequestParams.EnumParam returnStatus, Object returnedAt) { this.additionalDocumentation = additionalDocumentation; this.canceledAt = canceledAt; @@ -518,15 +541,15 @@ public static class Builder { private String productDescription; - private EnumParam productType; + private ApiRequestParams.EnumParam productType; - private EnumParam returnStatus; + private ApiRequestParams.EnumParam returnStatus; private Object returnedAt; /** Finalize and obtain parameter instance from this builder. */ - public Canceled build() { - return new Canceled( + public DisputeCreateParams.Evidence.Canceled build() { + return new DisputeCreateParams.Evidence.Canceled( this.additionalDocumentation, this.canceledAt, this.cancellationPolicyProvided, @@ -641,7 +664,8 @@ public Builder setProductDescription(String productDescription) { } /** Whether the product was a merchandise or service. */ - public Builder setProductType(ProductType productType) { + public Builder setProductType( + DisputeCreateParams.Evidence.Canceled.ProductType productType) { this.productType = productType; return this; } @@ -653,7 +677,8 @@ public Builder setProductType(EmptyParam productType) { } /** Result of cardholder's attempt to return the product. */ - public Builder setReturnStatus(ReturnStatus returnStatus) { + public Builder setReturnStatus( + DisputeCreateParams.Evidence.Canceled.ReturnStatus returnStatus) { this.returnStatus = returnStatus; return this; } @@ -795,8 +820,8 @@ public static class Builder { private String originalTransaction; /** Finalize and obtain parameter instance from this builder. */ - public Duplicate build() { - return new Duplicate( + public DisputeCreateParams.Evidence.Duplicate build() { + return new DisputeCreateParams.Evidence.Duplicate( this.additionalDocumentation, this.cardStatement, this.cashReceipt, @@ -964,8 +989,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fraudulent build() { - return new Fraudulent(this.additionalDocumentation, this.explanation, this.extraParams); + public DisputeCreateParams.Evidence.Fraudulent build() { + return new DisputeCreateParams.Evidence.Fraudulent( + this.additionalDocumentation, this.explanation, this.extraParams); } /** @@ -1054,7 +1080,7 @@ public static class MerchandiseNotAsDescribed { /** Result of cardholder's attempt to return the product. */ @SerializedName("return_status") - EnumParam returnStatus; + ApiRequestParams.EnumParam returnStatus; /** Date when the product was returned or attempted to be returned. */ @SerializedName("returned_at") @@ -1066,7 +1092,7 @@ private MerchandiseNotAsDescribed( Map extraParams, Object receivedAt, String returnDescription, - EnumParam returnStatus, + ApiRequestParams.EnumParam returnStatus, Object returnedAt) { this.additionalDocumentation = additionalDocumentation; this.explanation = explanation; @@ -1092,13 +1118,13 @@ public static class Builder { private String returnDescription; - private EnumParam returnStatus; + private ApiRequestParams.EnumParam returnStatus; private Object returnedAt; /** Finalize and obtain parameter instance from this builder. */ - public MerchandiseNotAsDescribed build() { - return new MerchandiseNotAsDescribed( + public DisputeCreateParams.Evidence.MerchandiseNotAsDescribed build() { + return new DisputeCreateParams.Evidence.MerchandiseNotAsDescribed( this.additionalDocumentation, this.explanation, this.extraParams, @@ -1179,7 +1205,8 @@ public Builder setReturnDescription(String returnDescription) { } /** Result of cardholder's attempt to return the product. */ - public Builder setReturnStatus(ReturnStatus returnStatus) { + public Builder setReturnStatus( + DisputeCreateParams.Evidence.MerchandiseNotAsDescribed.ReturnStatus returnStatus) { this.returnStatus = returnStatus; return this; } @@ -1251,7 +1278,7 @@ public static class NotReceived { /** Whether the product was a merchandise or service. */ @SerializedName("product_type") - EnumParam productType; + ApiRequestParams.EnumParam productType; private NotReceived( Object additionalDocumentation, @@ -1259,7 +1286,7 @@ private NotReceived( String explanation, Map extraParams, String productDescription, - EnumParam productType) { + ApiRequestParams.EnumParam productType) { this.additionalDocumentation = additionalDocumentation; this.expectedAt = expectedAt; this.explanation = explanation; @@ -1283,11 +1310,11 @@ public static class Builder { private String productDescription; - private EnumParam productType; + private ApiRequestParams.EnumParam productType; /** Finalize and obtain parameter instance from this builder. */ - public NotReceived build() { - return new NotReceived( + public DisputeCreateParams.Evidence.NotReceived build() { + return new DisputeCreateParams.Evidence.NotReceived( this.additionalDocumentation, this.expectedAt, this.explanation, @@ -1367,7 +1394,8 @@ public Builder setProductDescription(String productDescription) { } /** Whether the product was a merchandise or service. */ - public Builder setProductType(ProductType productType) { + public Builder setProductType( + DisputeCreateParams.Evidence.NotReceived.ProductType productType) { this.productType = productType; return this; } @@ -1423,14 +1451,14 @@ public static class Other { /** Whether the product was a merchandise or service. */ @SerializedName("product_type") - EnumParam productType; + ApiRequestParams.EnumParam productType; private Other( Object additionalDocumentation, String explanation, Map extraParams, String productDescription, - EnumParam productType) { + ApiRequestParams.EnumParam productType) { this.additionalDocumentation = additionalDocumentation; this.explanation = explanation; this.extraParams = extraParams; @@ -1451,11 +1479,11 @@ public static class Builder { private String productDescription; - private EnumParam productType; + private ApiRequestParams.EnumParam productType; /** Finalize and obtain parameter instance from this builder. */ - public Other build() { - return new Other( + public DisputeCreateParams.Evidence.Other build() { + return new DisputeCreateParams.Evidence.Other( this.additionalDocumentation, this.explanation, this.extraParams, @@ -1522,7 +1550,7 @@ public Builder setProductDescription(String productDescription) { } /** Whether the product was a merchandise or service. */ - public Builder setProductType(ProductType productType) { + public Builder setProductType(DisputeCreateParams.Evidence.Other.ProductType productType) { this.productType = productType; return this; } @@ -1617,8 +1645,8 @@ public static class Builder { private Object receivedAt; /** Finalize and obtain parameter instance from this builder. */ - public ServiceNotAsDescribed build() { - return new ServiceNotAsDescribed( + public DisputeCreateParams.Evidence.ServiceNotAsDescribed build() { + return new DisputeCreateParams.Evidence.ServiceNotAsDescribed( this.additionalDocumentation, this.canceledAt, this.cancellationReason, @@ -1772,8 +1800,8 @@ public static class Builder { private String receivedDebit; /** Finalize and obtain parameter instance from this builder. */ - public Treasury build() { - return new Treasury(this.extraParams, this.receivedDebit); + public DisputeCreateParams.Treasury build() { + return new DisputeCreateParams.Treasury(this.extraParams, this.receivedDebit); } /** diff --git a/src/main/java/com/stripe/param/issuing/DisputeListParams.java b/src/main/java/com/stripe/param/issuing/DisputeListParams.java index cf0a7d7012f..79c0673eb3e 100644 --- a/src/main/java/com/stripe/param/issuing/DisputeListParams.java +++ b/src/main/java/com/stripe/param/issuing/DisputeListParams.java @@ -115,7 +115,7 @@ public DisputeListParams build() { } /** Select Issuing disputes that were created during the given date interval. */ - public Builder setCreated(Created created) { + public Builder setCreated(DisputeListParams.Created created) { this.created = created; return this; } @@ -210,7 +210,7 @@ public Builder setStartingAfter(String startingAfter) { } /** Select Issuing disputes with the given status. */ - public Builder setStatus(Status status) { + public Builder setStatus(DisputeListParams.Status status) { this.status = status; return this; } @@ -273,8 +273,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public DisputeListParams.Created build() { + return new DisputeListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/issuing/DisputeUpdateParams.java b/src/main/java/com/stripe/param/issuing/DisputeUpdateParams.java index 738d5eeb1cf..83553767fb8 100644 --- a/src/main/java/com/stripe/param/issuing/DisputeUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/DisputeUpdateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; @@ -13,6 +12,13 @@ @Getter public class DisputeUpdateParams extends ApiRequestParams { + /** + * The dispute amount in the card's currency and in the smallest currency unit. + */ + @SerializedName("amount") + Long amount; + /** Evidence provided for the dispute. */ @SerializedName("evidence") Evidence evidence; @@ -40,7 +46,12 @@ public class DisputeUpdateParams extends ApiRequestParams { Object metadata; private DisputeUpdateParams( - Evidence evidence, List expand, Map extraParams, Object metadata) { + Long amount, + Evidence evidence, + List expand, + Map extraParams, + Object metadata) { + this.amount = amount; this.evidence = evidence; this.expand = expand; this.extraParams = extraParams; @@ -52,6 +63,8 @@ public static Builder builder() { } public static class Builder { + private Long amount; + private Evidence evidence; private List expand; @@ -62,11 +75,21 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public DisputeUpdateParams build() { - return new DisputeUpdateParams(this.evidence, this.expand, this.extraParams, this.metadata); + return new DisputeUpdateParams( + this.amount, this.evidence, this.expand, this.extraParams, this.metadata); + } + + /** + * The dispute amount in the card's currency and in the smallest currency unit. + */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; } /** Evidence provided for the dispute. */ - public Builder setEvidence(Evidence evidence) { + public Builder setEvidence(DisputeUpdateParams.Evidence evidence) { this.evidence = evidence; return this; } @@ -265,8 +288,8 @@ public static class Builder { private Object serviceNotAsDescribed; /** Finalize and obtain parameter instance from this builder. */ - public Evidence build() { - return new Evidence( + public DisputeUpdateParams.Evidence build() { + return new DisputeUpdateParams.Evidence( this.canceled, this.duplicate, this.extraParams, @@ -279,7 +302,7 @@ public Evidence build() { } /** Evidence provided when {@code reason} is 'canceled'. */ - public Builder setCanceled(Canceled canceled) { + public Builder setCanceled(DisputeUpdateParams.Evidence.Canceled canceled) { this.canceled = canceled; return this; } @@ -291,7 +314,7 @@ public Builder setCanceled(EmptyParam canceled) { } /** Evidence provided when {@code reason} is 'duplicate'. */ - public Builder setDuplicate(Duplicate duplicate) { + public Builder setDuplicate(DisputeUpdateParams.Evidence.Duplicate duplicate) { this.duplicate = duplicate; return this; } @@ -329,7 +352,7 @@ public Builder putAllExtraParam(Map map) { } /** Evidence provided when {@code reason} is 'fraudulent'. */ - public Builder setFraudulent(Fraudulent fraudulent) { + public Builder setFraudulent(DisputeUpdateParams.Evidence.Fraudulent fraudulent) { this.fraudulent = fraudulent; return this; } @@ -342,7 +365,7 @@ public Builder setFraudulent(EmptyParam fraudulent) { /** Evidence provided when {@code reason} is 'merchandise_not_as_described'. */ public Builder setMerchandiseNotAsDescribed( - MerchandiseNotAsDescribed merchandiseNotAsDescribed) { + DisputeUpdateParams.Evidence.MerchandiseNotAsDescribed merchandiseNotAsDescribed) { this.merchandiseNotAsDescribed = merchandiseNotAsDescribed; return this; } @@ -354,7 +377,7 @@ public Builder setMerchandiseNotAsDescribed(EmptyParam merchandiseNotAsDescribed } /** Evidence provided when {@code reason} is 'not_received'. */ - public Builder setNotReceived(NotReceived notReceived) { + public Builder setNotReceived(DisputeUpdateParams.Evidence.NotReceived notReceived) { this.notReceived = notReceived; return this; } @@ -366,7 +389,7 @@ public Builder setNotReceived(EmptyParam notReceived) { } /** Evidence provided when {@code reason} is 'other'. */ - public Builder setOther(Other other) { + public Builder setOther(DisputeUpdateParams.Evidence.Other other) { this.other = other; return this; } @@ -381,13 +404,14 @@ public Builder setOther(EmptyParam other) { * The reason for filing the dispute. The evidence should be submitted in the field of the * same name. */ - public Builder setReason(Reason reason) { + public Builder setReason(DisputeUpdateParams.Evidence.Reason reason) { this.reason = reason; return this; } /** Evidence provided when {@code reason} is 'service_not_as_described'. */ - public Builder setServiceNotAsDescribed(ServiceNotAsDescribed serviceNotAsDescribed) { + public Builder setServiceNotAsDescribed( + DisputeUpdateParams.Evidence.ServiceNotAsDescribed serviceNotAsDescribed) { this.serviceNotAsDescribed = serviceNotAsDescribed; return this; } @@ -443,11 +467,11 @@ public static class Canceled { /** Whether the product was a merchandise or service. */ @SerializedName("product_type") - EnumParam productType; + ApiRequestParams.EnumParam productType; /** Result of cardholder's attempt to return the product. */ @SerializedName("return_status") - EnumParam returnStatus; + ApiRequestParams.EnumParam returnStatus; /** Date when the product was returned or attempted to be returned. */ @SerializedName("returned_at") @@ -462,8 +486,8 @@ private Canceled( Object explanation, Map extraParams, Object productDescription, - EnumParam productType, - EnumParam returnStatus, + ApiRequestParams.EnumParam productType, + ApiRequestParams.EnumParam returnStatus, Object returnedAt) { this.additionalDocumentation = additionalDocumentation; this.canceledAt = canceledAt; @@ -499,15 +523,15 @@ public static class Builder { private Object productDescription; - private EnumParam productType; + private ApiRequestParams.EnumParam productType; - private EnumParam returnStatus; + private ApiRequestParams.EnumParam returnStatus; private Object returnedAt; /** Finalize and obtain parameter instance from this builder. */ - public Canceled build() { - return new Canceled( + public DisputeUpdateParams.Evidence.Canceled build() { + return new DisputeUpdateParams.Evidence.Canceled( this.additionalDocumentation, this.canceledAt, this.cancellationPolicyProvided, @@ -640,7 +664,8 @@ public Builder setProductDescription(EmptyParam productDescription) { } /** Whether the product was a merchandise or service. */ - public Builder setProductType(ProductType productType) { + public Builder setProductType( + DisputeUpdateParams.Evidence.Canceled.ProductType productType) { this.productType = productType; return this; } @@ -652,7 +677,8 @@ public Builder setProductType(EmptyParam productType) { } /** Result of cardholder's attempt to return the product. */ - public Builder setReturnStatus(ReturnStatus returnStatus) { + public Builder setReturnStatus( + DisputeUpdateParams.Evidence.Canceled.ReturnStatus returnStatus) { this.returnStatus = returnStatus; return this; } @@ -794,8 +820,8 @@ public static class Builder { private Object originalTransaction; /** Finalize and obtain parameter instance from this builder. */ - public Duplicate build() { - return new Duplicate( + public DisputeUpdateParams.Evidence.Duplicate build() { + return new DisputeUpdateParams.Evidence.Duplicate( this.additionalDocumentation, this.cardStatement, this.cashReceipt, @@ -978,8 +1004,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fraudulent build() { - return new Fraudulent(this.additionalDocumentation, this.explanation, this.extraParams); + public DisputeUpdateParams.Evidence.Fraudulent build() { + return new DisputeUpdateParams.Evidence.Fraudulent( + this.additionalDocumentation, this.explanation, this.extraParams); } /** @@ -1074,7 +1101,7 @@ public static class MerchandiseNotAsDescribed { /** Result of cardholder's attempt to return the product. */ @SerializedName("return_status") - EnumParam returnStatus; + ApiRequestParams.EnumParam returnStatus; /** Date when the product was returned or attempted to be returned. */ @SerializedName("returned_at") @@ -1086,7 +1113,7 @@ private MerchandiseNotAsDescribed( Map extraParams, Object receivedAt, Object returnDescription, - EnumParam returnStatus, + ApiRequestParams.EnumParam returnStatus, Object returnedAt) { this.additionalDocumentation = additionalDocumentation; this.explanation = explanation; @@ -1112,13 +1139,13 @@ public static class Builder { private Object returnDescription; - private EnumParam returnStatus; + private ApiRequestParams.EnumParam returnStatus; private Object returnedAt; /** Finalize and obtain parameter instance from this builder. */ - public MerchandiseNotAsDescribed build() { - return new MerchandiseNotAsDescribed( + public DisputeUpdateParams.Evidence.MerchandiseNotAsDescribed build() { + return new DisputeUpdateParams.Evidence.MerchandiseNotAsDescribed( this.additionalDocumentation, this.explanation, this.extraParams, @@ -1211,7 +1238,8 @@ public Builder setReturnDescription(EmptyParam returnDescription) { } /** Result of cardholder's attempt to return the product. */ - public Builder setReturnStatus(ReturnStatus returnStatus) { + public Builder setReturnStatus( + DisputeUpdateParams.Evidence.MerchandiseNotAsDescribed.ReturnStatus returnStatus) { this.returnStatus = returnStatus; return this; } @@ -1283,7 +1311,7 @@ public static class NotReceived { /** Whether the product was a merchandise or service. */ @SerializedName("product_type") - EnumParam productType; + ApiRequestParams.EnumParam productType; private NotReceived( Object additionalDocumentation, @@ -1291,7 +1319,7 @@ private NotReceived( Object explanation, Map extraParams, Object productDescription, - EnumParam productType) { + ApiRequestParams.EnumParam productType) { this.additionalDocumentation = additionalDocumentation; this.expectedAt = expectedAt; this.explanation = explanation; @@ -1315,11 +1343,11 @@ public static class Builder { private Object productDescription; - private EnumParam productType; + private ApiRequestParams.EnumParam productType; /** Finalize and obtain parameter instance from this builder. */ - public NotReceived build() { - return new NotReceived( + public DisputeUpdateParams.Evidence.NotReceived build() { + return new DisputeUpdateParams.Evidence.NotReceived( this.additionalDocumentation, this.expectedAt, this.explanation, @@ -1411,7 +1439,8 @@ public Builder setProductDescription(EmptyParam productDescription) { } /** Whether the product was a merchandise or service. */ - public Builder setProductType(ProductType productType) { + public Builder setProductType( + DisputeUpdateParams.Evidence.NotReceived.ProductType productType) { this.productType = productType; return this; } @@ -1467,14 +1496,14 @@ public static class Other { /** Whether the product was a merchandise or service. */ @SerializedName("product_type") - EnumParam productType; + ApiRequestParams.EnumParam productType; private Other( Object additionalDocumentation, Object explanation, Map extraParams, Object productDescription, - EnumParam productType) { + ApiRequestParams.EnumParam productType) { this.additionalDocumentation = additionalDocumentation; this.explanation = explanation; this.extraParams = extraParams; @@ -1495,11 +1524,11 @@ public static class Builder { private Object productDescription; - private EnumParam productType; + private ApiRequestParams.EnumParam productType; /** Finalize and obtain parameter instance from this builder. */ - public Other build() { - return new Other( + public DisputeUpdateParams.Evidence.Other build() { + return new DisputeUpdateParams.Evidence.Other( this.additionalDocumentation, this.explanation, this.extraParams, @@ -1578,7 +1607,7 @@ public Builder setProductDescription(EmptyParam productDescription) { } /** Whether the product was a merchandise or service. */ - public Builder setProductType(ProductType productType) { + public Builder setProductType(DisputeUpdateParams.Evidence.Other.ProductType productType) { this.productType = productType; return this; } @@ -1673,8 +1702,8 @@ public static class Builder { private Object receivedAt; /** Finalize and obtain parameter instance from this builder. */ - public ServiceNotAsDescribed build() { - return new ServiceNotAsDescribed( + public DisputeUpdateParams.Evidence.ServiceNotAsDescribed build() { + return new DisputeUpdateParams.Evidence.ServiceNotAsDescribed( this.additionalDocumentation, this.canceledAt, this.cancellationReason, diff --git a/src/main/java/com/stripe/param/issuing/TransactionListParams.java b/src/main/java/com/stripe/param/issuing/TransactionListParams.java index 3170d9e6a02..fe8231244bc 100644 --- a/src/main/java/com/stripe/param/issuing/TransactionListParams.java +++ b/src/main/java/com/stripe/param/issuing/TransactionListParams.java @@ -138,7 +138,7 @@ public Builder setCardholder(String cardholder) { } /** Only return transactions that were created during the given date interval. */ - public Builder setCreated(Created created) { + public Builder setCreated(TransactionListParams.Created created) { this.created = created; return this; } @@ -235,7 +235,7 @@ public Builder setStartingAfter(String startingAfter) { /** * Only return transactions that have the given type. One of {@code capture} or {@code refund}. */ - public Builder setType(Type type) { + public Builder setType(TransactionListParams.Type type) { this.type = type; return this; } @@ -292,8 +292,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public TransactionListParams.Created build() { + return new TransactionListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/radar/ValueListCreateParams.java b/src/main/java/com/stripe/param/radar/ValueListCreateParams.java index 97ae52aba90..a584c7affef 100644 --- a/src/main/java/com/stripe/param/radar/ValueListCreateParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListCreateParams.java @@ -151,7 +151,7 @@ public Builder putAllExtraParam(Map map) { * case_sensitive_string}, or {@code customer_id}. Use {@code string} if the item type is * unknown or mixed. */ - public Builder setItemType(ItemType itemType) { + public Builder setItemType(ValueListCreateParams.ItemType itemType) { this.itemType = itemType; return this; } diff --git a/src/main/java/com/stripe/param/radar/ValueListItemListParams.java b/src/main/java/com/stripe/param/radar/ValueListItemListParams.java index 5ca87928c5c..65fdb7dd3b4 100644 --- a/src/main/java/com/stripe/param/radar/ValueListItemListParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListItemListParams.java @@ -116,7 +116,7 @@ public ValueListItemListParams build() { this.valueList); } - public Builder setCreated(Created created) { + public Builder setCreated(ValueListItemListParams.Created created) { this.created = created; return this; } @@ -276,8 +276,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public ValueListItemListParams.Created build() { + return new ValueListItemListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/radar/ValueListListParams.java b/src/main/java/com/stripe/param/radar/ValueListListParams.java index 15f6202dc09..b3451b4a3ef 100644 --- a/src/main/java/com/stripe/param/radar/ValueListListParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListListParams.java @@ -125,7 +125,7 @@ public Builder setContains(String contains) { return this; } - public Builder setCreated(Created created) { + public Builder setCreated(ValueListListParams.Created created) { this.created = created; return this; } @@ -270,8 +270,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public ValueListListParams.Created build() { + return new ValueListListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java b/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java index a2f1164f58a..a4512449941 100644 --- a/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java +++ b/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java @@ -128,7 +128,7 @@ public Builder putAllExtraParam(Map map) { * href="https://stripe.com/docs/reporting/statements/api">API Access to Reports * documentation. */ - public Builder setParameters(Parameters parameters) { + public Builder setParameters(ReportRunCreateParams.Parameters parameters) { this.parameters = parameters; return this; } @@ -238,8 +238,8 @@ public static class Builder { private Timezone timezone; /** Finalize and obtain parameter instance from this builder. */ - public Parameters build() { - return new Parameters( + public ReportRunCreateParams.Parameters build() { + return new ReportRunCreateParams.Parameters( this.columns, this.connectedAccount, this.currency, @@ -334,7 +334,8 @@ public Builder setPayout(String payout) { } /** Category of balance transactions to be included in the report run. */ - public Builder setReportingCategory(ReportingCategory reportingCategory) { + public Builder setReportingCategory( + ReportRunCreateParams.Parameters.ReportingCategory reportingCategory) { this.reportingCategory = reportingCategory; return this; } @@ -345,7 +346,7 @@ public Builder setReportingCategory(ReportingCategory reportingCategory) { * href="http://www.iana.org/time-zones">IANA Time Zone Database. Has no effect on {@code * interval_start} or {@code interval_end}. */ - public Builder setTimezone(Timezone timezone) { + public Builder setTimezone(ReportRunCreateParams.Parameters.Timezone timezone) { this.timezone = timezone; return this; } diff --git a/src/main/java/com/stripe/param/reporting/ReportRunListParams.java b/src/main/java/com/stripe/param/reporting/ReportRunListParams.java index 67094efdacb..6756944c10b 100644 --- a/src/main/java/com/stripe/param/reporting/ReportRunListParams.java +++ b/src/main/java/com/stripe/param/reporting/ReportRunListParams.java @@ -95,7 +95,7 @@ public ReportRunListParams build() { this.startingAfter); } - public Builder setCreated(Created created) { + public Builder setCreated(ReportRunListParams.Created created) { this.created = created; return this; } @@ -240,8 +240,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public ReportRunListParams.Created build() { + return new ReportRunListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java index 18413cc7a95..aa1f6b958f5 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java @@ -72,7 +72,7 @@ public ConfigurationCreateParams build() { } /** An object containing device type specific settings for BBPOS WisePOS E readers. */ - public Builder setBbposWiseposE(BbposWiseposE bbposWiseposE) { + public Builder setBbposWiseposE(ConfigurationCreateParams.BbposWiseposE bbposWiseposE) { this.bbposWiseposE = bbposWiseposE; return this; } @@ -130,7 +130,7 @@ public Builder putAllExtraParam(Map map) { } /** Tipping configurations for readers supporting on-reader tips. */ - public Builder setTipping(Tipping tipping) { + public Builder setTipping(ConfigurationCreateParams.Tipping tipping) { this.tipping = tipping; return this; } @@ -142,7 +142,7 @@ public Builder setTipping(EmptyParam tipping) { } /** An object containing device type specific settings for Verifone P400 readers. */ - public Builder setVerifoneP400(VerifoneP400 verifoneP400) { + public Builder setVerifoneP400(ConfigurationCreateParams.VerifoneP400 verifoneP400) { this.verifoneP400 = verifoneP400; return this; } @@ -178,8 +178,8 @@ public static class Builder { private Object splashscreen; /** Finalize and obtain parameter instance from this builder. */ - public BbposWiseposE build() { - return new BbposWiseposE(this.extraParams, this.splashscreen); + public ConfigurationCreateParams.BbposWiseposE build() { + return new ConfigurationCreateParams.BbposWiseposE(this.extraParams, this.splashscreen); } /** @@ -359,8 +359,8 @@ public static class Builder { private Usd usd; /** Finalize and obtain parameter instance from this builder. */ - public Tipping build() { - return new Tipping( + public ConfigurationCreateParams.Tipping build() { + return new ConfigurationCreateParams.Tipping( this.aud, this.cad, this.chf, @@ -379,37 +379,37 @@ public Tipping build() { } /** Tipping configuration for AUD. */ - public Builder setAud(Aud aud) { + public Builder setAud(ConfigurationCreateParams.Tipping.Aud aud) { this.aud = aud; return this; } /** Tipping configuration for CAD. */ - public Builder setCad(Cad cad) { + public Builder setCad(ConfigurationCreateParams.Tipping.Cad cad) { this.cad = cad; return this; } /** Tipping configuration for CHF. */ - public Builder setChf(Chf chf) { + public Builder setChf(ConfigurationCreateParams.Tipping.Chf chf) { this.chf = chf; return this; } /** Tipping configuration for CZK. */ - public Builder setCzk(Czk czk) { + public Builder setCzk(ConfigurationCreateParams.Tipping.Czk czk) { this.czk = czk; return this; } /** Tipping configuration for DKK. */ - public Builder setDkk(Dkk dkk) { + public Builder setDkk(ConfigurationCreateParams.Tipping.Dkk dkk) { this.dkk = dkk; return this; } /** Tipping configuration for EUR. */ - public Builder setEur(Eur eur) { + public Builder setEur(ConfigurationCreateParams.Tipping.Eur eur) { this.eur = eur; return this; } @@ -441,49 +441,49 @@ public Builder putAllExtraParam(Map map) { } /** Tipping configuration for GBP. */ - public Builder setGbp(Gbp gbp) { + public Builder setGbp(ConfigurationCreateParams.Tipping.Gbp gbp) { this.gbp = gbp; return this; } /** Tipping configuration for HKD. */ - public Builder setHkd(Hkd hkd) { + public Builder setHkd(ConfigurationCreateParams.Tipping.Hkd hkd) { this.hkd = hkd; return this; } /** Tipping configuration for MYR. */ - public Builder setMyr(Myr myr) { + public Builder setMyr(ConfigurationCreateParams.Tipping.Myr myr) { this.myr = myr; return this; } /** Tipping configuration for NOK. */ - public Builder setNok(Nok nok) { + public Builder setNok(ConfigurationCreateParams.Tipping.Nok nok) { this.nok = nok; return this; } /** Tipping configuration for NZD. */ - public Builder setNzd(Nzd nzd) { + public Builder setNzd(ConfigurationCreateParams.Tipping.Nzd nzd) { this.nzd = nzd; return this; } /** Tipping configuration for SEK. */ - public Builder setSek(Sek sek) { + public Builder setSek(ConfigurationCreateParams.Tipping.Sek sek) { this.sek = sek; return this; } /** Tipping configuration for SGD. */ - public Builder setSgd(Sgd sgd) { + public Builder setSgd(ConfigurationCreateParams.Tipping.Sgd sgd) { this.sgd = sgd; return this; } /** Tipping configuration for USD. */ - public Builder setUsd(Usd usd) { + public Builder setUsd(ConfigurationCreateParams.Tipping.Usd usd) { this.usd = usd; return this; } @@ -540,8 +540,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Aud build() { - return new Aud( + public ConfigurationCreateParams.Tipping.Aud build() { + return new ConfigurationCreateParams.Tipping.Aud( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -687,8 +687,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Cad build() { - return new Cad( + public ConfigurationCreateParams.Tipping.Cad build() { + return new ConfigurationCreateParams.Tipping.Cad( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -834,8 +834,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Chf build() { - return new Chf( + public ConfigurationCreateParams.Tipping.Chf build() { + return new ConfigurationCreateParams.Tipping.Chf( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -981,8 +981,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Czk build() { - return new Czk( + public ConfigurationCreateParams.Tipping.Czk build() { + return new ConfigurationCreateParams.Tipping.Czk( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1128,8 +1128,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Dkk build() { - return new Dkk( + public ConfigurationCreateParams.Tipping.Dkk build() { + return new ConfigurationCreateParams.Tipping.Dkk( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1275,8 +1275,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Eur build() { - return new Eur( + public ConfigurationCreateParams.Tipping.Eur build() { + return new ConfigurationCreateParams.Tipping.Eur( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1422,8 +1422,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Gbp build() { - return new Gbp( + public ConfigurationCreateParams.Tipping.Gbp build() { + return new ConfigurationCreateParams.Tipping.Gbp( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1569,8 +1569,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Hkd build() { - return new Hkd( + public ConfigurationCreateParams.Tipping.Hkd build() { + return new ConfigurationCreateParams.Tipping.Hkd( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1716,8 +1716,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Myr build() { - return new Myr( + public ConfigurationCreateParams.Tipping.Myr build() { + return new ConfigurationCreateParams.Tipping.Myr( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1863,8 +1863,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Nok build() { - return new Nok( + public ConfigurationCreateParams.Tipping.Nok build() { + return new ConfigurationCreateParams.Tipping.Nok( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -2010,8 +2010,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Nzd build() { - return new Nzd( + public ConfigurationCreateParams.Tipping.Nzd build() { + return new ConfigurationCreateParams.Tipping.Nzd( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -2157,8 +2157,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Sek build() { - return new Sek( + public ConfigurationCreateParams.Tipping.Sek build() { + return new ConfigurationCreateParams.Tipping.Sek( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -2304,8 +2304,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Sgd build() { - return new Sgd( + public ConfigurationCreateParams.Tipping.Sgd build() { + return new ConfigurationCreateParams.Tipping.Sgd( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -2451,8 +2451,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Usd build() { - return new Usd( + public ConfigurationCreateParams.Tipping.Usd build() { + return new ConfigurationCreateParams.Tipping.Usd( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -2578,8 +2578,8 @@ public static class Builder { private Object splashscreen; /** Finalize and obtain parameter instance from this builder. */ - public VerifoneP400 build() { - return new VerifoneP400(this.extraParams, this.splashscreen); + public ConfigurationCreateParams.VerifoneP400 build() { + return new ConfigurationCreateParams.VerifoneP400(this.extraParams, this.splashscreen); } /** diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java index 1dbb2ce000e..3068e32909a 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java @@ -72,7 +72,7 @@ public ConfigurationUpdateParams build() { } /** An object containing device type specific settings for BBPOS WisePOS E readers. */ - public Builder setBbposWiseposE(BbposWiseposE bbposWiseposE) { + public Builder setBbposWiseposE(ConfigurationUpdateParams.BbposWiseposE bbposWiseposE) { this.bbposWiseposE = bbposWiseposE; return this; } @@ -136,7 +136,7 @@ public Builder putAllExtraParam(Map map) { } /** Tipping configurations for readers supporting on-reader tips. */ - public Builder setTipping(Tipping tipping) { + public Builder setTipping(ConfigurationUpdateParams.Tipping tipping) { this.tipping = tipping; return this; } @@ -148,7 +148,7 @@ public Builder setTipping(EmptyParam tipping) { } /** An object containing device type specific settings for Verifone P400 readers. */ - public Builder setVerifoneP400(VerifoneP400 verifoneP400) { + public Builder setVerifoneP400(ConfigurationUpdateParams.VerifoneP400 verifoneP400) { this.verifoneP400 = verifoneP400; return this; } @@ -190,8 +190,8 @@ public static class Builder { private Object splashscreen; /** Finalize and obtain parameter instance from this builder. */ - public BbposWiseposE build() { - return new BbposWiseposE(this.extraParams, this.splashscreen); + public ConfigurationUpdateParams.BbposWiseposE build() { + return new ConfigurationUpdateParams.BbposWiseposE(this.extraParams, this.splashscreen); } /** @@ -371,8 +371,8 @@ public static class Builder { private Usd usd; /** Finalize and obtain parameter instance from this builder. */ - public Tipping build() { - return new Tipping( + public ConfigurationUpdateParams.Tipping build() { + return new ConfigurationUpdateParams.Tipping( this.aud, this.cad, this.chf, @@ -391,37 +391,37 @@ public Tipping build() { } /** Tipping configuration for AUD. */ - public Builder setAud(Aud aud) { + public Builder setAud(ConfigurationUpdateParams.Tipping.Aud aud) { this.aud = aud; return this; } /** Tipping configuration for CAD. */ - public Builder setCad(Cad cad) { + public Builder setCad(ConfigurationUpdateParams.Tipping.Cad cad) { this.cad = cad; return this; } /** Tipping configuration for CHF. */ - public Builder setChf(Chf chf) { + public Builder setChf(ConfigurationUpdateParams.Tipping.Chf chf) { this.chf = chf; return this; } /** Tipping configuration for CZK. */ - public Builder setCzk(Czk czk) { + public Builder setCzk(ConfigurationUpdateParams.Tipping.Czk czk) { this.czk = czk; return this; } /** Tipping configuration for DKK. */ - public Builder setDkk(Dkk dkk) { + public Builder setDkk(ConfigurationUpdateParams.Tipping.Dkk dkk) { this.dkk = dkk; return this; } /** Tipping configuration for EUR. */ - public Builder setEur(Eur eur) { + public Builder setEur(ConfigurationUpdateParams.Tipping.Eur eur) { this.eur = eur; return this; } @@ -453,49 +453,49 @@ public Builder putAllExtraParam(Map map) { } /** Tipping configuration for GBP. */ - public Builder setGbp(Gbp gbp) { + public Builder setGbp(ConfigurationUpdateParams.Tipping.Gbp gbp) { this.gbp = gbp; return this; } /** Tipping configuration for HKD. */ - public Builder setHkd(Hkd hkd) { + public Builder setHkd(ConfigurationUpdateParams.Tipping.Hkd hkd) { this.hkd = hkd; return this; } /** Tipping configuration for MYR. */ - public Builder setMyr(Myr myr) { + public Builder setMyr(ConfigurationUpdateParams.Tipping.Myr myr) { this.myr = myr; return this; } /** Tipping configuration for NOK. */ - public Builder setNok(Nok nok) { + public Builder setNok(ConfigurationUpdateParams.Tipping.Nok nok) { this.nok = nok; return this; } /** Tipping configuration for NZD. */ - public Builder setNzd(Nzd nzd) { + public Builder setNzd(ConfigurationUpdateParams.Tipping.Nzd nzd) { this.nzd = nzd; return this; } /** Tipping configuration for SEK. */ - public Builder setSek(Sek sek) { + public Builder setSek(ConfigurationUpdateParams.Tipping.Sek sek) { this.sek = sek; return this; } /** Tipping configuration for SGD. */ - public Builder setSgd(Sgd sgd) { + public Builder setSgd(ConfigurationUpdateParams.Tipping.Sgd sgd) { this.sgd = sgd; return this; } /** Tipping configuration for USD. */ - public Builder setUsd(Usd usd) { + public Builder setUsd(ConfigurationUpdateParams.Tipping.Usd usd) { this.usd = usd; return this; } @@ -552,8 +552,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Aud build() { - return new Aud( + public ConfigurationUpdateParams.Tipping.Aud build() { + return new ConfigurationUpdateParams.Tipping.Aud( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -699,8 +699,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Cad build() { - return new Cad( + public ConfigurationUpdateParams.Tipping.Cad build() { + return new ConfigurationUpdateParams.Tipping.Cad( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -846,8 +846,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Chf build() { - return new Chf( + public ConfigurationUpdateParams.Tipping.Chf build() { + return new ConfigurationUpdateParams.Tipping.Chf( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -993,8 +993,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Czk build() { - return new Czk( + public ConfigurationUpdateParams.Tipping.Czk build() { + return new ConfigurationUpdateParams.Tipping.Czk( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1140,8 +1140,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Dkk build() { - return new Dkk( + public ConfigurationUpdateParams.Tipping.Dkk build() { + return new ConfigurationUpdateParams.Tipping.Dkk( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1287,8 +1287,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Eur build() { - return new Eur( + public ConfigurationUpdateParams.Tipping.Eur build() { + return new ConfigurationUpdateParams.Tipping.Eur( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1434,8 +1434,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Gbp build() { - return new Gbp( + public ConfigurationUpdateParams.Tipping.Gbp build() { + return new ConfigurationUpdateParams.Tipping.Gbp( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1581,8 +1581,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Hkd build() { - return new Hkd( + public ConfigurationUpdateParams.Tipping.Hkd build() { + return new ConfigurationUpdateParams.Tipping.Hkd( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1728,8 +1728,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Myr build() { - return new Myr( + public ConfigurationUpdateParams.Tipping.Myr build() { + return new ConfigurationUpdateParams.Tipping.Myr( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -1875,8 +1875,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Nok build() { - return new Nok( + public ConfigurationUpdateParams.Tipping.Nok build() { + return new ConfigurationUpdateParams.Tipping.Nok( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -2022,8 +2022,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Nzd build() { - return new Nzd( + public ConfigurationUpdateParams.Tipping.Nzd build() { + return new ConfigurationUpdateParams.Tipping.Nzd( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -2169,8 +2169,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Sek build() { - return new Sek( + public ConfigurationUpdateParams.Tipping.Sek build() { + return new ConfigurationUpdateParams.Tipping.Sek( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -2316,8 +2316,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Sgd build() { - return new Sgd( + public ConfigurationUpdateParams.Tipping.Sgd build() { + return new ConfigurationUpdateParams.Tipping.Sgd( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -2463,8 +2463,8 @@ public static class Builder { private Long smartTipThreshold; /** Finalize and obtain parameter instance from this builder. */ - public Usd build() { - return new Usd( + public ConfigurationUpdateParams.Tipping.Usd build() { + return new ConfigurationUpdateParams.Tipping.Usd( this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); } @@ -2590,8 +2590,8 @@ public static class Builder { private Object splashscreen; /** Finalize and obtain parameter instance from this builder. */ - public VerifoneP400 build() { - return new VerifoneP400(this.extraParams, this.splashscreen); + public ConfigurationUpdateParams.VerifoneP400 build() { + return new ConfigurationUpdateParams.VerifoneP400(this.extraParams, this.splashscreen); } /** diff --git a/src/main/java/com/stripe/param/terminal/LocationCreateParams.java b/src/main/java/com/stripe/param/terminal/LocationCreateParams.java index f931368fa8c..bcfe6610a17 100644 --- a/src/main/java/com/stripe/param/terminal/LocationCreateParams.java +++ b/src/main/java/com/stripe/param/terminal/LocationCreateParams.java @@ -90,7 +90,7 @@ public LocationCreateParams build() { } /** The full address of the location. */ - public Builder setAddress(Address address) { + public Builder setAddress(LocationCreateParams.Address address) { this.address = address; return this; } @@ -285,8 +285,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public LocationCreateParams.Address build() { + return new LocationCreateParams.Address( this.city, this.country, this.extraParams, diff --git a/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java b/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java index 6e80ee6352e..89c466f1ed1 100644 --- a/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java +++ b/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java @@ -90,7 +90,7 @@ public LocationUpdateParams build() { } /** The full address of the location. */ - public Builder setAddress(Address address) { + public Builder setAddress(LocationUpdateParams.Address address) { this.address = address; return this; } @@ -297,8 +297,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public LocationUpdateParams.Address build() { + return new LocationUpdateParams.Address( this.city, this.country, this.extraParams, diff --git a/src/main/java/com/stripe/param/terminal/ReaderListParams.java b/src/main/java/com/stripe/param/terminal/ReaderListParams.java index ca9c731b99b..90a844a563c 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderListParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderListParams.java @@ -115,7 +115,7 @@ public ReaderListParams build() { } /** Filters readers by device type. */ - public Builder setDeviceType(DeviceType deviceType) { + public Builder setDeviceType(ReaderListParams.DeviceType deviceType) { this.deviceType = deviceType; return this; } @@ -210,7 +210,7 @@ public Builder setStartingAfter(String startingAfter) { } /** A status filter to filter readers to only offline or online readers. */ - public Builder setStatus(Status status) { + public Builder setStatus(ReaderListParams.Status status) { this.status = status; return this; } diff --git a/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java b/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java index 874d70dfb2b..cb0395e197b 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java @@ -60,7 +60,7 @@ public ReaderPresentPaymentMethodParams build() { } /** Simulated data for the card_present payment method. */ - public Builder setCardPresent(CardPresent cardPresent) { + public Builder setCardPresent(ReaderPresentPaymentMethodParams.CardPresent cardPresent) { this.cardPresent = cardPresent; return this; } @@ -118,7 +118,7 @@ public Builder putAllExtraParam(Map map) { } /** Simulated payment type. */ - public Builder setType(Type type) { + public Builder setType(ReaderPresentPaymentMethodParams.Type type) { this.type = type; return this; } @@ -154,8 +154,8 @@ public static class Builder { private String number; /** Finalize and obtain parameter instance from this builder. */ - public CardPresent build() { - return new CardPresent(this.extraParams, this.number); + public ReaderPresentPaymentMethodParams.CardPresent build() { + return new ReaderPresentPaymentMethodParams.CardPresent(this.extraParams, this.number); } /** diff --git a/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java b/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java index 1bf12d4e7fd..7fa906a2b39 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java @@ -121,7 +121,7 @@ public Builder setPaymentIntent(String paymentIntent) { } /** Configuration overrides. */ - public Builder setProcessConfig(ProcessConfig processConfig) { + public Builder setProcessConfig(ReaderProcessPaymentIntentParams.ProcessConfig processConfig) { this.processConfig = processConfig; return this; } @@ -157,8 +157,9 @@ public static class Builder { private Boolean skipTipping; /** Finalize and obtain parameter instance from this builder. */ - public ProcessConfig build() { - return new ProcessConfig(this.extraParams, this.skipTipping); + public ReaderProcessPaymentIntentParams.ProcessConfig build() { + return new ReaderProcessPaymentIntentParams.ProcessConfig( + this.extraParams, this.skipTipping); } /** diff --git a/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java b/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java index 605fee8dc15..a6affc29068 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java @@ -59,7 +59,7 @@ public ReaderSetReaderDisplayParams build() { } /** Cart. */ - public Builder setCart(Cart cart) { + public Builder setCart(ReaderSetReaderDisplayParams.Cart cart) { this.cart = cart; return this; } @@ -117,7 +117,7 @@ public Builder putAllExtraParam(Map map) { } /** Type. */ - public Builder setType(Type type) { + public Builder setType(ReaderSetReaderDisplayParams.Type type) { this.type = type; return this; } @@ -144,7 +144,7 @@ public static class Cart { /** Array of line items that were purchased. */ @SerializedName("line_items") - List lineItems; + List lineItems; /** The amount of tax in cents. */ @SerializedName("tax") @@ -157,7 +157,7 @@ public static class Cart { private Cart( String currency, Map extraParams, - List lineItems, + List lineItems, Long tax, Long total) { this.currency = currency; @@ -176,15 +176,16 @@ public static class Builder { private Map extraParams; - private List lineItems; + private List lineItems; private Long tax; private Long total; /** Finalize and obtain parameter instance from this builder. */ - public Cart build() { - return new Cart(this.currency, this.extraParams, this.lineItems, this.tax, this.total); + public ReaderSetReaderDisplayParams.Cart build() { + return new ReaderSetReaderDisplayParams.Cart( + this.currency, this.extraParams, this.lineItems, this.tax, this.total); } /** @@ -228,7 +229,7 @@ public Builder putAllExtraParam(Map map) { * and subsequent calls adds additional elements to the original list. See {@link * ReaderSetReaderDisplayParams.Cart#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(ReaderSetReaderDisplayParams.Cart.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -241,7 +242,7 @@ public Builder addLineItem(LineItem element) { * call, and subsequent calls adds additional elements to the original list. See {@link * ReaderSetReaderDisplayParams.Cart#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -307,8 +308,9 @@ public static class Builder { private Long quantity; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem(this.amount, this.description, this.extraParams, this.quantity); + public ReaderSetReaderDisplayParams.Cart.LineItem build() { + return new ReaderSetReaderDisplayParams.Cart.LineItem( + this.amount, this.description, this.extraParams, this.quantity); } /** The price of the item in cents. */ diff --git a/src/main/java/com/stripe/param/treasury/CreditReversalListParams.java b/src/main/java/com/stripe/param/treasury/CreditReversalListParams.java index 831b924bc2e..d5e3e667c03 100644 --- a/src/main/java/com/stripe/param/treasury/CreditReversalListParams.java +++ b/src/main/java/com/stripe/param/treasury/CreditReversalListParams.java @@ -210,7 +210,7 @@ public Builder setStartingAfter(String startingAfter) { } /** Only return CreditReversals for a given status. */ - public Builder setStatus(Status status) { + public Builder setStatus(CreditReversalListParams.Status status) { this.status = status; return this; } diff --git a/src/main/java/com/stripe/param/treasury/DebitReversalListParams.java b/src/main/java/com/stripe/param/treasury/DebitReversalListParams.java index 7be4c1f13d0..aa8a664955c 100644 --- a/src/main/java/com/stripe/param/treasury/DebitReversalListParams.java +++ b/src/main/java/com/stripe/param/treasury/DebitReversalListParams.java @@ -208,7 +208,7 @@ public Builder setReceivedDebit(String receivedDebit) { } /** Only return DebitReversals for a given resolution. */ - public Builder setResolution(Resolution resolution) { + public Builder setResolution(DebitReversalListParams.Resolution resolution) { this.resolution = resolution; return this; } @@ -225,7 +225,7 @@ public Builder setStartingAfter(String startingAfter) { } /** Only return DebitReversals for a given status. */ - public Builder setStatus(Status status) { + public Builder setStatus(DebitReversalListParams.Status status) { this.status = status; return this; } diff --git a/src/main/java/com/stripe/param/treasury/FinancialAccountCreateParams.java b/src/main/java/com/stripe/param/treasury/FinancialAccountCreateParams.java index 0e13b65d482..197ee6244f5 100644 --- a/src/main/java/com/stripe/param/treasury/FinancialAccountCreateParams.java +++ b/src/main/java/com/stripe/param/treasury/FinancialAccountCreateParams.java @@ -147,7 +147,7 @@ public Builder putAllExtraParam(Map map) { * Encodes whether a FinancialAccount has access to a particular feature. Stripe or the platform * can control features via the requested field. */ - public Builder setFeatures(Features features) { + public Builder setFeatures(FinancialAccountCreateParams.Features features) { this.features = features; return this; } @@ -179,7 +179,8 @@ public Builder putAllMetadata(Map map) { } /** The set of functionalities that the platform can restrict on the FinancialAccount. */ - public Builder setPlatformRestrictions(PlatformRestrictions platformRestrictions) { + public Builder setPlatformRestrictions( + FinancialAccountCreateParams.PlatformRestrictions platformRestrictions) { this.platformRestrictions = platformRestrictions; return this; } @@ -309,8 +310,8 @@ public static class Builder { private OutboundTransfers outboundTransfers; /** Finalize and obtain parameter instance from this builder. */ - public Features build() { - return new Features( + public FinancialAccountCreateParams.Features build() { + return new FinancialAccountCreateParams.Features( this.cardIssuing, this.depositInsurance, this.extraParams, @@ -325,7 +326,7 @@ public Features build() { * Encodes the FinancialAccount's ability to be used with the Issuing product, including * attaching cards to and drawing funds from the FinancialAccount. */ - public Builder setCardIssuing(CardIssuing cardIssuing) { + public Builder setCardIssuing(FinancialAccountCreateParams.Features.CardIssuing cardIssuing) { this.cardIssuing = cardIssuing; return this; } @@ -334,7 +335,8 @@ public Builder setCardIssuing(CardIssuing cardIssuing) { * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors * determine the insurance amount. */ - public Builder setDepositInsurance(DepositInsurance depositInsurance) { + public Builder setDepositInsurance( + FinancialAccountCreateParams.Features.DepositInsurance depositInsurance) { this.depositInsurance = depositInsurance; return this; } @@ -366,7 +368,8 @@ public Builder putAllExtraParam(Map map) { } /** Contains Features that add FinancialAddresses to the FinancialAccount. */ - public Builder setFinancialAddresses(FinancialAddresses financialAddresses) { + public Builder setFinancialAddresses( + FinancialAccountCreateParams.Features.FinancialAddresses financialAddresses) { this.financialAddresses = financialAddresses; return this; } @@ -375,7 +378,8 @@ public Builder setFinancialAddresses(FinancialAddresses financialAddresses) { * Contains settings related to adding funds to a FinancialAccount from another Account with * the same owner. */ - public Builder setInboundTransfers(InboundTransfers inboundTransfers) { + public Builder setInboundTransfers( + FinancialAccountCreateParams.Features.InboundTransfers inboundTransfers) { this.inboundTransfers = inboundTransfers; return this; } @@ -384,7 +388,8 @@ public Builder setInboundTransfers(InboundTransfers inboundTransfers) { * Represents the ability for the FinancialAccount to send money to, or receive money from * other FinancialAccounts (for example, via OutboundPayment). */ - public Builder setIntraStripeFlows(IntraStripeFlows intraStripeFlows) { + public Builder setIntraStripeFlows( + FinancialAccountCreateParams.Features.IntraStripeFlows intraStripeFlows) { this.intraStripeFlows = intraStripeFlows; return this; } @@ -393,7 +398,8 @@ public Builder setIntraStripeFlows(IntraStripeFlows intraStripeFlows) { * Includes Features related to initiating money movement out of the FinancialAccount to * someone else's bucket of money. */ - public Builder setOutboundPayments(OutboundPayments outboundPayments) { + public Builder setOutboundPayments( + FinancialAccountCreateParams.Features.OutboundPayments outboundPayments) { this.outboundPayments = outboundPayments; return this; } @@ -402,7 +408,8 @@ public Builder setOutboundPayments(OutboundPayments outboundPayments) { * Contains a Feature and settings related to moving money out of the FinancialAccount into * another Account with the same owner. */ - public Builder setOutboundTransfers(OutboundTransfers outboundTransfers) { + public Builder setOutboundTransfers( + FinancialAccountCreateParams.Features.OutboundTransfers outboundTransfers) { this.outboundTransfers = outboundTransfers; return this; } @@ -438,8 +445,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public CardIssuing build() { - return new CardIssuing(this.extraParams, this.requested); + public FinancialAccountCreateParams.Features.CardIssuing build() { + return new FinancialAccountCreateParams.Features.CardIssuing( + this.extraParams, this.requested); } /** @@ -508,8 +516,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public DepositInsurance build() { - return new DepositInsurance(this.extraParams, this.requested); + public FinancialAccountCreateParams.Features.DepositInsurance build() { + return new FinancialAccountCreateParams.Features.DepositInsurance( + this.extraParams, this.requested); } /** @@ -578,12 +587,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public FinancialAddresses build() { - return new FinancialAddresses(this.aba, this.extraParams); + public FinancialAccountCreateParams.Features.FinancialAddresses build() { + return new FinancialAccountCreateParams.Features.FinancialAddresses( + this.aba, this.extraParams); } /** Adds an ABA FinancialAddress to the FinancialAccount. */ - public Builder setAba(Aba aba) { + public Builder setAba(FinancialAccountCreateParams.Features.FinancialAddresses.Aba aba) { this.aba = aba; return this; } @@ -648,8 +658,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Aba build() { - return new Aba(this.extraParams, this.requested); + public FinancialAccountCreateParams.Features.FinancialAddresses.Aba build() { + return new FinancialAccountCreateParams.Features.FinancialAddresses.Aba( + this.extraParams, this.requested); } /** @@ -721,12 +732,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InboundTransfers build() { - return new InboundTransfers(this.ach, this.extraParams); + public FinancialAccountCreateParams.Features.InboundTransfers build() { + return new FinancialAccountCreateParams.Features.InboundTransfers( + this.ach, this.extraParams); } /** Enables ACH Debits via the InboundTransfers API. */ - public Builder setAch(Ach ach) { + public Builder setAch(FinancialAccountCreateParams.Features.InboundTransfers.Ach ach) { this.ach = ach; return this; } @@ -791,8 +803,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.extraParams, this.requested); + public FinancialAccountCreateParams.Features.InboundTransfers.Ach build() { + return new FinancialAccountCreateParams.Features.InboundTransfers.Ach( + this.extraParams, this.requested); } /** @@ -862,8 +875,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public IntraStripeFlows build() { - return new IntraStripeFlows(this.extraParams, this.requested); + public FinancialAccountCreateParams.Features.IntraStripeFlows build() { + return new FinancialAccountCreateParams.Features.IntraStripeFlows( + this.extraParams, this.requested); } /** @@ -940,12 +954,13 @@ public static class Builder { private UsDomesticWire usDomesticWire; /** Finalize and obtain parameter instance from this builder. */ - public OutboundPayments build() { - return new OutboundPayments(this.ach, this.extraParams, this.usDomesticWire); + public FinancialAccountCreateParams.Features.OutboundPayments build() { + return new FinancialAccountCreateParams.Features.OutboundPayments( + this.ach, this.extraParams, this.usDomesticWire); } /** Enables ACH transfers via the OutboundPayments API. */ - public Builder setAch(Ach ach) { + public Builder setAch(FinancialAccountCreateParams.Features.OutboundPayments.Ach ach) { this.ach = ach; return this; } @@ -979,7 +994,8 @@ public Builder putAllExtraParam(Map map) { } /** Enables US domestic wire tranfers via the OutboundPayments API. */ - public Builder setUsDomesticWire(UsDomesticWire usDomesticWire) { + public Builder setUsDomesticWire( + FinancialAccountCreateParams.Features.OutboundPayments.UsDomesticWire usDomesticWire) { this.usDomesticWire = usDomesticWire; return this; } @@ -1016,8 +1032,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.extraParams, this.requested); + public FinancialAccountCreateParams.Features.OutboundPayments.Ach build() { + return new FinancialAccountCreateParams.Features.OutboundPayments.Ach( + this.extraParams, this.requested); } /** @@ -1087,8 +1104,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public UsDomesticWire build() { - return new UsDomesticWire(this.extraParams, this.requested); + public FinancialAccountCreateParams.Features.OutboundPayments.UsDomesticWire build() { + return new FinancialAccountCreateParams.Features.OutboundPayments.UsDomesticWire( + this.extraParams, this.requested); } /** @@ -1168,12 +1186,13 @@ public static class Builder { private UsDomesticWire usDomesticWire; /** Finalize and obtain parameter instance from this builder. */ - public OutboundTransfers build() { - return new OutboundTransfers(this.ach, this.extraParams, this.usDomesticWire); + public FinancialAccountCreateParams.Features.OutboundTransfers build() { + return new FinancialAccountCreateParams.Features.OutboundTransfers( + this.ach, this.extraParams, this.usDomesticWire); } /** Enables ACH transfers via the OutboundTransfers API. */ - public Builder setAch(Ach ach) { + public Builder setAch(FinancialAccountCreateParams.Features.OutboundTransfers.Ach ach) { this.ach = ach; return this; } @@ -1207,7 +1226,8 @@ public Builder putAllExtraParam(Map map) { } /** Enables US domestic wire tranfers via the OutboundTransfers API. */ - public Builder setUsDomesticWire(UsDomesticWire usDomesticWire) { + public Builder setUsDomesticWire( + FinancialAccountCreateParams.Features.OutboundTransfers.UsDomesticWire usDomesticWire) { this.usDomesticWire = usDomesticWire; return this; } @@ -1244,8 +1264,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.extraParams, this.requested); + public FinancialAccountCreateParams.Features.OutboundTransfers.Ach build() { + return new FinancialAccountCreateParams.Features.OutboundTransfers.Ach( + this.extraParams, this.requested); } /** @@ -1317,8 +1338,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public UsDomesticWire build() { - return new UsDomesticWire(this.extraParams, this.requested); + public FinancialAccountCreateParams.Features.OutboundTransfers.UsDomesticWire build() { + return new FinancialAccountCreateParams.Features.OutboundTransfers.UsDomesticWire( + this.extraParams, this.requested); } /** @@ -1399,8 +1421,9 @@ public static class Builder { private OutboundFlows outboundFlows; /** Finalize and obtain parameter instance from this builder. */ - public PlatformRestrictions build() { - return new PlatformRestrictions(this.extraParams, this.inboundFlows, this.outboundFlows); + public FinancialAccountCreateParams.PlatformRestrictions build() { + return new FinancialAccountCreateParams.PlatformRestrictions( + this.extraParams, this.inboundFlows, this.outboundFlows); } /** @@ -1431,13 +1454,15 @@ public Builder putAllExtraParam(Map map) { } /** Restricts all inbound money movement. */ - public Builder setInboundFlows(InboundFlows inboundFlows) { + public Builder setInboundFlows( + FinancialAccountCreateParams.PlatformRestrictions.InboundFlows inboundFlows) { this.inboundFlows = inboundFlows; return this; } /** Restricts all outbound money movement. */ - public Builder setOutboundFlows(OutboundFlows outboundFlows) { + public Builder setOutboundFlows( + FinancialAccountCreateParams.PlatformRestrictions.OutboundFlows outboundFlows) { this.outboundFlows = outboundFlows; return this; } diff --git a/src/main/java/com/stripe/param/treasury/FinancialAccountListParams.java b/src/main/java/com/stripe/param/treasury/FinancialAccountListParams.java index eff1fcd1e02..7f698e7436d 100644 --- a/src/main/java/com/stripe/param/treasury/FinancialAccountListParams.java +++ b/src/main/java/com/stripe/param/treasury/FinancialAccountListParams.java @@ -82,7 +82,7 @@ public FinancialAccountListParams build() { this.startingAfter); } - public Builder setCreated(Created created) { + public Builder setCreated(FinancialAccountListParams.Created created) { this.created = created; return this; } @@ -214,8 +214,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public FinancialAccountListParams.Created build() { + return new FinancialAccountListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/treasury/FinancialAccountUpdateFeaturesParams.java b/src/main/java/com/stripe/param/treasury/FinancialAccountUpdateFeaturesParams.java index 99558dcc976..ce4eaca74a0 100644 --- a/src/main/java/com/stripe/param/treasury/FinancialAccountUpdateFeaturesParams.java +++ b/src/main/java/com/stripe/param/treasury/FinancialAccountUpdateFeaturesParams.java @@ -132,7 +132,7 @@ public FinancialAccountUpdateFeaturesParams build() { * Encodes the FinancialAccount's ability to be used with the Issuing product, including * attaching cards to and drawing funds from the FinancialAccount. */ - public Builder setCardIssuing(CardIssuing cardIssuing) { + public Builder setCardIssuing(FinancialAccountUpdateFeaturesParams.CardIssuing cardIssuing) { this.cardIssuing = cardIssuing; return this; } @@ -141,7 +141,8 @@ public Builder setCardIssuing(CardIssuing cardIssuing) { * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors * determine the insurance amount. */ - public Builder setDepositInsurance(DepositInsurance depositInsurance) { + public Builder setDepositInsurance( + FinancialAccountUpdateFeaturesParams.DepositInsurance depositInsurance) { this.depositInsurance = depositInsurance; return this; } @@ -199,7 +200,8 @@ public Builder putAllExtraParam(Map map) { } /** Contains Features that add FinancialAddresses to the FinancialAccount. */ - public Builder setFinancialAddresses(FinancialAddresses financialAddresses) { + public Builder setFinancialAddresses( + FinancialAccountUpdateFeaturesParams.FinancialAddresses financialAddresses) { this.financialAddresses = financialAddresses; return this; } @@ -208,7 +210,8 @@ public Builder setFinancialAddresses(FinancialAddresses financialAddresses) { * Contains settings related to adding funds to a FinancialAccount from another Account with the * same owner. */ - public Builder setInboundTransfers(InboundTransfers inboundTransfers) { + public Builder setInboundTransfers( + FinancialAccountUpdateFeaturesParams.InboundTransfers inboundTransfers) { this.inboundTransfers = inboundTransfers; return this; } @@ -217,7 +220,8 @@ public Builder setInboundTransfers(InboundTransfers inboundTransfers) { * Represents the ability for the FinancialAccount to send money to, or receive money from other * FinancialAccounts (for example, via OutboundPayment). */ - public Builder setIntraStripeFlows(IntraStripeFlows intraStripeFlows) { + public Builder setIntraStripeFlows( + FinancialAccountUpdateFeaturesParams.IntraStripeFlows intraStripeFlows) { this.intraStripeFlows = intraStripeFlows; return this; } @@ -226,7 +230,8 @@ public Builder setIntraStripeFlows(IntraStripeFlows intraStripeFlows) { * Includes Features related to initiating money movement out of the FinancialAccount to someone * else's bucket of money. */ - public Builder setOutboundPayments(OutboundPayments outboundPayments) { + public Builder setOutboundPayments( + FinancialAccountUpdateFeaturesParams.OutboundPayments outboundPayments) { this.outboundPayments = outboundPayments; return this; } @@ -235,7 +240,8 @@ public Builder setOutboundPayments(OutboundPayments outboundPayments) { * Contains a Feature and settings related to moving money out of the FinancialAccount into * another Account with the same owner. */ - public Builder setOutboundTransfers(OutboundTransfers outboundTransfers) { + public Builder setOutboundTransfers( + FinancialAccountUpdateFeaturesParams.OutboundTransfers outboundTransfers) { this.outboundTransfers = outboundTransfers; return this; } @@ -271,8 +277,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public CardIssuing build() { - return new CardIssuing(this.extraParams, this.requested); + public FinancialAccountUpdateFeaturesParams.CardIssuing build() { + return new FinancialAccountUpdateFeaturesParams.CardIssuing( + this.extraParams, this.requested); } /** @@ -340,8 +347,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public DepositInsurance build() { - return new DepositInsurance(this.extraParams, this.requested); + public FinancialAccountUpdateFeaturesParams.DepositInsurance build() { + return new FinancialAccountUpdateFeaturesParams.DepositInsurance( + this.extraParams, this.requested); } /** @@ -410,12 +418,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public FinancialAddresses build() { - return new FinancialAddresses(this.aba, this.extraParams); + public FinancialAccountUpdateFeaturesParams.FinancialAddresses build() { + return new FinancialAccountUpdateFeaturesParams.FinancialAddresses( + this.aba, this.extraParams); } /** Adds an ABA FinancialAddress to the FinancialAccount. */ - public Builder setAba(Aba aba) { + public Builder setAba(FinancialAccountUpdateFeaturesParams.FinancialAddresses.Aba aba) { this.aba = aba; return this; } @@ -479,8 +488,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Aba build() { - return new Aba(this.extraParams, this.requested); + public FinancialAccountUpdateFeaturesParams.FinancialAddresses.Aba build() { + return new FinancialAccountUpdateFeaturesParams.FinancialAddresses.Aba( + this.extraParams, this.requested); } /** @@ -550,12 +560,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InboundTransfers build() { - return new InboundTransfers(this.ach, this.extraParams); + public FinancialAccountUpdateFeaturesParams.InboundTransfers build() { + return new FinancialAccountUpdateFeaturesParams.InboundTransfers( + this.ach, this.extraParams); } /** Enables ACH Debits via the InboundTransfers API. */ - public Builder setAch(Ach ach) { + public Builder setAch(FinancialAccountUpdateFeaturesParams.InboundTransfers.Ach ach) { this.ach = ach; return this; } @@ -619,8 +630,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.extraParams, this.requested); + public FinancialAccountUpdateFeaturesParams.InboundTransfers.Ach build() { + return new FinancialAccountUpdateFeaturesParams.InboundTransfers.Ach( + this.extraParams, this.requested); } /** @@ -690,8 +702,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public IntraStripeFlows build() { - return new IntraStripeFlows(this.extraParams, this.requested); + public FinancialAccountUpdateFeaturesParams.IntraStripeFlows build() { + return new FinancialAccountUpdateFeaturesParams.IntraStripeFlows( + this.extraParams, this.requested); } /** @@ -768,12 +781,13 @@ public static class Builder { private UsDomesticWire usDomesticWire; /** Finalize and obtain parameter instance from this builder. */ - public OutboundPayments build() { - return new OutboundPayments(this.ach, this.extraParams, this.usDomesticWire); + public FinancialAccountUpdateFeaturesParams.OutboundPayments build() { + return new FinancialAccountUpdateFeaturesParams.OutboundPayments( + this.ach, this.extraParams, this.usDomesticWire); } /** Enables ACH transfers via the OutboundPayments API. */ - public Builder setAch(Ach ach) { + public Builder setAch(FinancialAccountUpdateFeaturesParams.OutboundPayments.Ach ach) { this.ach = ach; return this; } @@ -807,7 +821,8 @@ public Builder putAllExtraParam(Map map) { } /** Enables US domestic wire tranfers via the OutboundPayments API. */ - public Builder setUsDomesticWire(UsDomesticWire usDomesticWire) { + public Builder setUsDomesticWire( + FinancialAccountUpdateFeaturesParams.OutboundPayments.UsDomesticWire usDomesticWire) { this.usDomesticWire = usDomesticWire; return this; } @@ -843,8 +858,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.extraParams, this.requested); + public FinancialAccountUpdateFeaturesParams.OutboundPayments.Ach build() { + return new FinancialAccountUpdateFeaturesParams.OutboundPayments.Ach( + this.extraParams, this.requested); } /** @@ -913,8 +929,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public UsDomesticWire build() { - return new UsDomesticWire(this.extraParams, this.requested); + public FinancialAccountUpdateFeaturesParams.OutboundPayments.UsDomesticWire build() { + return new FinancialAccountUpdateFeaturesParams.OutboundPayments.UsDomesticWire( + this.extraParams, this.requested); } /** @@ -994,12 +1011,13 @@ public static class Builder { private UsDomesticWire usDomesticWire; /** Finalize and obtain parameter instance from this builder. */ - public OutboundTransfers build() { - return new OutboundTransfers(this.ach, this.extraParams, this.usDomesticWire); + public FinancialAccountUpdateFeaturesParams.OutboundTransfers build() { + return new FinancialAccountUpdateFeaturesParams.OutboundTransfers( + this.ach, this.extraParams, this.usDomesticWire); } /** Enables ACH transfers via the OutboundTransfers API. */ - public Builder setAch(Ach ach) { + public Builder setAch(FinancialAccountUpdateFeaturesParams.OutboundTransfers.Ach ach) { this.ach = ach; return this; } @@ -1033,7 +1051,8 @@ public Builder putAllExtraParam(Map map) { } /** Enables US domestic wire tranfers via the OutboundTransfers API. */ - public Builder setUsDomesticWire(UsDomesticWire usDomesticWire) { + public Builder setUsDomesticWire( + FinancialAccountUpdateFeaturesParams.OutboundTransfers.UsDomesticWire usDomesticWire) { this.usDomesticWire = usDomesticWire; return this; } @@ -1069,8 +1088,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.extraParams, this.requested); + public FinancialAccountUpdateFeaturesParams.OutboundTransfers.Ach build() { + return new FinancialAccountUpdateFeaturesParams.OutboundTransfers.Ach( + this.extraParams, this.requested); } /** @@ -1139,8 +1159,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public UsDomesticWire build() { - return new UsDomesticWire(this.extraParams, this.requested); + public FinancialAccountUpdateFeaturesParams.OutboundTransfers.UsDomesticWire build() { + return new FinancialAccountUpdateFeaturesParams.OutboundTransfers.UsDomesticWire( + this.extraParams, this.requested); } /** diff --git a/src/main/java/com/stripe/param/treasury/FinancialAccountUpdateParams.java b/src/main/java/com/stripe/param/treasury/FinancialAccountUpdateParams.java index ecccc3efcba..4b77f21a77a 100644 --- a/src/main/java/com/stripe/param/treasury/FinancialAccountUpdateParams.java +++ b/src/main/java/com/stripe/param/treasury/FinancialAccountUpdateParams.java @@ -136,7 +136,7 @@ public Builder putAllExtraParam(Map map) { * associated {@code status_details}. Stripe or the platform may control features via the * requested field. */ - public Builder setFeatures(Features features) { + public Builder setFeatures(FinancialAccountUpdateParams.Features features) { this.features = features; return this; } @@ -168,7 +168,8 @@ public Builder putAllMetadata(Map map) { } /** The set of functionalities that the platform can restrict on the FinancialAccount. */ - public Builder setPlatformRestrictions(PlatformRestrictions platformRestrictions) { + public Builder setPlatformRestrictions( + FinancialAccountUpdateParams.PlatformRestrictions platformRestrictions) { this.platformRestrictions = platformRestrictions; return this; } @@ -272,8 +273,8 @@ public static class Builder { private OutboundTransfers outboundTransfers; /** Finalize and obtain parameter instance from this builder. */ - public Features build() { - return new Features( + public FinancialAccountUpdateParams.Features build() { + return new FinancialAccountUpdateParams.Features( this.cardIssuing, this.depositInsurance, this.extraParams, @@ -288,7 +289,7 @@ public Features build() { * Encodes the FinancialAccount's ability to be used with the Issuing product, including * attaching cards to and drawing funds from the FinancialAccount. */ - public Builder setCardIssuing(CardIssuing cardIssuing) { + public Builder setCardIssuing(FinancialAccountUpdateParams.Features.CardIssuing cardIssuing) { this.cardIssuing = cardIssuing; return this; } @@ -297,7 +298,8 @@ public Builder setCardIssuing(CardIssuing cardIssuing) { * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors * determine the insurance amount. */ - public Builder setDepositInsurance(DepositInsurance depositInsurance) { + public Builder setDepositInsurance( + FinancialAccountUpdateParams.Features.DepositInsurance depositInsurance) { this.depositInsurance = depositInsurance; return this; } @@ -329,7 +331,8 @@ public Builder putAllExtraParam(Map map) { } /** Contains Features that add FinancialAddresses to the FinancialAccount. */ - public Builder setFinancialAddresses(FinancialAddresses financialAddresses) { + public Builder setFinancialAddresses( + FinancialAccountUpdateParams.Features.FinancialAddresses financialAddresses) { this.financialAddresses = financialAddresses; return this; } @@ -338,7 +341,8 @@ public Builder setFinancialAddresses(FinancialAddresses financialAddresses) { * Contains settings related to adding funds to a FinancialAccount from another Account with * the same owner. */ - public Builder setInboundTransfers(InboundTransfers inboundTransfers) { + public Builder setInboundTransfers( + FinancialAccountUpdateParams.Features.InboundTransfers inboundTransfers) { this.inboundTransfers = inboundTransfers; return this; } @@ -347,7 +351,8 @@ public Builder setInboundTransfers(InboundTransfers inboundTransfers) { * Represents the ability for the FinancialAccount to send money to, or receive money from * other FinancialAccounts (for example, via OutboundPayment). */ - public Builder setIntraStripeFlows(IntraStripeFlows intraStripeFlows) { + public Builder setIntraStripeFlows( + FinancialAccountUpdateParams.Features.IntraStripeFlows intraStripeFlows) { this.intraStripeFlows = intraStripeFlows; return this; } @@ -356,7 +361,8 @@ public Builder setIntraStripeFlows(IntraStripeFlows intraStripeFlows) { * Includes Features related to initiating money movement out of the FinancialAccount to * someone else's bucket of money. */ - public Builder setOutboundPayments(OutboundPayments outboundPayments) { + public Builder setOutboundPayments( + FinancialAccountUpdateParams.Features.OutboundPayments outboundPayments) { this.outboundPayments = outboundPayments; return this; } @@ -365,7 +371,8 @@ public Builder setOutboundPayments(OutboundPayments outboundPayments) { * Contains a Feature and settings related to moving money out of the FinancialAccount into * another Account with the same owner. */ - public Builder setOutboundTransfers(OutboundTransfers outboundTransfers) { + public Builder setOutboundTransfers( + FinancialAccountUpdateParams.Features.OutboundTransfers outboundTransfers) { this.outboundTransfers = outboundTransfers; return this; } @@ -401,8 +408,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public CardIssuing build() { - return new CardIssuing(this.extraParams, this.requested); + public FinancialAccountUpdateParams.Features.CardIssuing build() { + return new FinancialAccountUpdateParams.Features.CardIssuing( + this.extraParams, this.requested); } /** @@ -471,8 +479,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public DepositInsurance build() { - return new DepositInsurance(this.extraParams, this.requested); + public FinancialAccountUpdateParams.Features.DepositInsurance build() { + return new FinancialAccountUpdateParams.Features.DepositInsurance( + this.extraParams, this.requested); } /** @@ -541,12 +550,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public FinancialAddresses build() { - return new FinancialAddresses(this.aba, this.extraParams); + public FinancialAccountUpdateParams.Features.FinancialAddresses build() { + return new FinancialAccountUpdateParams.Features.FinancialAddresses( + this.aba, this.extraParams); } /** Adds an ABA FinancialAddress to the FinancialAccount. */ - public Builder setAba(Aba aba) { + public Builder setAba(FinancialAccountUpdateParams.Features.FinancialAddresses.Aba aba) { this.aba = aba; return this; } @@ -611,8 +621,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Aba build() { - return new Aba(this.extraParams, this.requested); + public FinancialAccountUpdateParams.Features.FinancialAddresses.Aba build() { + return new FinancialAccountUpdateParams.Features.FinancialAddresses.Aba( + this.extraParams, this.requested); } /** @@ -684,12 +695,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InboundTransfers build() { - return new InboundTransfers(this.ach, this.extraParams); + public FinancialAccountUpdateParams.Features.InboundTransfers build() { + return new FinancialAccountUpdateParams.Features.InboundTransfers( + this.ach, this.extraParams); } /** Enables ACH Debits via the InboundTransfers API. */ - public Builder setAch(Ach ach) { + public Builder setAch(FinancialAccountUpdateParams.Features.InboundTransfers.Ach ach) { this.ach = ach; return this; } @@ -754,8 +766,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.extraParams, this.requested); + public FinancialAccountUpdateParams.Features.InboundTransfers.Ach build() { + return new FinancialAccountUpdateParams.Features.InboundTransfers.Ach( + this.extraParams, this.requested); } /** @@ -825,8 +838,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public IntraStripeFlows build() { - return new IntraStripeFlows(this.extraParams, this.requested); + public FinancialAccountUpdateParams.Features.IntraStripeFlows build() { + return new FinancialAccountUpdateParams.Features.IntraStripeFlows( + this.extraParams, this.requested); } /** @@ -903,12 +917,13 @@ public static class Builder { private UsDomesticWire usDomesticWire; /** Finalize and obtain parameter instance from this builder. */ - public OutboundPayments build() { - return new OutboundPayments(this.ach, this.extraParams, this.usDomesticWire); + public FinancialAccountUpdateParams.Features.OutboundPayments build() { + return new FinancialAccountUpdateParams.Features.OutboundPayments( + this.ach, this.extraParams, this.usDomesticWire); } /** Enables ACH transfers via the OutboundPayments API. */ - public Builder setAch(Ach ach) { + public Builder setAch(FinancialAccountUpdateParams.Features.OutboundPayments.Ach ach) { this.ach = ach; return this; } @@ -942,7 +957,8 @@ public Builder putAllExtraParam(Map map) { } /** Enables US domestic wire tranfers via the OutboundPayments API. */ - public Builder setUsDomesticWire(UsDomesticWire usDomesticWire) { + public Builder setUsDomesticWire( + FinancialAccountUpdateParams.Features.OutboundPayments.UsDomesticWire usDomesticWire) { this.usDomesticWire = usDomesticWire; return this; } @@ -979,8 +995,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.extraParams, this.requested); + public FinancialAccountUpdateParams.Features.OutboundPayments.Ach build() { + return new FinancialAccountUpdateParams.Features.OutboundPayments.Ach( + this.extraParams, this.requested); } /** @@ -1050,8 +1067,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public UsDomesticWire build() { - return new UsDomesticWire(this.extraParams, this.requested); + public FinancialAccountUpdateParams.Features.OutboundPayments.UsDomesticWire build() { + return new FinancialAccountUpdateParams.Features.OutboundPayments.UsDomesticWire( + this.extraParams, this.requested); } /** @@ -1131,12 +1149,13 @@ public static class Builder { private UsDomesticWire usDomesticWire; /** Finalize and obtain parameter instance from this builder. */ - public OutboundTransfers build() { - return new OutboundTransfers(this.ach, this.extraParams, this.usDomesticWire); + public FinancialAccountUpdateParams.Features.OutboundTransfers build() { + return new FinancialAccountUpdateParams.Features.OutboundTransfers( + this.ach, this.extraParams, this.usDomesticWire); } /** Enables ACH transfers via the OutboundTransfers API. */ - public Builder setAch(Ach ach) { + public Builder setAch(FinancialAccountUpdateParams.Features.OutboundTransfers.Ach ach) { this.ach = ach; return this; } @@ -1170,7 +1189,8 @@ public Builder putAllExtraParam(Map map) { } /** Enables US domestic wire tranfers via the OutboundTransfers API. */ - public Builder setUsDomesticWire(UsDomesticWire usDomesticWire) { + public Builder setUsDomesticWire( + FinancialAccountUpdateParams.Features.OutboundTransfers.UsDomesticWire usDomesticWire) { this.usDomesticWire = usDomesticWire; return this; } @@ -1207,8 +1227,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.extraParams, this.requested); + public FinancialAccountUpdateParams.Features.OutboundTransfers.Ach build() { + return new FinancialAccountUpdateParams.Features.OutboundTransfers.Ach( + this.extraParams, this.requested); } /** @@ -1280,8 +1301,9 @@ public static class Builder { private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ - public UsDomesticWire build() { - return new UsDomesticWire(this.extraParams, this.requested); + public FinancialAccountUpdateParams.Features.OutboundTransfers.UsDomesticWire build() { + return new FinancialAccountUpdateParams.Features.OutboundTransfers.UsDomesticWire( + this.extraParams, this.requested); } /** @@ -1362,8 +1384,9 @@ public static class Builder { private OutboundFlows outboundFlows; /** Finalize and obtain parameter instance from this builder. */ - public PlatformRestrictions build() { - return new PlatformRestrictions(this.extraParams, this.inboundFlows, this.outboundFlows); + public FinancialAccountUpdateParams.PlatformRestrictions build() { + return new FinancialAccountUpdateParams.PlatformRestrictions( + this.extraParams, this.inboundFlows, this.outboundFlows); } /** @@ -1394,13 +1417,15 @@ public Builder putAllExtraParam(Map map) { } /** Restricts all inbound money movement. */ - public Builder setInboundFlows(InboundFlows inboundFlows) { + public Builder setInboundFlows( + FinancialAccountUpdateParams.PlatformRestrictions.InboundFlows inboundFlows) { this.inboundFlows = inboundFlows; return this; } /** Restricts all outbound money movement. */ - public Builder setOutboundFlows(OutboundFlows outboundFlows) { + public Builder setOutboundFlows( + FinancialAccountUpdateParams.PlatformRestrictions.OutboundFlows outboundFlows) { this.outboundFlows = outboundFlows; return this; } diff --git a/src/main/java/com/stripe/param/treasury/InboundTransferFailParams.java b/src/main/java/com/stripe/param/treasury/InboundTransferFailParams.java index e8fda2573ec..0364a021c4a 100644 --- a/src/main/java/com/stripe/param/treasury/InboundTransferFailParams.java +++ b/src/main/java/com/stripe/param/treasury/InboundTransferFailParams.java @@ -104,7 +104,7 @@ public Builder putAllExtraParam(Map map) { } /** Details about a failed InboundTransfer. */ - public Builder setFailureDetails(FailureDetails failureDetails) { + public Builder setFailureDetails(InboundTransferFailParams.FailureDetails failureDetails) { this.failureDetails = failureDetails; return this; } @@ -140,12 +140,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public FailureDetails build() { - return new FailureDetails(this.code, this.extraParams); + public InboundTransferFailParams.FailureDetails build() { + return new InboundTransferFailParams.FailureDetails(this.code, this.extraParams); } /** Reason for the failure. */ - public Builder setCode(Code code) { + public Builder setCode(InboundTransferFailParams.FailureDetails.Code code) { this.code = code; return this; } diff --git a/src/main/java/com/stripe/param/treasury/InboundTransferListParams.java b/src/main/java/com/stripe/param/treasury/InboundTransferListParams.java index fb9d2eddedc..101cf0cabc5 100644 --- a/src/main/java/com/stripe/param/treasury/InboundTransferListParams.java +++ b/src/main/java/com/stripe/param/treasury/InboundTransferListParams.java @@ -201,7 +201,7 @@ public Builder setStartingAfter(String startingAfter) { * Only return InboundTransfers that have the given status: {@code processing}, {@code * succeeded}, {@code failed} or {@code canceled}. */ - public Builder setStatus(Status status) { + public Builder setStatus(InboundTransferListParams.Status status) { this.status = status; return this; } diff --git a/src/main/java/com/stripe/param/treasury/OutboundPaymentCreateParams.java b/src/main/java/com/stripe/param/treasury/OutboundPaymentCreateParams.java index f866133f74d..845a9bb070f 100644 --- a/src/main/java/com/stripe/param/treasury/OutboundPaymentCreateParams.java +++ b/src/main/java/com/stripe/param/treasury/OutboundPaymentCreateParams.java @@ -214,20 +214,21 @@ public Builder setDestinationPaymentMethod(String destinationPaymentMethod) { * {@code destination_payment_method}. */ public Builder setDestinationPaymentMethodData( - DestinationPaymentMethodData destinationPaymentMethodData) { + OutboundPaymentCreateParams.DestinationPaymentMethodData destinationPaymentMethodData) { this.destinationPaymentMethodData = destinationPaymentMethodData; return this; } /** Payment method-specific configuration for this OutboundPayment. */ public Builder setDestinationPaymentMethodOptions( - DestinationPaymentMethodOptions destinationPaymentMethodOptions) { + OutboundPaymentCreateParams.DestinationPaymentMethodOptions + destinationPaymentMethodOptions) { this.destinationPaymentMethodOptions = destinationPaymentMethodOptions; return this; } /** End user details. */ - public Builder setEndUserDetails(EndUserDetails endUserDetails) { + public Builder setEndUserDetails(OutboundPaymentCreateParams.EndUserDetails endUserDetails) { this.endUserDetails = endUserDetails; return this; } @@ -407,8 +408,8 @@ public static class Builder { private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public DestinationPaymentMethodData build() { - return new DestinationPaymentMethodData( + public OutboundPaymentCreateParams.DestinationPaymentMethodData build() { + return new OutboundPaymentCreateParams.DestinationPaymentMethodData( this.billingDetails, this.extraParams, this.financialAccount, @@ -421,7 +422,8 @@ public DestinationPaymentMethodData build() { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails( + OutboundPaymentCreateParams.DestinationPaymentMethodData.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -496,13 +498,14 @@ public Builder putAllMetadata(Map map) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(OutboundPaymentCreateParams.DestinationPaymentMethodData.Type type) { this.type = type; return this; } /** Required hash if type is set to {@code us_bank_account}. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + OutboundPaymentCreateParams.DestinationPaymentMethodData.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -564,13 +567,15 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public OutboundPaymentCreateParams.DestinationPaymentMethodData.BillingDetails build() { + return new OutboundPaymentCreateParams.DestinationPaymentMethodData.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress( + OutboundPaymentCreateParams.DestinationPaymentMethodData.BillingDetails.Address + address) { this.address = address; return this; } @@ -712,8 +717,10 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public OutboundPaymentCreateParams.DestinationPaymentMethodData.BillingDetails.Address + build() { + return new OutboundPaymentCreateParams.DestinationPaymentMethodData.BillingDetails + .Address( this.city, this.country, this.extraParams, @@ -859,8 +866,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public OutboundPaymentCreateParams.DestinationPaymentMethodData.UsBankAccount build() { + return new OutboundPaymentCreateParams.DestinationPaymentMethodData.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -870,7 +877,9 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + OutboundPaymentCreateParams.DestinationPaymentMethodData.UsBankAccount.AccountHolderType + accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -882,7 +891,9 @@ public Builder setAccountNumber(String accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + OutboundPaymentCreateParams.DestinationPaymentMethodData.UsBankAccount.AccountType + accountType) { this.accountType = accountType; return this; } @@ -1007,8 +1018,9 @@ public static class Builder { private Object usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public DestinationPaymentMethodOptions build() { - return new DestinationPaymentMethodOptions(this.extraParams, this.usBankAccount); + public OutboundPaymentCreateParams.DestinationPaymentMethodOptions build() { + return new OutboundPaymentCreateParams.DestinationPaymentMethodOptions( + this.extraParams, this.usBankAccount); } /** @@ -1040,7 +1052,8 @@ public Builder putAllExtraParam(Map map) { } /** Optional fields for {@code us_bank_account}. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + OutboundPaymentCreateParams.DestinationPaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -1085,8 +1098,9 @@ public static class Builder { private Network network; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount(this.extraParams, this.network); + public OutboundPaymentCreateParams.DestinationPaymentMethodOptions.UsBankAccount build() { + return new OutboundPaymentCreateParams.DestinationPaymentMethodOptions.UsBankAccount( + this.extraParams, this.network); } /** @@ -1123,7 +1137,9 @@ public Builder putAllExtraParam(Map map) { * The US bank account network that must be used for this OutboundPayment. If not set, we * will default to the PaymentMethod's preferred network. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + OutboundPaymentCreateParams.DestinationPaymentMethodOptions.UsBankAccount.Network + network) { this.network = network; return this; } @@ -1189,8 +1205,9 @@ public static class Builder { private Boolean present; /** Finalize and obtain parameter instance from this builder. */ - public EndUserDetails build() { - return new EndUserDetails(this.extraParams, this.ipAddress, this.present); + public OutboundPaymentCreateParams.EndUserDetails build() { + return new OutboundPaymentCreateParams.EndUserDetails( + this.extraParams, this.ipAddress, this.present); } /** diff --git a/src/main/java/com/stripe/param/treasury/OutboundPaymentListParams.java b/src/main/java/com/stripe/param/treasury/OutboundPaymentListParams.java index 228aa4e7471..2eaaa9572b4 100644 --- a/src/main/java/com/stripe/param/treasury/OutboundPaymentListParams.java +++ b/src/main/java/com/stripe/param/treasury/OutboundPaymentListParams.java @@ -216,7 +216,7 @@ public Builder setStartingAfter(String startingAfter) { * Only return OutboundPayments that have the given status: {@code processing}, {@code failed}, * {@code posted}, {@code returned}, or {@code canceled}. */ - public Builder setStatus(Status status) { + public Builder setStatus(OutboundPaymentListParams.Status status) { this.status = status; return this; } diff --git a/src/main/java/com/stripe/param/treasury/OutboundPaymentReturnOutboundPaymentParams.java b/src/main/java/com/stripe/param/treasury/OutboundPaymentReturnOutboundPaymentParams.java index dc0a169240d..5215f75b5ad 100644 --- a/src/main/java/com/stripe/param/treasury/OutboundPaymentReturnOutboundPaymentParams.java +++ b/src/main/java/com/stripe/param/treasury/OutboundPaymentReturnOutboundPaymentParams.java @@ -106,7 +106,8 @@ public Builder putAllExtraParam(Map map) { } /** Optional hash to set the the return code. */ - public Builder setReturnedDetails(ReturnedDetails returnedDetails) { + public Builder setReturnedDetails( + OutboundPaymentReturnOutboundPaymentParams.ReturnedDetails returnedDetails) { this.returnedDetails = returnedDetails; return this; } @@ -142,12 +143,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public ReturnedDetails build() { - return new ReturnedDetails(this.code, this.extraParams); + public OutboundPaymentReturnOutboundPaymentParams.ReturnedDetails build() { + return new OutboundPaymentReturnOutboundPaymentParams.ReturnedDetails( + this.code, this.extraParams); } /** The return code to be set on the OutboundPayment object. */ - public Builder setCode(Code code) { + public Builder setCode(OutboundPaymentReturnOutboundPaymentParams.ReturnedDetails.Code code) { this.code = code; return this; } diff --git a/src/main/java/com/stripe/param/treasury/OutboundTransferCreateParams.java b/src/main/java/com/stripe/param/treasury/OutboundTransferCreateParams.java index 2b9cb40e7ba..f94ff128393 100644 --- a/src/main/java/com/stripe/param/treasury/OutboundTransferCreateParams.java +++ b/src/main/java/com/stripe/param/treasury/OutboundTransferCreateParams.java @@ -162,7 +162,8 @@ public Builder setDestinationPaymentMethod(String destinationPaymentMethod) { /** Hash describing payment method configuration details. */ public Builder setDestinationPaymentMethodOptions( - DestinationPaymentMethodOptions destinationPaymentMethodOptions) { + OutboundTransferCreateParams.DestinationPaymentMethodOptions + destinationPaymentMethodOptions) { this.destinationPaymentMethodOptions = destinationPaymentMethodOptions; return this; } @@ -292,8 +293,9 @@ public static class Builder { private Object usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public DestinationPaymentMethodOptions build() { - return new DestinationPaymentMethodOptions(this.extraParams, this.usBankAccount); + public OutboundTransferCreateParams.DestinationPaymentMethodOptions build() { + return new OutboundTransferCreateParams.DestinationPaymentMethodOptions( + this.extraParams, this.usBankAccount); } /** @@ -325,7 +327,9 @@ public Builder putAllExtraParam(Map map) { } /** Optional fields for {@code us_bank_account}. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + OutboundTransferCreateParams.DestinationPaymentMethodOptions.UsBankAccount + usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -367,8 +371,9 @@ public static class Builder { private Network network; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount(this.extraParams, this.network); + public OutboundTransferCreateParams.DestinationPaymentMethodOptions.UsBankAccount build() { + return new OutboundTransferCreateParams.DestinationPaymentMethodOptions.UsBankAccount( + this.extraParams, this.network); } /** @@ -402,7 +407,9 @@ public Builder putAllExtraParam(Map map) { } /** Designate the OutboundTransfer as using a US bank account network configuration. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + OutboundTransferCreateParams.DestinationPaymentMethodOptions.UsBankAccount.Network + network) { this.network = network; return this; } diff --git a/src/main/java/com/stripe/param/treasury/OutboundTransferListParams.java b/src/main/java/com/stripe/param/treasury/OutboundTransferListParams.java index 1664566c5b1..464d136c9be 100644 --- a/src/main/java/com/stripe/param/treasury/OutboundTransferListParams.java +++ b/src/main/java/com/stripe/param/treasury/OutboundTransferListParams.java @@ -201,7 +201,7 @@ public Builder setStartingAfter(String startingAfter) { * Only return OutboundTransfers that have the given status: {@code processing}, {@code * canceled}, {@code failed}, {@code posted}, or {@code returned}. */ - public Builder setStatus(Status status) { + public Builder setStatus(OutboundTransferListParams.Status status) { this.status = status; return this; } diff --git a/src/main/java/com/stripe/param/treasury/OutboundTransferReturnOutboundTransferParams.java b/src/main/java/com/stripe/param/treasury/OutboundTransferReturnOutboundTransferParams.java index b45838f6b62..884a05c6cb3 100644 --- a/src/main/java/com/stripe/param/treasury/OutboundTransferReturnOutboundTransferParams.java +++ b/src/main/java/com/stripe/param/treasury/OutboundTransferReturnOutboundTransferParams.java @@ -106,7 +106,8 @@ public Builder putAllExtraParam(Map map) { } /** Details about a returned OutboundTransfer. */ - public Builder setReturnedDetails(ReturnedDetails returnedDetails) { + public Builder setReturnedDetails( + OutboundTransferReturnOutboundTransferParams.ReturnedDetails returnedDetails) { this.returnedDetails = returnedDetails; return this; } @@ -142,12 +143,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public ReturnedDetails build() { - return new ReturnedDetails(this.code, this.extraParams); + public OutboundTransferReturnOutboundTransferParams.ReturnedDetails build() { + return new OutboundTransferReturnOutboundTransferParams.ReturnedDetails( + this.code, this.extraParams); } /** Reason for the return. */ - public Builder setCode(Code code) { + public Builder setCode( + OutboundTransferReturnOutboundTransferParams.ReturnedDetails.Code code) { this.code = code; return this; } diff --git a/src/main/java/com/stripe/param/treasury/ReceivedCreditCreateParams.java b/src/main/java/com/stripe/param/treasury/ReceivedCreditCreateParams.java index d6ab0827aeb..275f9b92af8 100644 --- a/src/main/java/com/stripe/param/treasury/ReceivedCreditCreateParams.java +++ b/src/main/java/com/stripe/param/treasury/ReceivedCreditCreateParams.java @@ -186,13 +186,13 @@ public Builder setFinancialAccount(String financialAccount) { /** Initiating payment method details for the object. */ public Builder setInitiatingPaymentMethodDetails( - InitiatingPaymentMethodDetails initiatingPaymentMethodDetails) { + ReceivedCreditCreateParams.InitiatingPaymentMethodDetails initiatingPaymentMethodDetails) { this.initiatingPaymentMethodDetails = initiatingPaymentMethodDetails; return this; } /** The rails used for the object. */ - public Builder setNetwork(Network network) { + public Builder setNetwork(ReceivedCreditCreateParams.Network network) { this.network = network; return this; } @@ -236,8 +236,9 @@ public static class Builder { private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public InitiatingPaymentMethodDetails build() { - return new InitiatingPaymentMethodDetails(this.extraParams, this.type, this.usBankAccount); + public ReceivedCreditCreateParams.InitiatingPaymentMethodDetails build() { + return new ReceivedCreditCreateParams.InitiatingPaymentMethodDetails( + this.extraParams, this.type, this.usBankAccount); } /** @@ -269,13 +270,14 @@ public Builder putAllExtraParam(Map map) { } /** The source type. */ - public Builder setType(Type type) { + public Builder setType(ReceivedCreditCreateParams.InitiatingPaymentMethodDetails.Type type) { this.type = type; return this; } /** Optional fields for {@code us_bank_account}. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + ReceivedCreditCreateParams.InitiatingPaymentMethodDetails.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -329,8 +331,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public ReceivedCreditCreateParams.InitiatingPaymentMethodDetails.UsBankAccount build() { + return new ReceivedCreditCreateParams.InitiatingPaymentMethodDetails.UsBankAccount( this.accountHolderName, this.accountNumber, this.extraParams, this.routingNumber); } diff --git a/src/main/java/com/stripe/param/treasury/ReceivedCreditListParams.java b/src/main/java/com/stripe/param/treasury/ReceivedCreditListParams.java index 3a4e110e372..ba7ed826f4a 100644 --- a/src/main/java/com/stripe/param/treasury/ReceivedCreditListParams.java +++ b/src/main/java/com/stripe/param/treasury/ReceivedCreditListParams.java @@ -195,7 +195,7 @@ public Builder setLimit(Long limit) { } /** Only return ReceivedCredits described by the flow. */ - public Builder setLinkedFlows(LinkedFlows linkedFlows) { + public Builder setLinkedFlows(ReceivedCreditListParams.LinkedFlows linkedFlows) { this.linkedFlows = linkedFlows; return this; } @@ -214,7 +214,7 @@ public Builder setStartingAfter(String startingAfter) { /** * Only return ReceivedCredits that have the given status: {@code succeeded} or {@code failed}. */ - public Builder setStatus(Status status) { + public Builder setStatus(ReceivedCreditListParams.Status status) { this.status = status; return this; } @@ -250,8 +250,8 @@ public static class Builder { private SourceFlowType sourceFlowType; /** Finalize and obtain parameter instance from this builder. */ - public LinkedFlows build() { - return new LinkedFlows(this.extraParams, this.sourceFlowType); + public ReceivedCreditListParams.LinkedFlows build() { + return new ReceivedCreditListParams.LinkedFlows(this.extraParams, this.sourceFlowType); } /** @@ -281,7 +281,8 @@ public Builder putAllExtraParam(Map map) { } /** The source flow type. */ - public Builder setSourceFlowType(SourceFlowType sourceFlowType) { + public Builder setSourceFlowType( + ReceivedCreditListParams.LinkedFlows.SourceFlowType sourceFlowType) { this.sourceFlowType = sourceFlowType; return this; } diff --git a/src/main/java/com/stripe/param/treasury/ReceivedDebitCreateParams.java b/src/main/java/com/stripe/param/treasury/ReceivedDebitCreateParams.java index 7851bcee8ba..052582ee061 100644 --- a/src/main/java/com/stripe/param/treasury/ReceivedDebitCreateParams.java +++ b/src/main/java/com/stripe/param/treasury/ReceivedDebitCreateParams.java @@ -186,13 +186,13 @@ public Builder setFinancialAccount(String financialAccount) { /** Initiating payment method details for the object. */ public Builder setInitiatingPaymentMethodDetails( - InitiatingPaymentMethodDetails initiatingPaymentMethodDetails) { + ReceivedDebitCreateParams.InitiatingPaymentMethodDetails initiatingPaymentMethodDetails) { this.initiatingPaymentMethodDetails = initiatingPaymentMethodDetails; return this; } /** The rails used for the object. */ - public Builder setNetwork(Network network) { + public Builder setNetwork(ReceivedDebitCreateParams.Network network) { this.network = network; return this; } @@ -236,8 +236,9 @@ public static class Builder { private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public InitiatingPaymentMethodDetails build() { - return new InitiatingPaymentMethodDetails(this.extraParams, this.type, this.usBankAccount); + public ReceivedDebitCreateParams.InitiatingPaymentMethodDetails build() { + return new ReceivedDebitCreateParams.InitiatingPaymentMethodDetails( + this.extraParams, this.type, this.usBankAccount); } /** @@ -269,13 +270,14 @@ public Builder putAllExtraParam(Map map) { } /** The source type. */ - public Builder setType(Type type) { + public Builder setType(ReceivedDebitCreateParams.InitiatingPaymentMethodDetails.Type type) { this.type = type; return this; } /** Optional fields for {@code us_bank_account}. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + ReceivedDebitCreateParams.InitiatingPaymentMethodDetails.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -329,8 +331,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public ReceivedDebitCreateParams.InitiatingPaymentMethodDetails.UsBankAccount build() { + return new ReceivedDebitCreateParams.InitiatingPaymentMethodDetails.UsBankAccount( this.accountHolderName, this.accountNumber, this.extraParams, this.routingNumber); } diff --git a/src/main/java/com/stripe/param/treasury/ReceivedDebitListParams.java b/src/main/java/com/stripe/param/treasury/ReceivedDebitListParams.java index 3b7e4086f73..fb47c0d2948 100644 --- a/src/main/java/com/stripe/param/treasury/ReceivedDebitListParams.java +++ b/src/main/java/com/stripe/param/treasury/ReceivedDebitListParams.java @@ -197,7 +197,7 @@ public Builder setStartingAfter(String startingAfter) { /** * Only return ReceivedDebits that have the given status: {@code succeeded} or {@code failed}. */ - public Builder setStatus(Status status) { + public Builder setStatus(ReceivedDebitListParams.Status status) { this.status = status; return this; } diff --git a/src/main/java/com/stripe/param/treasury/TransactionEntryListParams.java b/src/main/java/com/stripe/param/treasury/TransactionEntryListParams.java index 4e0755648dc..f87c0a1c8de 100644 --- a/src/main/java/com/stripe/param/treasury/TransactionEntryListParams.java +++ b/src/main/java/com/stripe/param/treasury/TransactionEntryListParams.java @@ -133,7 +133,7 @@ public TransactionEntryListParams build() { this.transaction); } - public Builder setCreated(Created created) { + public Builder setCreated(TransactionEntryListParams.Created created) { this.created = created; return this; } @@ -143,7 +143,7 @@ public Builder setCreated(Long created) { return this; } - public Builder setEffectiveAt(EffectiveAt effectiveAt) { + public Builder setEffectiveAt(TransactionEntryListParams.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; return this; } @@ -235,7 +235,7 @@ public Builder setLimit(Long limit) { * The results are in reverse chronological order by {@code created} or {@code effective_at}. * The default is {@code created}. */ - public Builder setOrderBy(OrderBy orderBy) { + public Builder setOrderBy(TransactionEntryListParams.OrderBy orderBy) { this.orderBy = orderBy; return this; } @@ -309,8 +309,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public TransactionEntryListParams.Created build() { + return new TransactionEntryListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -416,8 +417,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public EffectiveAt build() { - return new EffectiveAt(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public TransactionEntryListParams.EffectiveAt build() { + return new TransactionEntryListParams.EffectiveAt( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** diff --git a/src/main/java/com/stripe/param/treasury/TransactionListParams.java b/src/main/java/com/stripe/param/treasury/TransactionListParams.java index 3399de30606..abd8c457a45 100644 --- a/src/main/java/com/stripe/param/treasury/TransactionListParams.java +++ b/src/main/java/com/stripe/param/treasury/TransactionListParams.java @@ -140,7 +140,7 @@ public TransactionListParams build() { this.statusTransitions); } - public Builder setCreated(Created created) { + public Builder setCreated(TransactionListParams.Created created) { this.created = created; return this; } @@ -232,7 +232,7 @@ public Builder setLimit(Long limit) { * The results are in reverse chronological order by {@code created} or {@code posted_at}. The * default is {@code created}. */ - public Builder setOrderBy(OrderBy orderBy) { + public Builder setOrderBy(TransactionListParams.OrderBy orderBy) { this.orderBy = orderBy; return this; } @@ -252,7 +252,7 @@ public Builder setStartingAfter(String startingAfter) { * Only return Transactions that have the given status: {@code open}, {@code posted}, or {@code * void}. */ - public Builder setStatus(Status status) { + public Builder setStatus(TransactionListParams.Status status) { this.status = status; return this; } @@ -261,7 +261,7 @@ public Builder setStatus(Status status) { * A filter for the {@code status_transitions.posted_at} timestamp. When using this filter, * {@code status=posted} and {@code order_by=posted_at} must also be specified. */ - public Builder setStatusTransitions(StatusTransitions statusTransitions) { + public Builder setStatusTransitions(TransactionListParams.StatusTransitions statusTransitions) { this.statusTransitions = statusTransitions; return this; } @@ -318,8 +318,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public Created build() { - return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public TransactionListParams.Created build() { + return new TransactionListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** @@ -404,8 +405,8 @@ public static class Builder { private Object postedAt; /** Finalize and obtain parameter instance from this builder. */ - public StatusTransitions build() { - return new StatusTransitions(this.extraParams, this.postedAt); + public TransactionListParams.StatusTransitions build() { + return new TransactionListParams.StatusTransitions(this.extraParams, this.postedAt); } /** @@ -436,7 +437,7 @@ public Builder putAllExtraParam(Map map) { } /** Returns Transactions with {@code posted_at} within the specified range. */ - public Builder setPostedAt(PostedAt postedAt) { + public Builder setPostedAt(TransactionListParams.StatusTransitions.PostedAt postedAt) { this.postedAt = postedAt; return this; } @@ -499,8 +500,9 @@ public static class Builder { private Long lte; /** Finalize and obtain parameter instance from this builder. */ - public PostedAt build() { - return new PostedAt(this.extraParams, this.gt, this.gte, this.lt, this.lte); + public TransactionListParams.StatusTransitions.PostedAt build() { + return new TransactionListParams.StatusTransitions.PostedAt( + this.extraParams, this.gt, this.gte, this.lt, this.lte); } /** From 1df1e58bac7ba81e16bbe471cdd664edc25e558e Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 22 Sep 2022 10:52:39 -0700 Subject: [PATCH 21/24] Bump version to 21.9.0 --- CHANGELOG.md | 14 +++++++++++--- README.md | 8 ++++---- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f8f80acbb2..d1aa9582454 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 21.9.0 - 2022-09-22 +* [#1445](https://github.com/stripe/stripe-java/pull/1445) API Updates + * Add support for `terms_of_service` on `Checkout.Session.consent_collection`, `Checkout.Session.consent`, `CheckoutSessionCreateParams.consent_collection`, `PaymentLink.consent_collection`, and `PaymentLinkCreateParams.consent_collection` + * ⚠️ Remove support for `plan` on `CheckoutSessionCreateParams.payment_method_options.card.installments`. The property was mistakenly released and never worked. + * Add support for `amount` on `IssuingDisputeCreateParams` and `IssuingDisputeUpdateParams` + * Add support for `statement_descriptor` on `PaymentIntentIncrementAuthorizationParams` + * Add `upcomingLines` method to `Invoice` resource. + ## 21.8.0 - 2022-09-15 * [#1444](https://github.com/stripe/stripe-java/pull/1444) API Updates * Add support for `pix` on `Charge.payment_method_details`, `Checkout.Session.payment_method_options`, `CheckoutSessionCreateParams.payment_method_options`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data` @@ -19,9 +27,9 @@ ## 21.6.0 - 2022-09-06 * [#1434](https://github.com/stripe/stripe-java/pull/1434) API Updates - * Add support for new value `terminal_reader_splashscreen` on enum `FileListParams.purpose` - * Fix `LineItem.Discount.discount` to reference the correct `Discount` class (`com.stripe.model.Discount`) - + * Add support for new value `terminal_reader_splashscreen` on enum `FileListParams.purpose` + * Fix `LineItem.Discount.discount` to reference the correct `Discount` class (`com.stripe.model.Discount`) + ## 21.5.0 - 2022-08-31 * [#1433](https://github.com/stripe/stripe-java/pull/1433) API Updates diff --git a/README.md b/README.md index de5bd487070..87defbc825d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stripe Java client library -[![Maven Central](https://img.shields.io/badge/maven--central-v21.8.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) +[![Maven Central](https://img.shields.io/badge/maven--central-v21.9.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master) @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:21.8.0" +implementation "com.stripe:stripe-java:21.9.0" ``` ### Maven users @@ -29,7 +29,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 21.8.0 + 21.9.0 ``` @@ -37,7 +37,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.8.0/stripe-java-21.8.0.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.9.0/stripe-java-21.9.0.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index af52b1c5ccb..6ff4c570621 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -21.8.0 +21.9.0 diff --git a/gradle.properties b/gradle.properties index 17a31f2082c..f6c7f3d00cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=21.8.0 +VERSION_NAME=21.9.0 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index 6f27914b652..6bd06034d39 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -13,7 +13,7 @@ public abstract class Stripe { public static final String CONNECT_API_BASE = "https://connect.stripe.com"; public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; - public static final String VERSION = "21.8.0"; + public static final String VERSION = "21.9.0"; public static volatile String apiKey; public static volatile String clientId; From 3b5b979df12a41368c9a38002fd7882f157a178a Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 26 Sep 2022 12:23:15 -0700 Subject: [PATCH 22/24] Set version to 21.9.0 to simplify merge --- README.md | 6 +++--- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 44992a94361..025ec779096 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:21.4.0-beta.1" +implementation "com.stripe:stripe-java:21.9.0" ``` ### Maven users @@ -29,7 +29,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 21.4.0-beta.1 + 21.9.0 ``` @@ -37,7 +37,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.4.0-beta.1/stripe-java-21.4.0-beta.1.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.9.0/stripe-java-21.9.0.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index be3ef6c254a..6ff4c570621 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -21.4.0-beta.1 +21.9.0 diff --git a/gradle.properties b/gradle.properties index 5c6587ed5f0..f6c7f3d00cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=21.4.0-beta.1 +VERSION_NAME=21.9.0 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index c7ae25d2b40..cc1ac45c683 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -13,7 +13,7 @@ public abstract class Stripe { public static final String CONNECT_API_BASE = "https://connect.stripe.com"; public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; - public static final String VERSION = "21.4.0-beta.1"; + public static final String VERSION = "21.9.0"; public static volatile String apiKey; public static volatile String clientId; From 479ca731a4477eea761b9a90d3f3f01712e5c18c Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 26 Sep 2022 12:25:04 -0700 Subject: [PATCH 23/24] Reset version to 21.4.0-beta.1 --- README.md | 8 ++++---- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 38fac204659..0c080ec7207 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stripe Java client library -[![Maven Central](https://img.shields.io/badge/maven--central-v21.9.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) +[![Maven Central](https://img.shields.io/badge/maven--central-v21.4.0-beta.1-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master) @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:21.9.0" +implementation "com.stripe:stripe-java:21.4.0-beta.1" ``` ### Maven users @@ -29,7 +29,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 21.9.0 + 21.4.0-beta.1 ``` @@ -37,7 +37,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.9.0/stripe-java-21.9.0.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.4.0-beta.1/stripe-java-21.4.0-beta.1.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index 6ff4c570621..be3ef6c254a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -21.9.0 +21.4.0-beta.1 diff --git a/gradle.properties b/gradle.properties index f6c7f3d00cf..5c6587ed5f0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=21.9.0 +VERSION_NAME=21.4.0-beta.1 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index cc1ac45c683..c7ae25d2b40 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -13,7 +13,7 @@ public abstract class Stripe { public static final String CONNECT_API_BASE = "https://connect.stripe.com"; public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; - public static final String VERSION = "21.9.0"; + public static final String VERSION = "21.4.0-beta.1"; public static volatile String apiKey; public static volatile String clientId; From 46694606c7694bd3b78a217128301c9a9b6f10dc Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 26 Sep 2022 12:25:59 -0700 Subject: [PATCH 24/24] Codegen for openapi v196 --- OPENAPI_VERSION | 2 +- .../java/com/stripe/model/AccountSession.java | 8 +- .../stripe/model/EventDataClassLookup.java | 5 + src/main/java/com/stripe/model/Invoice.java | 119 ++- src/main/java/com/stripe/model/Order.java | 4 +- .../java/com/stripe/model/PaymentIntent.java | 53 ++ .../java/com/stripe/model/PaymentMethod.java | 13 +- src/main/java/com/stripe/model/Plan.java | 21 - src/main/java/com/stripe/model/Product.java | 49 + src/main/java/com/stripe/model/Quote.java | 7 + .../java/com/stripe/model/QuotePhase.java | 24 +- .../java/com/stripe/model/Subscription.java | 40 +- .../stripe/model/SubscriptionSchedule.java | 221 ++++- .../stripe/model/capital/FinancingOffer.java | 330 +++++++ .../capital/FinancingOfferCollection.java | 6 + .../model/capital/FinancingSummary.java | 145 +++ .../model/capital/FinancingTransaction.java | 206 +++++ .../FinancingTransactionCollection.java | 6 + .../java/com/stripe/model/issuing/Card.java | 8 + .../CustomerListPaymentMethodsParams.java | 3 + .../param/InvoiceUpcomingLinesParams.java | 222 +++++ .../stripe/param/InvoiceUpcomingParams.java | 182 ++-- .../com/stripe/param/OrderCreateParams.java | 845 ++++++++++++----- .../com/stripe/param/OrderUpdateParams.java | 854 +++++++++++++----- .../param/PaymentIntentConfirmParams.java | 286 ++++++ .../param/PaymentIntentCreateParams.java | 288 +++++- .../param/PaymentIntentUpdateParams.java | 313 ++++++- .../stripe/param/PaymentLinkCreateParams.java | 3 + .../stripe/param/PaymentLinkUpdateParams.java | 3 + .../param/PaymentMethodCreateParams.java | 385 +++++--- .../stripe/param/PaymentMethodListParams.java | 3 + .../com/stripe/param/PriceUpdateParams.java | 9 +- .../com/stripe/param/ProductCreateParams.java | 25 +- .../com/stripe/param/QuoteCreateParams.java | 219 +++-- .../com/stripe/param/QuoteUpdateParams.java | 222 +++-- .../param/SetupIntentConfirmParams.java | 637 +++++++++---- .../stripe/param/SetupIntentCreateParams.java | 651 +++++++++---- .../stripe/param/SetupIntentUpdateParams.java | 612 +++++++++---- .../param/SubscriptionCreateParams.java | 346 ++++--- .../param/SubscriptionItemCreateParams.java | 19 +- .../param/SubscriptionItemUpdateParams.java | 11 +- .../SubscriptionScheduleAmendParams.java | 216 +++-- .../SubscriptionScheduleCreateParams.java | 277 ++++-- .../SubscriptionScheduleUpdateParams.java | 302 +++++-- .../param/SubscriptionUpdateParams.java | 350 ++++--- .../param/WebhookEndpointCreateParams.java | 3 + .../param/WebhookEndpointUpdateParams.java | 3 + .../capital/FinancingOfferListParams.java | 365 ++++++++ .../FinancingOfferMarkDeliveredParams.java | 98 ++ .../capital/FinancingOfferRetrieveParams.java | 98 ++ .../FinancingSummaryRetrieveParams.java | 98 ++ .../FinancingTransactionListParams.java | 226 +++++ .../FinancingTransactionRetrieveParams.java | 98 ++ .../param/checkout/SessionCreateParams.java | 87 ++ .../param/giftcards/CardCreateParams.java | 14 +- .../param/giftcards/CardValidateParams.java | 16 +- .../giftcards/TransactionCreateParams.java | 15 +- .../param/issuing/CardCreateParams.java | 102 ++- .../ReaderPresentPaymentMethodParams.java | 7 +- .../OutboundTransferCreateParams.java | 16 +- .../treasury/ReceivedCreditCreateParams.java | 14 +- .../treasury/ReceivedDebitCreateParams.java | 14 +- 62 files changed, 7752 insertions(+), 2072 deletions(-) create mode 100644 src/main/java/com/stripe/model/capital/FinancingOffer.java create mode 100644 src/main/java/com/stripe/model/capital/FinancingOfferCollection.java create mode 100644 src/main/java/com/stripe/model/capital/FinancingSummary.java create mode 100644 src/main/java/com/stripe/model/capital/FinancingTransaction.java create mode 100644 src/main/java/com/stripe/model/capital/FinancingTransactionCollection.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingOfferListParams.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingOfferMarkDeliveredParams.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingOfferRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingSummaryRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingTransactionListParams.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingTransactionRetrieveParams.java diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 073a3a984e1..72833e6d4c3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v185 \ No newline at end of file +v196 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/AccountSession.java b/src/main/java/com/stripe/model/AccountSession.java index c8fd9988c53..e55676cddd4 100644 --- a/src/main/java/com/stripe/model/AccountSession.java +++ b/src/main/java/com/stripe/model/AccountSession.java @@ -14,14 +14,14 @@ /** * An AccountSession allows a Connect platform to grant access to a connected account in Connect - * Elements. + * Embedded UIs. * *

We recommend that you create an AccountSession each time you need to display an embedded UI to * your user. Do not save AccountSessions to your database as they expire relatively quickly, and * cannot be used more than once. * *

Related guide: Connect - * Elements. + * Embedded UIs. */ @Getter @Setter @@ -40,8 +40,8 @@ public class AccountSession extends ApiResource { * that you have TLS enabled on any page that includes the client secret. * *

Refer to our docs to setup Connect Elements - * and learn about how {@code client_secret} should be handled. + * href="https://stripe.com/docs/connect/get-started-connect-elements">setup Connect Embedded + * UIs and learn about how {@code client_secret} should be handled. */ @SerializedName("client_secret") String clientSecret; diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index c7ec3b01889..2c022971d74 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -91,6 +91,11 @@ final class EventDataClassLookup { "billing_portal.configuration", com.stripe.model.billingportal.Configuration.class); classLookup.put("billing_portal.session", com.stripe.model.billingportal.Session.class); + classLookup.put("capital.financing_offer", com.stripe.model.capital.FinancingOffer.class); + classLookup.put("capital.financing_summary", com.stripe.model.capital.FinancingSummary.class); + classLookup.put( + "capital.financing_transaction", com.stripe.model.capital.FinancingTransaction.class); + classLookup.put("checkout.session", com.stripe.model.checkout.Session.class); classLookup.put( diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index 758c436e5fa..4706ce90425 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -15,6 +15,7 @@ import com.stripe.param.InvoiceRetrieveParams; import com.stripe.param.InvoiceSearchParams; import com.stripe.param.InvoiceSendInvoiceParams; +import com.stripe.param.InvoiceUpcomingLinesParams; import com.stripe.param.InvoiceUpcomingParams; import com.stripe.param.InvoiceUpdateParams; import com.stripe.param.InvoiceVoidInvoiceParams; @@ -316,6 +317,14 @@ public class Invoice extends ApiResource implements HasId, MetadataStorerevision documentation for more + * details. + */ + @SerializedName("from_invoice") + FromInvoice fromInvoice; + /** * The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the * invoice has not been finalized yet, this will be null. @@ -342,6 +351,12 @@ public class Invoice extends ApiResource implements HasId, MetadataStore latestRevision; + /** * The individual line items that make up the invoice. {@code lines} is sorted as follows: invoice * items in reverse chronological order, followed by the subscription, if any. @@ -522,7 +537,7 @@ public class Invoice extends ApiResource implements HasId, MetadataStore totalDiscountAmounts; + List totalDiscountAmounts; /** * The integer amount in %s representing the total amount of the invoice including all discounts @@ -644,6 +659,24 @@ public void setDefaultSourceObject(PaymentSource expandableObject) { new ExpandableField(expandableObject.getId(), expandableObject); } + /** Get ID of expandable {@code latestRevision} object. */ + public String getLatestRevision() { + return (this.latestRevision != null) ? this.latestRevision.getId() : null; + } + + public void setLatestRevision(String id) { + this.latestRevision = ApiResource.setExpandableFieldId(id, this.latestRevision); + } + + /** Get expanded {@code latestRevision}. */ + public Invoice getLatestRevisionObject() { + return (this.latestRevision != null) ? this.latestRevision.getExpanded() : null; + } + + public void setLatestRevisionObject(Invoice expandableObject) { + this.latestRevision = new ExpandableField(expandableObject.getId(), expandableObject); + } + /** Get ID of expandable {@code onBehalfOf} object. */ public String getOnBehalfOf() { return (this.onBehalfOf != null) ? this.onBehalfOf.getId() : null; @@ -1449,6 +1482,57 @@ public static Invoice upcoming(InvoiceUpcomingParams params, RequestOptions opti return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options); } + /** + * When retrieving an upcoming invoice, you’ll get a lines property containing + * the total count of line items and the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + */ + public static InvoiceLineItemCollection upcomingLines() throws StripeException { + return upcomingLines((Map) null, (RequestOptions) null); + } + + /** + * When retrieving an upcoming invoice, you’ll get a lines property containing + * the total count of line items and the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + */ + public static InvoiceLineItemCollection upcomingLines(Map params) + throws StripeException { + return upcomingLines(params, (RequestOptions) null); + } + + /** + * When retrieving an upcoming invoice, you’ll get a lines property containing + * the total count of line items and the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + */ + public static InvoiceLineItemCollection upcomingLines( + Map params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/upcoming/lines"); + return ApiResource.requestCollection(url, params, InvoiceLineItemCollection.class, options); + } + + /** + * When retrieving an upcoming invoice, you’ll get a lines property containing + * the total count of line items and the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + */ + public static InvoiceLineItemCollection upcomingLines(InvoiceUpcomingLinesParams params) + throws StripeException { + return upcomingLines(params, (RequestOptions) null); + } + + /** + * When retrieving an upcoming invoice, you’ll get a lines property containing + * the total count of line items and the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + */ + public static InvoiceLineItemCollection upcomingLines( + InvoiceUpcomingLinesParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/upcoming/lines"); + return ApiResource.requestCollection(url, params, InvoiceLineItemCollection.class, options); + } + /** * Draft invoices are fully editable. Once an invoice is finalized, monetary @@ -1674,6 +1758,39 @@ public void setDiscountObject(Discount expandableObject) { } } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FromInvoice extends StripeObject { + /** The relation between this invoice and the cloned invoice. */ + @SerializedName("action") + String action; + + /** The invoice that was cloned. */ + @SerializedName("invoice") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField invoice; + + /** Get ID of expandable {@code invoice} object. */ + public String getInvoice() { + return (this.invoice != null) ? this.invoice.getId() : null; + } + + public void setInvoice(String id) { + this.invoice = ApiResource.setExpandableFieldId(id, this.invoice); + } + + /** Get expanded {@code invoice}. */ + public Invoice getInvoiceObject() { + return (this.invoice != null) ? this.invoice.getExpanded() : null; + } + + public void setInvoiceObject(Invoice expandableObject) { + this.invoice = new ExpandableField(expandableObject.getId(), expandableObject); + } + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Order.java b/src/main/java/com/stripe/model/Order.java index 38ef4fa5995..16c46c0561c 100644 --- a/src/main/java/com/stripe/model/Order.java +++ b/src/main/java/com/stripe/model/Order.java @@ -1084,7 +1084,7 @@ public static class CustomerBalance extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class BankTransfer extends StripeObject { @SerializedName("eu_bank_transfer") - PaymentIntent.PaymentMethodOptions.BankTransfer.EuBankTransfer euBankTransfer; + EuBankTransfer euBankTransfer; /** * List of address types that should be returned in the financial_addresses response. If @@ -1635,7 +1635,7 @@ public static class Discount extends StripeObject { * Subscriptions. */ @SerializedName("discount") - Discount discount; + com.stripe.model.Discount discount; } @Getter diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 8b827b89754..315a9890c0c 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -1464,6 +1464,9 @@ public static class NextAction extends StripeObject { @SerializedName("paynow_display_qr_code") PaynowDisplayQrCode paynowDisplayQrCode; + @SerializedName("pix_display_qr_code") + PixDisplayQrCode pixDisplayQrCode; + @SerializedName("promptpay_display_qr_code") PromptpayDisplayQrCode promptpayDisplayQrCode; @@ -1518,6 +1521,37 @@ public static class PaynowDisplayQrCode extends StripeObject { String imageUrlSvg; } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PixDisplayQrCode extends StripeObject { + /** + * The raw data string used to generate QR code, it should be used together with QR code + * library. + */ + @SerializedName("data") + String data; + + /** The date (unix timestamp) when the PIX expires. */ + @SerializedName("expires_at") + Long expiresAt; + + /** + * The URL to the hosted pix instructions page, which allows customers to view the pix QR + * code. + */ + @SerializedName("hosted_instructions_url") + String hostedInstructionsUrl; + + /** The image_url_png string used to render png QR code. */ + @SerializedName("image_url_png") + String imageUrlPng; + + /** The image_url_svg string used to render svg QR code. */ + @SerializedName("image_url_svg") + String imageUrlSvg; + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -2097,6 +2131,12 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("paynow") Paynow paynow; + @SerializedName("paypal") + Paypal paypal; + + @SerializedName("pix") + Pix pix; + @SerializedName("promptpay") Promptpay promptpay; @@ -3080,6 +3120,19 @@ public static class Paypal extends StripeObject { String preferredLocale; } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Pix extends StripeObject { + /** The number of seconds (between 10 and 1209600) after which Pix payment will expire. */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + + /** The timestamp at which the Pix expires. */ + @SerializedName("expires_at") + Long expiresAt; + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 13387f45523..07423a05442 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -147,6 +147,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore

Equal to {@code at_cycle_end}. - */ - @SerializedName("behavior") - String behavior; - - /** The unix timestamp after at which subscriptions will start to migrate to the new price. */ - @SerializedName("effective_after") - Long effectiveAfter; - - /** The id of the price being migrated to. */ - @SerializedName("price") - String price; - } - @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Product.java b/src/main/java/com/stripe/model/Product.java index b444419bc36..ce4f6289f33 100644 --- a/src/main/java/com/stripe/model/Product.java +++ b/src/main/java/com/stripe/model/Product.java @@ -453,4 +453,53 @@ public Product update(ProductUpdateParams params, RequestOptions options) throws String.format("/v1/products/%s", ApiResource.urlEncodeId(this.getId()))); return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Product.class, options); } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Provisioning extends StripeObject { + @SerializedName("gift_card") + GiftCard giftCard; + + /** + * The type of provisioning, only {@code gift_card} currently supported. + * + *

Equal to {@code gift_card}. + */ + @SerializedName("type") + String type; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard extends StripeObject { + @SerializedName("fixed_amount") + FixedAmount fixedAmount; + + /** + * The specific type of gift_card provisioning, only {@code fixed_amount} currently supported. + * + *

Equal to {@code fixed_amount}. + */ + @SerializedName("type") + String type; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FixedAmount extends StripeObject { + /** The initial amount with which the provisioned gift card will be created. */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + } + } + } } diff --git a/src/main/java/com/stripe/model/Quote.java b/src/main/java/com/stripe/model/Quote.java index a55e4f9ecda..046c2bde10b 100644 --- a/src/main/java/com/stripe/model/Quote.java +++ b/src/main/java/com/stripe/model/Quote.java @@ -1016,6 +1016,13 @@ public static class SubscriptionData extends StripeObject { @SerializedName("billing_cycle_anchor") String billingCycleAnchor; + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** * When creating a new subscription, the date of which the subscription schedule will start * after the quote is accepted. This date is ignored if it is in the past when the quote is diff --git a/src/main/java/com/stripe/model/QuotePhase.java b/src/main/java/com/stripe/model/QuotePhase.java index d710ec660b3..adecc9a35b1 100644 --- a/src/main/java/com/stripe/model/QuotePhase.java +++ b/src/main/java/com/stripe/model/QuotePhase.java @@ -338,12 +338,34 @@ public static class TotalDetails extends StripeObject { public static class Breakdown extends StripeObject { /** The aggregated discounts. */ @SerializedName("discounts") - List discounts; + List discounts; /** The aggregated tax amounts by rate. */ @SerializedName("taxes") List taxes; + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Discount extends StripeObject { + /** The amount discounted. */ + @SerializedName("amount") + Long amount; + + /** + * A discount represents the actual application of a coupon or promotion code. It contains + * information about when the discount began, when it will end, and what it is applied to. + * + *

Related guide: Applying Discounts to + * Subscriptions. + */ + @SerializedName("discount") + com.stripe.model.Discount discount; + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index 02a4a13ac92..bc9bcc9af69 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -275,7 +275,7 @@ public class Subscription extends ApiResource implements HasId, MetadataStore invoice; + + /** The end of the last period for which the invoice pre-bills. */ + @SerializedName("period_end") + Long periodEnd; + + /** The start of the first period for which the invoice pre-bills. */ + @SerializedName("period_start") + Long periodStart; + + /** Get ID of expandable {@code invoice} object. */ + public String getInvoice() { + return (this.invoice != null) ? this.invoice.getId() : null; + } + + public void setInvoice(String id) { + this.invoice = ApiResource.setExpandableFieldId(id, this.invoice); + } + + /** Get expanded {@code invoice}. */ + public Invoice getInvoiceObject() { + return (this.invoice != null) ? this.invoice.getExpanded() : null; + } + + public void setInvoiceObject(Invoice expandableObject) { + this.invoice = new ExpandableField(expandableObject.getId(), expandableObject); + } + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/SubscriptionSchedule.java b/src/main/java/com/stripe/model/SubscriptionSchedule.java index c2fa2affa68..8508ac4c754 100644 --- a/src/main/java/com/stripe/model/SubscriptionSchedule.java +++ b/src/main/java/com/stripe/model/SubscriptionSchedule.java @@ -129,7 +129,7 @@ public class SubscriptionSchedule extends ApiResource /** Time period and invoice for a Subscription billed in advance. */ @SerializedName("prebilling") - SubscriptionPrebillingData prebilling; + Prebilling prebilling; /** * Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. @@ -590,7 +590,7 @@ public SubscriptionSchedule update( public static class AddInvoiceItem extends StripeObject { /** The stackable discounts that will be applied to the item. */ @SerializedName("discounts") - List discounts; + List discounts; /** ID of the price used to generate the invoice item. */ @SerializedName("price") @@ -626,6 +626,59 @@ public Price getPriceObject() { public void setPriceObject(Price expandableObject) { this.price = new ExpandableField(expandableObject.getId(), expandableObject); } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StackableDiscount extends StripeObject { + /** ID of the coupon to create a new discount for. */ + @SerializedName("coupon") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField coupon; + + /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ + @SerializedName("discount") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField discount; + + /** Get ID of expandable {@code coupon} object. */ + public String getCoupon() { + return (this.coupon != null) ? this.coupon.getId() : null; + } + + public void setCoupon(String id) { + this.coupon = ApiResource.setExpandableFieldId(id, this.coupon); + } + + /** Get expanded {@code coupon}. */ + public Coupon getCouponObject() { + return (this.coupon != null) ? this.coupon.getExpanded() : null; + } + + public void setCouponObject(Coupon expandableObject) { + this.coupon = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code discount} object. */ + public String getDiscount() { + return (this.discount != null) ? this.discount.getId() : null; + } + + public void setDiscount(String id) { + this.discount = ApiResource.setExpandableFieldId(id, this.discount); + } + + /** Get expanded {@code discount}. */ + public Discount getDiscountObject() { + return (this.discount != null) ? this.discount.getExpanded() : null; + } + + public void setDiscountObject(Discount expandableObject) { + this.discount = new ExpandableField(expandableObject.getId(), expandableObject); + } + } } @Getter @@ -695,6 +748,13 @@ public static class DefaultSettings extends StripeObject { @Setter(lombok.AccessLevel.NONE) ExpandableField defaultPaymentMethod; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** The subscription schedule's default invoice settings. */ @SerializedName("invoice_settings") InvoiceSettings invoiceSettings; @@ -836,12 +896,19 @@ public static class Phase extends StripeObject { @SerializedName("default_tax_rates") List defaultTaxRates; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** * The stackable discounts that will be applied to the subscription on this phase. Subscription * item discounts are applied before subscription discounts. */ @SerializedName("discounts") - List discounts; + List discounts; /** The end of this phase of the subscription schedule. */ @SerializedName("end_date") @@ -945,6 +1012,61 @@ public static class AutomaticTax extends StripeObject { @SerializedName("enabled") Boolean enabled; } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Discount extends StripeObject { + /** ID of the coupon to create a new discount for. */ + @SerializedName("coupon") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField coupon; + + /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ + @SerializedName("discount") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField discount; + + /** Get ID of expandable {@code coupon} object. */ + public String getCoupon() { + return (this.coupon != null) ? this.coupon.getId() : null; + } + + public void setCoupon(String id) { + this.coupon = ApiResource.setExpandableFieldId(id, this.coupon); + } + + /** Get expanded {@code coupon}. */ + public Coupon getCouponObject() { + return (this.coupon != null) ? this.coupon.getExpanded() : null; + } + + public void setCouponObject(Coupon expandableObject) { + this.coupon = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code discount} object. */ + public String getDiscount() { + return (this.discount != null) ? this.discount.getId() : null; + } + + public void setDiscount(String id) { + this.discount = ApiResource.setExpandableFieldId(id, this.discount); + } + + /** Get expanded {@code discount}. */ + public com.stripe.model.Discount getDiscountObject() { + return (this.discount != null) ? this.discount.getExpanded() : null; + } + + public void setDiscountObject(com.stripe.model.Discount expandableObject) { + this.discount = + new ExpandableField( + expandableObject.getId(), expandableObject); + } + } } /** A phase item describes the price and quantity of a phase. */ @@ -964,7 +1086,7 @@ public static class PhaseItem extends StripeObject { * before subscription discounts. Use {@code expand[]=discounts} to expand each discount. */ @SerializedName("discounts") - List discounts; + List discounts; /** * Set of key-value pairs that you can attach @@ -1037,6 +1159,59 @@ public void setPriceObject(Price expandableObject) { this.price = new ExpandableField(expandableObject.getId(), expandableObject); } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StackableDiscount extends StripeObject { + /** ID of the coupon to create a new discount for. */ + @SerializedName("coupon") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField coupon; + + /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ + @SerializedName("discount") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField discount; + + /** Get ID of expandable {@code coupon} object. */ + public String getCoupon() { + return (this.coupon != null) ? this.coupon.getId() : null; + } + + public void setCoupon(String id) { + this.coupon = ApiResource.setExpandableFieldId(id, this.coupon); + } + + /** Get expanded {@code coupon}. */ + public Coupon getCouponObject() { + return (this.coupon != null) ? this.coupon.getExpanded() : null; + } + + public void setCouponObject(Coupon expandableObject) { + this.coupon = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code discount} object. */ + public String getDiscount() { + return (this.discount != null) ? this.discount.getId() : null; + } + + public void setDiscount(String id) { + this.discount = ApiResource.setExpandableFieldId(id, this.discount); + } + + /** Get expanded {@code discount}. */ + public Discount getDiscountObject() { + return (this.discount != null) ? this.discount.getExpanded() : null; + } + + public void setDiscountObject(Discount expandableObject) { + this.discount = new ExpandableField(expandableObject.getId(), expandableObject); + } + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -1045,4 +1220,42 @@ public static class Trial extends StripeObject { String type; } } + + /** Prebilling stores the time period and invoice for a Subscription billed in advance. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Prebilling extends StripeObject { + /** ID of the prebilling invoice. */ + @SerializedName("invoice") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField invoice; + + /** The end of the last period for which the invoice pre-bills. */ + @SerializedName("period_end") + Long periodEnd; + + /** The start of the first period for which the invoice pre-bills. */ + @SerializedName("period_start") + Long periodStart; + + /** Get ID of expandable {@code invoice} object. */ + public String getInvoice() { + return (this.invoice != null) ? this.invoice.getId() : null; + } + + public void setInvoice(String id) { + this.invoice = ApiResource.setExpandableFieldId(id, this.invoice); + } + + /** Get expanded {@code invoice}. */ + public Invoice getInvoiceObject() { + return (this.invoice != null) ? this.invoice.getExpanded() : null; + } + + public void setInvoiceObject(Invoice expandableObject) { + this.invoice = new ExpandableField(expandableObject.getId(), expandableObject); + } + } } diff --git a/src/main/java/com/stripe/model/capital/FinancingOffer.java b/src/main/java/com/stripe/model/capital/FinancingOffer.java new file mode 100644 index 00000000000..dbbfecdb970 --- /dev/null +++ b/src/main/java/com/stripe/model/capital/FinancingOffer.java @@ -0,0 +1,330 @@ +// File generated from our OpenAPI spec +package com.stripe.model.capital; + +import com.google.gson.annotations.SerializedName; +import com.stripe.Stripe; +import com.stripe.exception.StripeException; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiResource; +import com.stripe.net.RequestOptions; +import com.stripe.param.capital.FinancingOfferListParams; +import com.stripe.param.capital.FinancingOfferMarkDeliveredParams; +import com.stripe.param.capital.FinancingOfferRetrieveParams; +import java.math.BigDecimal; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * This is an object representing an offer of financing from Stripe Capital to a Connect subaccount. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class FinancingOffer extends ApiResource implements HasId { + /** + * This is an object representing the terms of an offer of financing from Stripe Capital to a + * Connected account. This resource represents the terms accepted by the Connected account, which + * may differ from those offered. + */ + @SerializedName("accepted_terms") + AcceptedTerms acceptedTerms; + + /** The ID of the merchant associated with this financing object. */ + @SerializedName("account") + String account; + + /** Time at which the offer was created. Given in seconds since unix epoch. */ + @SerializedName("created") + Long created; + + /** Time at which the offer expires. Given in seconds since unix epoch. */ + @SerializedName("expires_after") + BigDecimal expiresAfter; + + /** + * The type of financing being offered. + * + *

One of {@code cash_advance}, or {@code flex_loan}. + */ + @SerializedName("financing_type") + String financingType; + + /** A unique identifier for the financing object. */ + @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; + + /** + * 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 object type: financing_offer. + * + *

Equal to {@code capital.financing_offer}. + */ + @SerializedName("object") + String object; + + /** + * This is an object representing the terms of an offer of financing from Stripe Capital to a + * Connected account. This resource represents both the terms offered to the Connected account. + */ + @SerializedName("offered_terms") + OfferedTerms offeredTerms; + + /** + * Financing product identifier. + * + *

One of {@code refill}, or {@code standard}. + */ + @SerializedName("product_type") + String productType; + + /** + * The current status of the offer. + * + *

One of {@code accepted}, {@code canceled}, {@code completed}, {@code delivered}, {@code + * expired}, {@code fully_repaid}, {@code paid_out}, {@code rejected}, or {@code undelivered}. + */ + @SerializedName("status") + String status; + + /** + * See financing_type. + * + *

One of {@code cash_advance}, or {@code flex_loan}. + */ + @SerializedName("type") + String type; + + /** + * Retrieves the financing offers available for Connected accounts that belong to your platform. + */ + public static FinancingOfferCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Retrieves the financing offers available for Connected accounts that belong to your platform. + */ + public static FinancingOfferCollection list(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/capital/financing_offers"); + return ApiResource.requestCollection(url, params, FinancingOfferCollection.class, options); + } + + /** + * Retrieves the financing offers available for Connected accounts that belong to your platform. + */ + public static FinancingOfferCollection list(FinancingOfferListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Retrieves the financing offers available for Connected accounts that belong to your platform. + */ + public static FinancingOfferCollection list( + FinancingOfferListParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/capital/financing_offers"); + return ApiResource.requestCollection(url, params, FinancingOfferCollection.class, options); + } + + /** + * Acknowledges that platform has received and delivered the financing_offer to the intended + * merchant recipient. This is required to make the application accessible. + */ + public FinancingOffer markDelivered() throws StripeException { + return markDelivered((Map) null, (RequestOptions) null); + } + + /** + * Acknowledges that platform has received and delivered the financing_offer to the intended + * merchant recipient. This is required to make the application accessible. + */ + public FinancingOffer markDelivered(RequestOptions options) throws StripeException { + return markDelivered((Map) null, options); + } + + /** + * Acknowledges that platform has received and delivered the financing_offer to the intended + * merchant recipient. This is required to make the application accessible. + */ + public FinancingOffer markDelivered(Map params) throws StripeException { + return markDelivered(params, (RequestOptions) null); + } + + /** + * Acknowledges that platform has received and delivered the financing_offer to the intended + * merchant recipient. This is required to make the application accessible. + */ + public FinancingOffer markDelivered(Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/capital/financing_offers/%s/mark_delivered", + ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, FinancingOffer.class, options); + } + + /** + * Acknowledges that platform has received and delivered the financing_offer to the intended + * merchant recipient. This is required to make the application accessible. + */ + public FinancingOffer markDelivered(FinancingOfferMarkDeliveredParams params) + throws StripeException { + return markDelivered(params, (RequestOptions) null); + } + + /** + * Acknowledges that platform has received and delivered the financing_offer to the intended + * merchant recipient. This is required to make the application accessible. + */ + public FinancingOffer markDelivered( + FinancingOfferMarkDeliveredParams params, RequestOptions options) throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/capital/financing_offers/%s/mark_delivered", + ApiResource.urlEncodeId(this.getId()))); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, FinancingOffer.class, options); + } + + /** Get the details of the financing offer. */ + public static FinancingOffer retrieve(String financingOffer) throws StripeException { + return retrieve(financingOffer, (Map) null, (RequestOptions) null); + } + + /** Get the details of the financing offer. */ + public static FinancingOffer retrieve(String financingOffer, RequestOptions options) + throws StripeException { + return retrieve(financingOffer, (Map) null, options); + } + + /** Get the details of the financing offer. */ + public static FinancingOffer retrieve( + String financingOffer, Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/capital/financing_offers/%s", ApiResource.urlEncodeId(financingOffer))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, FinancingOffer.class, options); + } + + /** Get the details of the financing offer. */ + public static FinancingOffer retrieve( + String financingOffer, FinancingOfferRetrieveParams params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/capital/financing_offers/%s", ApiResource.urlEncodeId(financingOffer))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, FinancingOffer.class, options); + } + + /** + * This is an object representing the terms of an offer of financing from Stripe Capital to a + * Connected account. This resource represents the terms accepted by the Connected account, which + * may differ from those offered. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AcceptedTerms extends StripeObject { + /** Amount of financing offered, in minor units. */ + @SerializedName("advance_amount") + Long advanceAmount; + + /** Currency that the financing offer is transacted in. For example, {@code usd}. */ + @SerializedName("currency") + String currency; + + /** Fixed fee amount, in minor units. */ + @SerializedName("fee_amount") + Long feeAmount; + + /** + * Populated when the {@code product_type} of the {@code financingoffer} is {@code refill}. + * Represents the discount amount on remaining premium for the existing loan at payout time. + */ + @SerializedName("previous_financing_fee_discount_amount") + Long previousFinancingFeeDiscountAmount; + + /** Per-transaction rate at which Stripe will withhold funds to repay the financing. */ + @SerializedName("withhold_rate") + BigDecimal withholdRate; + } + + /** + * This is an object representing the terms of an offer of financing from Stripe Capital to a + * Connected account. This resource represents both the terms offered to the Connected account. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OfferedTerms extends StripeObject { + /** Amount of financing offered, in minor units. */ + @SerializedName("advance_amount") + Long advanceAmount; + + /** + * Describes the type of user the offer is being extended to. + * + *

One of {@code newly_eligible_user}, {@code previously_eligible_user}, or {@code + * repeat_user}. + */ + @SerializedName("campaign_type") + String campaignType; + + /** Currency that the financing offer is transacted in. For example, {@code usd}. */ + @SerializedName("currency") + String currency; + + /** Fixed fee amount, in minor units. */ + @SerializedName("fee_amount") + Long feeAmount; + + /** + * Populated when the {@code product_type} of the {@code financingoffer} is {@code refill}. + * Represents the discount rate percentage on remaining premium on the existing loan. When the + * {@code financing_offer} is paid out, the {@code previous_financing_fee_discount_amount} will + * be computed as the multiple of this rate and the remaining premium. + */ + @SerializedName("previous_financing_fee_discount_rate") + BigDecimal previousFinancingFeeDiscountRate; + + /** Per-transaction rate at which Stripe will withhold funds to repay the financing. */ + @SerializedName("withhold_rate") + BigDecimal withholdRate; + } +} diff --git a/src/main/java/com/stripe/model/capital/FinancingOfferCollection.java b/src/main/java/com/stripe/model/capital/FinancingOfferCollection.java new file mode 100644 index 00000000000..63689d3bff9 --- /dev/null +++ b/src/main/java/com/stripe/model/capital/FinancingOfferCollection.java @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec +package com.stripe.model.capital; + +import com.stripe.model.StripeCollection; + +public class FinancingOfferCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/capital/FinancingSummary.java b/src/main/java/com/stripe/model/capital/FinancingSummary.java new file mode 100644 index 00000000000..5627499bbf0 --- /dev/null +++ b/src/main/java/com/stripe/model/capital/FinancingSummary.java @@ -0,0 +1,145 @@ +// File generated from our OpenAPI spec +package com.stripe.model.capital; + +import com.google.gson.annotations.SerializedName; +import com.stripe.Stripe; +import com.stripe.exception.StripeException; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiResource; +import com.stripe.net.RequestOptions; +import com.stripe.param.capital.FinancingSummaryRetrieveParams; +import java.math.BigDecimal; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * A financing object describes an account's current financing state. Used by Connect platforms to + * read the state of Capital offered to their connected accounts. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class FinancingSummary extends ApiResource { + /** + * Additional information about the financing summary. Describes currency, advance amount, fee + * amount, withhold rate, remaining amount, paid amount, current repayment interval, repayment + * start date, and advance payout date. + */ + @SerializedName("details") + Details details; + + /** + * The object type: financing_summary + * + *

Equal to {@code capital.financing_summary}. + */ + @SerializedName("object") + String object; + + /** + * Status of the Connected Account's financing. /v1/capital/financing_summary + * will only return {@code details} for {@code paid_out} financing. + * + *

One of {@code accepted}, {@code delivered}, or {@code none}. + */ + @SerializedName("status") + String status; + + /** Retrieve the financing state for the account that was authenticated in the request. */ + public static FinancingSummary retrieve() throws StripeException { + return retrieve((Map) null, (RequestOptions) null); + } + + /** Retrieve the financing state for the account that was authenticated in the request. */ + public static FinancingSummary retrieve(RequestOptions options) throws StripeException { + return retrieve((Map) null, options); + } + + /** Retrieve the financing state for the account that was authenticated in the request. */ + public static FinancingSummary retrieve(Map params, RequestOptions options) + throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/capital/financing_summary"); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, FinancingSummary.class, options); + } + + /** Retrieve the financing state for the account that was authenticated in the request. */ + public static FinancingSummary retrieve( + FinancingSummaryRetrieveParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/capital/financing_summary"); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, FinancingSummary.class, options); + } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Details extends StripeObject { + /** Amount of financing offered, in minor units. */ + @SerializedName("advance_amount") + Long advanceAmount; + + /** + * The time at which the funds were paid out the the Connected account's Stripe balance. Given + * in milliseconds since unix epoch. + */ + @SerializedName("advance_paid_out_at") + BigDecimal advancePaidOutAt; + + /** Currency that the financing offer is transacted in. For example, {@code usd}. */ + @SerializedName("currency") + String currency; + + /** The chronologically current repayment interval for the financing offer. */ + @SerializedName("current_repayment_interval") + CurrentRepaymentInterval currentRepaymentInterval; + + /** Fixed fee amount, in minor units. */ + @SerializedName("fee_amount") + Long feeAmount; + + /** The amount the Connected account has paid toward the financing debt so far. */ + @SerializedName("paid_amount") + Long paidAmount; + + /** The balance remaining to be paid on the financing, in minor units. */ + @SerializedName("remaining_amount") + Long remainingAmount; + + /** + * The time at which Capital will begin withholding from payments. Given in seconds since unix + * epoch. + */ + @SerializedName("repayments_begin_at") + BigDecimal repaymentsBeginAt; + + /** Per-transaction rate at which Stripe will withhold funds to repay the financing. */ + @SerializedName("withhold_rate") + BigDecimal withholdRate; + + /** The current repayment interval for the Connected account. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CurrentRepaymentInterval extends StripeObject { + /** + * The time at which the minimum payment amount will be due. If not met through withholding, + * the Connected account's linked bank account will be debited. Given in seconds since unix + * epoch. + */ + @SerializedName("due_at") + BigDecimal dueAt; + + /** The amount that has already been paid in the current repayment interval. */ + @SerializedName("paid_amount") + Long paidAmount; + + /** The amount that is yet to be paid in the current repayment interval. */ + @SerializedName("remaining_amount") + Long remainingAmount; + } + } +} diff --git a/src/main/java/com/stripe/model/capital/FinancingTransaction.java b/src/main/java/com/stripe/model/capital/FinancingTransaction.java new file mode 100644 index 00000000000..8407dadb2a6 --- /dev/null +++ b/src/main/java/com/stripe/model/capital/FinancingTransaction.java @@ -0,0 +1,206 @@ +// File generated from our OpenAPI spec +package com.stripe.model.capital; + +import com.google.gson.annotations.SerializedName; +import com.stripe.Stripe; +import com.stripe.exception.StripeException; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiResource; +import com.stripe.net.RequestOptions; +import com.stripe.param.capital.FinancingTransactionListParams; +import com.stripe.param.capital.FinancingTransactionRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** This is an object representing the details of a transaction on a Capital financing object. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class FinancingTransaction extends ApiResource implements HasId { + /** The ID of the merchant associated with this financing transaction. */ + @SerializedName("account") + String account; + + /** Time at which the financing transaction was created. Given in seconds since unix epoch. */ + @SerializedName("created_at") + Long createdAt; + + /** This is an object representing a transaction on a Capital financing offer. */ + @SerializedName("details") + Details details; + + /** The Capital financing offer for this financing transaction. */ + @SerializedName("financing_offer") + String financingOffer; + + /** A unique identifier for the financing transaction object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * The Capital transaction object that predates the Financing Transactions API and corresponds + * with the balance transaction that was created as a result of this financing transaction. + */ + @SerializedName("legacy_balance_transaction_source") + String legacyBalanceTransactionSource; + + /** + * 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 object type: financing_transaction + * + *

Equal to {@code capital.financing_transaction}. + */ + @SerializedName("object") + String object; + + /** + * The type of the financing transaction. + * + *

One of {@code payment}, {@code payout}, or {@code reversal}. + */ + @SerializedName("type") + String type; + + /** A human-friendly description of the financing transaction. */ + @SerializedName("user_facing_description") + String userFacingDescription; + + /** + * Returns a list of financing transactions. The transactions are returned in sorted order, with + * the most recent transactions appearing first. + */ + public static FinancingTransactionCollection list(Map params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of financing transactions. The transactions are returned in sorted order, with + * the most recent transactions appearing first. + */ + public static FinancingTransactionCollection list( + Map params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/capital/financing_transactions"); + return ApiResource.requestCollection( + url, params, FinancingTransactionCollection.class, options); + } + + /** + * Returns a list of financing transactions. The transactions are returned in sorted order, with + * the most recent transactions appearing first. + */ + public static FinancingTransactionCollection list(FinancingTransactionListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of financing transactions. The transactions are returned in sorted order, with + * the most recent transactions appearing first. + */ + public static FinancingTransactionCollection list( + FinancingTransactionListParams params, RequestOptions options) throws StripeException { + String url = String.format("%s%s", Stripe.getApiBase(), "/v1/capital/financing_transactions"); + return ApiResource.requestCollection( + url, params, FinancingTransactionCollection.class, options); + } + + /** Retrieves a financing transaction for a financing offer. */ + public static FinancingTransaction retrieve(String financingTransaction) throws StripeException { + return retrieve(financingTransaction, (Map) null, (RequestOptions) null); + } + + /** Retrieves a financing transaction for a financing offer. */ + public static FinancingTransaction retrieve(String financingTransaction, RequestOptions options) + throws StripeException { + return retrieve(financingTransaction, (Map) null, options); + } + + /** Retrieves a financing transaction for a financing offer. */ + public static FinancingTransaction retrieve( + String financingTransaction, Map params, RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/capital/financing_transactions/%s", + ApiResource.urlEncodeId(financingTransaction))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, FinancingTransaction.class, options); + } + + /** Retrieves a financing transaction for a financing offer. */ + public static FinancingTransaction retrieve( + String financingTransaction, + FinancingTransactionRetrieveParams params, + RequestOptions options) + throws StripeException { + String url = + String.format( + "%s%s", + Stripe.getApiBase(), + String.format( + "/v1/capital/financing_transactions/%s", + ApiResource.urlEncodeId(financingTransaction))); + return ApiResource.request( + ApiResource.RequestMethod.GET, url, params, FinancingTransaction.class, options); + } + + /** This is an object representing a transaction on a Capital financing offer. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Details extends StripeObject { + /** The advance amount being repaid, paid out, or reversed in minor units. */ + @SerializedName("advance_amount") + Long advanceAmount; + + /** The currency of the financing transaction. */ + @SerializedName("currency") + String currency; + + /** The fee amount being repaid, paid out, or reversed in minor units. */ + @SerializedName("fee_amount") + Long feeAmount; + + /** + * The linked payment for the transaction. This field only applies to financing transactions of + * type {@code paydown} and reason {@code automatic_withholding}. + */ + @SerializedName("linked_payment") + String linkedPayment; + + /** + * The reason for the financing transaction (if applicable). + * + *

One of {@code automatic_withholding}, {@code automatic_withholding_refund}, {@code + * collection}, {@code collection_failure}, {@code financing_cancellation}, {@code refill}, + * {@code requested_by_user}, or {@code user_initiated}. + */ + @SerializedName("reason") + String reason; + + /** + * The reversed transaction. This field only applies to financing transactions of type {@code + * reversal}. + */ + @SerializedName("reversed_transaction") + String reversedTransaction; + + /** The advance and fee amount being repaid, paid out, or reversed in minor units. */ + @SerializedName("total_amount") + Long totalAmount; + } +} diff --git a/src/main/java/com/stripe/model/capital/FinancingTransactionCollection.java b/src/main/java/com/stripe/model/capital/FinancingTransactionCollection.java new file mode 100644 index 00000000000..0600924115c --- /dev/null +++ b/src/main/java/com/stripe/model/capital/FinancingTransactionCollection.java @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec +package com.stripe.model.capital; + +import com.stripe.model.StripeCollection; + +public class FinancingTransactionCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/issuing/Card.java b/src/main/java/com/stripe/model/issuing/Card.java index c3106bb5674..3c09a3ba65b 100644 --- a/src/main/java/com/stripe/model/issuing/Card.java +++ b/src/main/java/com/stripe/model/issuing/Card.java @@ -387,6 +387,14 @@ public static class Shipping extends StripeObject { @SerializedName("phone_number") String phoneNumber; + /** + * Whether a signature is required for card delivery. This feature is only supported for US + * users. Standard shipping service does not support signature on delivery. The default value + * for standard shipping service is false and for express and priority services is true. + */ + @SerializedName("require_signature") + Boolean requireSignature; + /** * Shipment service, such as {@code standard} or {@code express}. * diff --git a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java index e0a26ea0b18..d6a72c29415 100644 --- a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java +++ b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java @@ -256,6 +256,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + @SerializedName("pix") PIX("pix"), diff --git a/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java b/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java index 3a4d547e318..1aaccd22168 100644 --- a/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java @@ -149,6 +149,10 @@ public class InvoiceUpcomingLinesParams extends ApiRequestParams { @SerializedName("subscription_items") List subscriptionItems; + /** The pre-billing to apply to the subscription as a preview. */ + @SerializedName("subscription_prebilling") + SubscriptionPrebilling subscriptionPrebilling; + /** * Determines how to handle prorations when the @@ -211,6 +215,7 @@ private InvoiceUpcomingLinesParams( Boolean subscriptionCancelNow, Object subscriptionDefaultTaxRates, List subscriptionItems, + SubscriptionPrebilling subscriptionPrebilling, SubscriptionProrationBehavior subscriptionProrationBehavior, Long subscriptionProrationDate, Long subscriptionStartDate, @@ -236,6 +241,7 @@ private InvoiceUpcomingLinesParams( this.subscriptionCancelNow = subscriptionCancelNow; this.subscriptionDefaultTaxRates = subscriptionDefaultTaxRates; this.subscriptionItems = subscriptionItems; + this.subscriptionPrebilling = subscriptionPrebilling; this.subscriptionProrationBehavior = subscriptionProrationBehavior; this.subscriptionProrationDate = subscriptionProrationDate; this.subscriptionStartDate = subscriptionStartDate; @@ -288,6 +294,8 @@ public static class Builder { private List subscriptionItems; + private SubscriptionPrebilling subscriptionPrebilling; + private SubscriptionProrationBehavior subscriptionProrationBehavior; private Long subscriptionProrationDate; @@ -321,6 +329,7 @@ public InvoiceUpcomingLinesParams build() { this.subscriptionCancelNow, this.subscriptionDefaultTaxRates, this.subscriptionItems, + this.subscriptionPrebilling, this.subscriptionProrationBehavior, this.subscriptionProrationDate, this.subscriptionStartDate, @@ -683,6 +692,13 @@ public Builder addAllSubscriptionItem( return this; } + /** The pre-billing to apply to the subscription as a preview. */ + public Builder setSubscriptionPrebilling( + InvoiceUpcomingLinesParams.SubscriptionPrebilling subscriptionPrebilling) { + this.subscriptionPrebilling = subscriptionPrebilling; + return this; + } + /** * Determines how to handle prorations when the @@ -2667,6 +2683,10 @@ public static class SubscriptionItem { @SerializedName("deleted") Boolean deleted; + /** The coupons to redeem into discounts for the subscription item. */ + @SerializedName("discounts") + Object discounts; + /** * 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 @@ -2725,6 +2745,7 @@ private SubscriptionItem( Object billingThresholds, Boolean clearUsage, Boolean deleted, + Object discounts, Map extraParams, String id, Object metadata, @@ -2736,6 +2757,7 @@ private SubscriptionItem( this.billingThresholds = billingThresholds; this.clearUsage = clearUsage; this.deleted = deleted; + this.discounts = discounts; this.extraParams = extraParams; this.id = id; this.metadata = metadata; @@ -2757,6 +2779,8 @@ public static class Builder { private Boolean deleted; + private Object discounts; + private Map extraParams; private String id; @@ -2779,6 +2803,7 @@ public InvoiceUpcomingLinesParams.SubscriptionItem build() { this.billingThresholds, this.clearUsage, this.deleted, + this.discounts, this.extraParams, this.id, this.metadata, @@ -2825,6 +2850,49 @@ public Builder setDeleted(Boolean deleted) { return this; } + /** + * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams.SubscriptionItem#discounts} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addDiscount(InvoiceUpcomingLinesParams.SubscriptionItem.Discount element) { + if (this.discounts == null || this.discounts instanceof EmptyParam) { + this.discounts = new ArrayList(); + } + ((List) this.discounts).add(element); + return this; + } + + /** + * Add all elements to `discounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * InvoiceUpcomingLinesParams.SubscriptionItem#discounts} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllDiscount( + List elements) { + if (this.discounts == null || this.discounts instanceof EmptyParam) { + this.discounts = new ArrayList(); + } + ((List) this.discounts) + .addAll(elements); + return this; + } + + /** The coupons to redeem into discounts for the subscription item. */ + public Builder setDiscounts(EmptyParam discounts) { + this.discounts = discounts; + return this; + } + + /** The coupons to redeem into discounts for the subscription item. */ + public Builder setDiscounts( + List discounts) { + this.discounts = discounts; + 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 @@ -3065,6 +3133,90 @@ public Builder setUsageGte(Long usageGte) { } } + @Getter + public static class Discount { + /** ID of the coupon to create a new discount for. */ + @SerializedName("coupon") + String coupon; + + /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ + @SerializedName("discount") + String discount; + + /** + * 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 Discount(String coupon, String discount, Map extraParams) { + this.coupon = coupon; + this.discount = discount; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String coupon; + + private String discount; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.SubscriptionItem.Discount build() { + return new InvoiceUpcomingLinesParams.SubscriptionItem.Discount( + this.coupon, this.discount, this.extraParams); + } + + /** ID of the coupon to create a new discount for. */ + public Builder setCoupon(String coupon) { + this.coupon = coupon; + return this; + } + + /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ + public Builder setDiscount(String discount) { + this.discount = discount; + 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 InvoiceUpcomingLinesParams.SubscriptionItem.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 InvoiceUpcomingLinesParams.SubscriptionItem.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; + } + } + } + @Getter public static class PriceData { /** @@ -3392,6 +3544,76 @@ public enum TaxBehavior implements ApiRequestParams.EnumParam { } } + @Getter + public static class SubscriptionPrebilling { + /** + * 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; + + /** This is used to determine the number of billing cycles to prebill. */ + @SerializedName("iterations") + Long iterations; + + private SubscriptionPrebilling(Map extraParams, Long iterations) { + this.extraParams = extraParams; + this.iterations = iterations; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long iterations; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpcomingLinesParams.SubscriptionPrebilling build() { + return new InvoiceUpcomingLinesParams.SubscriptionPrebilling( + this.extraParams, this.iterations); + } + + /** + * 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 + * InvoiceUpcomingLinesParams.SubscriptionPrebilling#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 InvoiceUpcomingLinesParams.SubscriptionPrebilling#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** This is used to determine the number of billing cycles to prebill. */ + public Builder setIterations(Long iterations) { + this.iterations = iterations; + return this; + } + } + } + public enum SubscriptionBillingCycleAnchor implements ApiRequestParams.EnumParam { @SerializedName("now") NOW("now"), diff --git a/src/main/java/com/stripe/param/InvoiceUpcomingParams.java b/src/main/java/com/stripe/param/InvoiceUpcomingParams.java index 2b572535ffa..7930d1e0fc0 100644 --- a/src/main/java/com/stripe/param/InvoiceUpcomingParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpcomingParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; import java.util.ArrayList; @@ -67,7 +66,7 @@ public class InvoiceUpcomingParams extends ApiRequestParams { /** List of invoice items to add or update in the upcoming invoice preview. */ @SerializedName("invoice_items") - List invoiceItems; + List invoiceItems; /** * The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot @@ -123,7 +122,7 @@ public class InvoiceUpcomingParams extends ApiRequestParams { /** A list of up to 20 subscription items, each with an attached price. */ @SerializedName("subscription_items") - List subscriptionItems; + List subscriptionItems; /** The pre-billing to apply to the subscription as a preview. */ @SerializedName("subscription_prebilling") @@ -179,7 +178,7 @@ private InvoiceUpcomingParams( Object discounts, List expand, Map extraParams, - List invoiceItems, + List invoiceItems, String schedule, String subscription, Object subscriptionBillingCycleAnchor, @@ -187,7 +186,7 @@ private InvoiceUpcomingParams( Boolean subscriptionCancelAtPeriodEnd, Boolean subscriptionCancelNow, Object subscriptionDefaultTaxRates, - List subscriptionItems, + List subscriptionItems, SubscriptionPrebilling subscriptionPrebilling, SubscriptionProrationBehavior subscriptionProrationBehavior, Long subscriptionProrationDate, @@ -240,7 +239,7 @@ public static class Builder { private Map extraParams; - private List invoiceItems; + private List invoiceItems; private String schedule; @@ -256,7 +255,7 @@ public static class Builder { private Object subscriptionDefaultTaxRates; - private List subscriptionItems; + private List subscriptionItems; private SubscriptionPrebilling subscriptionPrebilling; @@ -299,7 +298,7 @@ public InvoiceUpcomingParams build() { } /** Settings for automatic tax lookup for this invoice preview. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(InvoiceUpcomingParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -332,7 +331,7 @@ public Builder setCustomer(String customer) { } /** Details about the customer you want to invoice or overrides for an existing customer. */ - public Builder setCustomerDetails(CustomerDetails customerDetails) { + public Builder setCustomerDetails(InvoiceUpcomingParams.CustomerDetails customerDetails) { this.customerDetails = customerDetails; return this; } @@ -343,7 +342,7 @@ public Builder setCustomerDetails(CustomerDetails customerDetails) { * InvoiceUpcomingParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(InvoiceUpcomingParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -357,7 +356,7 @@ public Builder addDiscount(Discount element) { * InvoiceUpcomingParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -384,7 +383,7 @@ public Builder setDiscounts(EmptyParam discounts) { * instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming * invoice for a subscription that hasn't been created, use {@code coupon} instead. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -446,7 +445,7 @@ public Builder putAllExtraParam(Map map) { * and subsequent calls adds additional elements to the original list. See {@link * InvoiceUpcomingParams#invoiceItems} for the field documentation. */ - public Builder addInvoiceItem(InvoiceItem element) { + public Builder addInvoiceItem(InvoiceUpcomingParams.InvoiceItem element) { if (this.invoiceItems == null) { this.invoiceItems = new ArrayList<>(); } @@ -459,7 +458,7 @@ public Builder addInvoiceItem(InvoiceItem element) { * call, and subsequent calls adds additional elements to the original list. See {@link * InvoiceUpcomingParams#invoiceItems} for the field documentation. */ - public Builder addAllInvoiceItem(List elements) { + public Builder addAllInvoiceItem(List elements) { if (this.invoiceItems == null) { this.invoiceItems = new ArrayList<>(); } @@ -496,7 +495,7 @@ public Builder setSubscription(String subscription) { * the value can only be set to {@code now} or {@code unchanged}. */ public Builder setSubscriptionBillingCycleAnchor( - SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor) { + InvoiceUpcomingParams.SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor) { this.subscriptionBillingCycleAnchor = subscriptionBillingCycleAnchor; return this; } @@ -600,7 +599,7 @@ public Builder setSubscriptionDefaultTaxRates(List subscriptionDefaultTa * call, and subsequent calls adds additional elements to the original list. See {@link * InvoiceUpcomingParams#subscriptionItems} for the field documentation. */ - public Builder addSubscriptionItem(SubscriptionItem element) { + public Builder addSubscriptionItem(InvoiceUpcomingParams.SubscriptionItem element) { if (this.subscriptionItems == null) { this.subscriptionItems = new ArrayList<>(); } @@ -613,7 +612,7 @@ public Builder addSubscriptionItem(SubscriptionItem element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link InvoiceUpcomingParams#subscriptionItems} for the field documentation. */ - public Builder addAllSubscriptionItem(List elements) { + public Builder addAllSubscriptionItem(List elements) { if (this.subscriptionItems == null) { this.subscriptionItems = new ArrayList<>(); } @@ -622,7 +621,8 @@ public Builder addAllSubscriptionItem(List elements) { } /** The pre-billing to apply to the subscription as a preview. */ - public Builder setSubscriptionPrebilling(SubscriptionPrebilling subscriptionPrebilling) { + public Builder setSubscriptionPrebilling( + InvoiceUpcomingParams.SubscriptionPrebilling subscriptionPrebilling) { this.subscriptionPrebilling = subscriptionPrebilling; return this; } @@ -634,7 +634,7 @@ public Builder setSubscriptionPrebilling(SubscriptionPrebilling subscriptionPreb * billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes. */ public Builder setSubscriptionProrationBehavior( - SubscriptionProrationBehavior subscriptionProrationBehavior) { + InvoiceUpcomingParams.SubscriptionProrationBehavior subscriptionProrationBehavior) { this.subscriptionProrationBehavior = subscriptionProrationBehavior; return this; } @@ -662,7 +662,8 @@ public Builder setSubscriptionStartDate(Long subscriptionStartDate) { * If provided, the invoice returned will preview updating or creating a subscription with that * trial end. If set, one of {@code subscription_items} or {@code subscription} is required. */ - public Builder setSubscriptionTrialEnd(SubscriptionTrialEnd subscriptionTrialEnd) { + public Builder setSubscriptionTrialEnd( + InvoiceUpcomingParams.SubscriptionTrialEnd subscriptionTrialEnd) { this.subscriptionTrialEnd = subscriptionTrialEnd; return this; } @@ -724,8 +725,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public InvoiceUpcomingParams.AutomaticTax build() { + return new InvoiceUpcomingParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -792,19 +793,19 @@ public static class CustomerDetails { /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */ @SerializedName("tax_exempt") - EnumParam taxExempt; + ApiRequestParams.EnumParam taxExempt; /** The customer's tax IDs. */ @SerializedName("tax_ids") - List taxIds; + List taxIds; private CustomerDetails( Object address, Map extraParams, Object shipping, Tax tax, - EnumParam taxExempt, - List taxIds) { + ApiRequestParams.EnumParam taxExempt, + List taxIds) { this.address = address; this.extraParams = extraParams; this.shipping = shipping; @@ -826,18 +827,18 @@ public static class Builder { private Tax tax; - private EnumParam taxExempt; + private ApiRequestParams.EnumParam taxExempt; - private List taxIds; + private List taxIds; /** Finalize and obtain parameter instance from this builder. */ - public CustomerDetails build() { - return new CustomerDetails( + public InvoiceUpcomingParams.CustomerDetails build() { + return new InvoiceUpcomingParams.CustomerDetails( this.address, this.extraParams, this.shipping, this.tax, this.taxExempt, this.taxIds); } /** The customer's address. */ - public Builder setAddress(Address address) { + public Builder setAddress(InvoiceUpcomingParams.CustomerDetails.Address address) { this.address = address; return this; } @@ -875,7 +876,7 @@ public Builder putAllExtraParam(Map map) { } /** The customer's shipping information. Appears on invoices emailed to this customer. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(InvoiceUpcomingParams.CustomerDetails.Shipping shipping) { this.shipping = shipping; return this; } @@ -887,13 +888,13 @@ public Builder setShipping(EmptyParam shipping) { } /** Tax details about the customer. */ - public Builder setTax(Tax tax) { + public Builder setTax(InvoiceUpcomingParams.CustomerDetails.Tax tax) { this.tax = tax; return this; } /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */ - public Builder setTaxExempt(TaxExempt taxExempt) { + public Builder setTaxExempt(InvoiceUpcomingParams.CustomerDetails.TaxExempt taxExempt) { this.taxExempt = taxExempt; return this; } @@ -909,7 +910,7 @@ public Builder setTaxExempt(EmptyParam taxExempt) { * subsequent calls adds additional elements to the original list. See {@link * InvoiceUpcomingParams.CustomerDetails#taxIds} for the field documentation. */ - public Builder addTaxId(TaxId element) { + public Builder addTaxId(InvoiceUpcomingParams.CustomerDetails.TaxId element) { if (this.taxIds == null) { this.taxIds = new ArrayList<>(); } @@ -922,7 +923,7 @@ public Builder addTaxId(TaxId element) { * and subsequent calls adds additional elements to the original list. See {@link * InvoiceUpcomingParams.CustomerDetails#taxIds} for the field documentation. */ - public Builder addAllTaxId(List elements) { + public Builder addAllTaxId(List elements) { if (this.taxIds == null) { this.taxIds = new ArrayList<>(); } @@ -1006,8 +1007,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public InvoiceUpcomingParams.CustomerDetails.Address build() { + return new InvoiceUpcomingParams.CustomerDetails.Address( this.city, this.country, this.extraParams, @@ -1131,12 +1132,13 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping(this.address, this.extraParams, this.name, this.phone); + public InvoiceUpcomingParams.CustomerDetails.Shipping build() { + return new InvoiceUpcomingParams.CustomerDetails.Shipping( + this.address, this.extraParams, this.name, this.phone); } /** Customer shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(InvoiceUpcomingParams.CustomerDetails.Shipping.Address address) { this.address = address; return this; } @@ -1258,8 +1260,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public InvoiceUpcomingParams.CustomerDetails.Shipping.Address build() { + return new InvoiceUpcomingParams.CustomerDetails.Shipping.Address( this.city, this.country, this.extraParams, @@ -1374,8 +1376,8 @@ public static class Builder { private Object ipAddress; /** Finalize and obtain parameter instance from this builder. */ - public Tax build() { - return new Tax(this.extraParams, this.ipAddress); + public InvoiceUpcomingParams.CustomerDetails.Tax build() { + return new InvoiceUpcomingParams.CustomerDetails.Tax(this.extraParams, this.ipAddress); } /** @@ -1477,8 +1479,9 @@ public static class Builder { private String value; /** Finalize and obtain parameter instance from this builder. */ - public TaxId build() { - return new TaxId(this.extraParams, this.type, this.value); + public InvoiceUpcomingParams.CustomerDetails.TaxId build() { + return new InvoiceUpcomingParams.CustomerDetails.TaxId( + this.extraParams, this.type, this.value); } /** @@ -1521,7 +1524,7 @@ public Builder putAllExtraParam(Map map) { * si_tin}, {@code th_vat}, {@code tw_vat}, {@code ua_vat}, {@code us_ein}, or {@code * za_vat}. */ - public Builder setType(Type type) { + public Builder setType(InvoiceUpcomingParams.CustomerDetails.TaxId.Type type) { this.type = type; return this; } @@ -1737,8 +1740,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public InvoiceUpcomingParams.Discount build() { + return new InvoiceUpcomingParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1952,8 +1955,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceItem build() { - return new InvoiceItem( + public InvoiceUpcomingParams.InvoiceItem build() { + return new InvoiceUpcomingParams.InvoiceItem( this.amount, this.currency, this.description, @@ -2011,7 +2014,7 @@ public Builder setDiscountable(Boolean discountable) { * InvoiceUpcomingParams.InvoiceItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(InvoiceUpcomingParams.InvoiceItem.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2025,7 +2028,7 @@ public Builder addDiscount(Discount element) { * InvoiceUpcomingParams.InvoiceItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2040,7 +2043,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The coupons to redeem into discounts for the invoice item in the preview. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -2134,7 +2137,7 @@ public Builder setMetadata(Map metadata) { * The period associated with this invoice item. When set to different values, the period will * be rendered on the invoice. */ - public Builder setPeriod(Period period) { + public Builder setPeriod(InvoiceUpcomingParams.InvoiceItem.Period period) { this.period = period; return this; } @@ -2149,7 +2152,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(InvoiceUpcomingParams.InvoiceItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -2265,8 +2268,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public InvoiceUpcomingParams.InvoiceItem.Discount build() { + return new InvoiceUpcomingParams.InvoiceItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2348,8 +2352,9 @@ public static class Builder { private Long start; /** Finalize and obtain parameter instance from this builder. */ - public Period build() { - return new Period(this.end, this.extraParams, this.start); + public InvoiceUpcomingParams.InvoiceItem.Period build() { + return new InvoiceUpcomingParams.InvoiceItem.Period( + this.end, this.extraParams, this.start); } /** The end of the period, which must be greater than or equal to the start. */ @@ -2473,8 +2478,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public InvoiceUpcomingParams.InvoiceItem.PriceData build() { + return new InvoiceUpcomingParams.InvoiceItem.PriceData( this.currency, this.extraParams, this.product, @@ -2532,7 +2537,8 @@ public Builder setProduct(String product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + InvoiceUpcomingParams.InvoiceItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2712,8 +2718,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionItem build() { - return new SubscriptionItem( + public InvoiceUpcomingParams.SubscriptionItem build() { + return new InvoiceUpcomingParams.SubscriptionItem( this.billingThresholds, this.clearUsage, this.deleted, @@ -2733,7 +2739,8 @@ public SubscriptionItem build() { * billing period. When updating, pass an empty string to remove previously-defined * thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + InvoiceUpcomingParams.SubscriptionItem.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -2769,7 +2776,7 @@ public Builder setDeleted(Boolean deleted) { * InvoiceUpcomingParams.SubscriptionItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(InvoiceUpcomingParams.SubscriptionItem.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2783,7 +2790,8 @@ public Builder addDiscount(Discount element) { * InvoiceUpcomingParams.SubscriptionItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount( + List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2798,7 +2806,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The coupons to redeem into discounts for the subscription item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -2904,7 +2912,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(InvoiceUpcomingParams.SubscriptionItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -2998,8 +3006,9 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public InvoiceUpcomingParams.SubscriptionItem.BillingThresholds build() { + return new InvoiceUpcomingParams.SubscriptionItem.BillingThresholds( + this.extraParams, this.usageGte); } /** @@ -3075,8 +3084,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public InvoiceUpcomingParams.SubscriptionItem.Discount build() { + return new InvoiceUpcomingParams.SubscriptionItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -3210,8 +3220,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public InvoiceUpcomingParams.SubscriptionItem.PriceData build() { + return new InvoiceUpcomingParams.SubscriptionItem.PriceData( this.currency, this.extraParams, this.product, @@ -3268,7 +3278,8 @@ public Builder setProduct(String product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring( + InvoiceUpcomingParams.SubscriptionItem.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -3278,7 +3289,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + InvoiceUpcomingParams.SubscriptionItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -3348,8 +3360,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public InvoiceUpcomingParams.SubscriptionItem.PriceData.Recurring build() { + return new InvoiceUpcomingParams.SubscriptionItem.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -3384,7 +3397,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + InvoiceUpcomingParams.SubscriptionItem.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -3472,8 +3486,8 @@ public static class Builder { private Long iterations; /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionPrebilling build() { - return new SubscriptionPrebilling(this.extraParams, this.iterations); + public InvoiceUpcomingParams.SubscriptionPrebilling build() { + return new InvoiceUpcomingParams.SubscriptionPrebilling(this.extraParams, this.iterations); } /** diff --git a/src/main/java/com/stripe/param/OrderCreateParams.java b/src/main/java/com/stripe/param/OrderCreateParams.java index ed863d97368..2587c0579b5 100644 --- a/src/main/java/com/stripe/param/OrderCreateParams.java +++ b/src/main/java/com/stripe/param/OrderCreateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; import java.util.ArrayList; @@ -70,7 +69,7 @@ public class OrderCreateParams extends ApiRequestParams { * product, the quantity, and the resulting cost. */ @SerializedName("line_items") - List lineItems; + List lineItems; /** * Set of key-value pairs that you can attach @@ -108,7 +107,7 @@ private OrderCreateParams( List expand, Map extraParams, String ipAddress, - List lineItems, + List lineItems, Map metadata, Payment payment, Object shippingCost, @@ -157,7 +156,7 @@ public static class Builder { private String ipAddress; - private List lineItems; + private List lineItems; private Map metadata; @@ -191,7 +190,7 @@ public OrderCreateParams build() { } /** Settings for automatic tax calculation for this order. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(OrderCreateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -200,7 +199,7 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * Billing details for the customer. If a customer is provided, this will be automatically * populated with values from that customer if override values are not provided. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails(OrderCreateParams.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -220,7 +219,7 @@ public Builder setBillingDetails(EmptyParam billingDetails) { * OrderCreateParams#credits} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addCredit(Credit element) { + public Builder addCredit(OrderCreateParams.Credit element) { if (this.credits == null || this.credits instanceof EmptyParam) { this.credits = new ArrayList(); } @@ -234,7 +233,7 @@ public Builder addCredit(Credit element) { * OrderCreateParams#credits} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllCredit(List elements) { + public Builder addAllCredit(List elements) { if (this.credits == null || this.credits instanceof EmptyParam) { this.credits = new ArrayList(); } @@ -249,7 +248,7 @@ public Builder setCredits(EmptyParam credits) { } /** The credits to apply to the order, only {@code gift_card} currently supported. */ - public Builder setCredits(List credits) { + public Builder setCredits(List credits) { this.credits = credits; return this; } @@ -282,7 +281,7 @@ public Builder setDescription(String description) { * OrderCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(OrderCreateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -296,7 +295,7 @@ public Builder addDiscount(Discount element) { * OrderCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -311,7 +310,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The coupons, promotion codes, and/or discounts to apply to the order. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -379,7 +378,7 @@ public Builder setIpAddress(String ipAddress) { * and subsequent calls adds additional elements to the original list. See {@link * OrderCreateParams#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(OrderCreateParams.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -392,7 +391,7 @@ public Builder addLineItem(LineItem element) { * and subsequent calls adds additional elements to the original list. See {@link * OrderCreateParams#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -427,13 +426,13 @@ public Builder putAllMetadata(Map map) { } /** Payment information associated with the order, including payment settings. */ - public Builder setPayment(Payment payment) { + public Builder setPayment(OrderCreateParams.Payment payment) { this.payment = payment; return this; } /** Settings for the customer cost of shipping for this order. */ - public Builder setShippingCost(ShippingCost shippingCost) { + public Builder setShippingCost(OrderCreateParams.ShippingCost shippingCost) { this.shippingCost = shippingCost; return this; } @@ -445,7 +444,7 @@ public Builder setShippingCost(EmptyParam shippingCost) { } /** Shipping details for the order. */ - public Builder setShippingDetails(ShippingDetails shippingDetails) { + public Builder setShippingDetails(OrderCreateParams.ShippingDetails shippingDetails) { this.shippingDetails = shippingDetails; return this; } @@ -457,7 +456,7 @@ public Builder setShippingDetails(EmptyParam shippingDetails) { } /** Additional tax details about the purchaser to be used for this order. */ - public Builder setTaxDetails(TaxDetails taxDetails) { + public Builder setTaxDetails(OrderCreateParams.TaxDetails taxDetails) { this.taxDetails = taxDetails; return this; } @@ -495,8 +494,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public OrderCreateParams.AutomaticTax build() { + return new OrderCreateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -587,13 +586,13 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public OrderCreateParams.BillingDetails build() { + return new OrderCreateParams.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** The billing address provided by the customer. */ - public Builder setAddress(Address address) { + public Builder setAddress(OrderCreateParams.BillingDetails.Address address) { this.address = address; return this; } @@ -721,8 +720,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public OrderCreateParams.BillingDetails.Address build() { + return new OrderCreateParams.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -842,8 +841,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Credit build() { - return new Credit(this.extraParams, this.giftCard, this.type); + public OrderCreateParams.Credit build() { + return new OrderCreateParams.Credit(this.extraParams, this.giftCard, this.type); } /** @@ -879,7 +878,7 @@ public Builder setGiftCard(String giftCard) { } /** The type of credit to apply to the order, only {@code gift_card} currently supported. */ - public Builder setType(Type type) { + public Builder setType(OrderCreateParams.Credit.Type type) { this.type = type; return this; } @@ -943,8 +942,9 @@ public static class Builder { private String promotionCode; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams, this.promotionCode); + public OrderCreateParams.Discount build() { + return new OrderCreateParams.Discount( + this.coupon, this.discount, this.extraParams, this.promotionCode); } /** ID of the coupon to create a new discount for. */ @@ -1116,8 +1116,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem( + public OrderCreateParams.LineItem build() { + return new OrderCreateParams.LineItem( this.description, this.discounts, this.extraParams, @@ -1141,7 +1141,7 @@ public Builder setDescription(String description) { * OrderCreateParams.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(OrderCreateParams.LineItem.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1155,7 +1155,7 @@ public Builder addDiscount(Discount element) { * OrderCreateParams.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1170,7 +1170,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The discounts applied to this line item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -1227,7 +1227,7 @@ public Builder setPrice(String price) { *

Each time you pass {@code price_data} we create a Price for the product. This Price is * hidden in both the Dashboard and API lists and cannot be reused. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(OrderCreateParams.LineItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1255,7 +1255,7 @@ public Builder setProduct(String product) { * created the Product. If a Product with the same ID already exists, then {@code * product_data} re-uses it to avoid duplicates. */ - public Builder setProductData(ProductData productData) { + public Builder setProductData(OrderCreateParams.LineItem.ProductData productData) { this.productData = productData; return this; } @@ -1344,8 +1344,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public OrderCreateParams.LineItem.Discount build() { + return new OrderCreateParams.LineItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1474,8 +1475,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public OrderCreateParams.LineItem.PriceData build() { + return new OrderCreateParams.LineItem.PriceData( this.currency, this.extraParams, this.product, @@ -1538,7 +1539,8 @@ public Builder setProduct(String product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + OrderCreateParams.LineItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -1698,8 +1700,8 @@ public static class Builder { private Object url; /** Finalize and obtain parameter instance from this builder. */ - public ProductData build() { - return new ProductData( + public OrderCreateParams.LineItem.ProductData build() { + return new OrderCreateParams.LineItem.ProductData( this.description, this.extraParams, this.id, @@ -1869,7 +1871,8 @@ public Builder setName(String name) { } /** The dimensions of this product for shipping purposes. */ - public Builder setPackageDimensions(PackageDimensions packageDimensions) { + public Builder setPackageDimensions( + OrderCreateParams.LineItem.ProductData.PackageDimensions packageDimensions) { this.packageDimensions = packageDimensions; return this; } @@ -1962,8 +1965,8 @@ public static class Builder { private BigDecimal width; /** Finalize and obtain parameter instance from this builder. */ - public PackageDimensions build() { - return new PackageDimensions( + public OrderCreateParams.LineItem.ProductData.PackageDimensions build() { + return new OrderCreateParams.LineItem.ProductData.PackageDimensions( this.extraParams, this.height, this.length, this.weight, this.width); } @@ -2053,8 +2056,8 @@ public static class Builder { private Settings settings; /** Finalize and obtain parameter instance from this builder. */ - public Payment build() { - return new Payment(this.extraParams, this.settings); + public OrderCreateParams.Payment build() { + return new OrderCreateParams.Payment(this.extraParams, this.settings); } /** @@ -2084,7 +2087,7 @@ public Builder putAllExtraParam(Map map) { } /** Settings describing how the order should configure generated PaymentIntents. */ - public Builder setSettings(Settings settings) { + public Builder setSettings(OrderCreateParams.Payment.Settings settings) { this.settings = settings; return this; } @@ -2119,7 +2122,7 @@ public static class Settings { * href="https://dashboard.stripe.com/settings/payment_methods">Stripe Dashboard. */ @SerializedName("payment_method_types") - List paymentMethodTypes; + List paymentMethodTypes; /** The URL to redirect the customer to after they authenticate their payment. */ @SerializedName("return_url") @@ -2149,7 +2152,7 @@ private Settings( Long applicationFeeAmount, Map extraParams, PaymentMethodOptions paymentMethodOptions, - List paymentMethodTypes, + List paymentMethodTypes, String returnUrl, String statementDescriptor, String statementDescriptorSuffix, @@ -2175,7 +2178,7 @@ public static class Builder { private PaymentMethodOptions paymentMethodOptions; - private List paymentMethodTypes; + private List paymentMethodTypes; private String returnUrl; @@ -2186,8 +2189,8 @@ public static class Builder { private TransferData transferData; /** Finalize and obtain parameter instance from this builder. */ - public Settings build() { - return new Settings( + public OrderCreateParams.Payment.Settings build() { + return new OrderCreateParams.Payment.Settings( this.applicationFeeAmount, this.extraParams, this.paymentMethodOptions, @@ -2236,7 +2239,8 @@ public Builder putAllExtraParam(Map map) { } /** PaymentMethod-specific configuration to provide to the order's PaymentIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + OrderCreateParams.Payment.Settings.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -2247,7 +2251,8 @@ public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions * See {@link OrderCreateParams.Payment.Settings#paymentMethodTypes} for the field * documentation. */ - public Builder addPaymentMethodType(PaymentMethodType element) { + public Builder addPaymentMethodType( + OrderCreateParams.Payment.Settings.PaymentMethodType element) { if (this.paymentMethodTypes == null) { this.paymentMethodTypes = new ArrayList<>(); } @@ -2261,7 +2266,8 @@ public Builder addPaymentMethodType(PaymentMethodType element) { * See {@link OrderCreateParams.Payment.Settings#paymentMethodTypes} for the field * documentation. */ - public Builder addAllPaymentMethodType(List elements) { + public Builder addAllPaymentMethodType( + List elements) { if (this.paymentMethodTypes == null) { this.paymentMethodTypes = new ArrayList<>(); } @@ -2296,7 +2302,8 @@ public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) { } /** Provides configuration for completing a transfer for the order after it is paid. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + OrderCreateParams.Payment.Settings.TransferData transferData) { this.transferData = transferData; return this; } @@ -2391,6 +2398,13 @@ public static class PaymentMethodOptions { @SerializedName("p24") P24 p24; + /** + * If paying by {@code paypal}, this sub-hash contains details about the PayPal payment + * method options to pass to the order's PaymentIntent. + */ + @SerializedName("paypal") + Paypal paypal; + /** * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Debit * payment method options to pass to the order's PaymentIntent. @@ -2425,6 +2439,7 @@ private PaymentMethodOptions( Link link, Oxxo oxxo, P24 p24, + Paypal paypal, SepaDebit sepaDebit, Sofort sofort, WechatPay wechatPay) { @@ -2440,6 +2455,7 @@ private PaymentMethodOptions( this.link = link; this.oxxo = oxxo; this.p24 = p24; + this.paypal = paypal; this.sepaDebit = sepaDebit; this.sofort = sofort; this.wechatPay = wechatPay; @@ -2474,6 +2490,8 @@ public static class Builder { private P24 p24; + private Paypal paypal; + private SepaDebit sepaDebit; private Sofort sofort; @@ -2481,8 +2499,8 @@ public static class Builder { private WechatPay wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public OrderCreateParams.Payment.Settings.PaymentMethodOptions build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions( this.acssDebit, this.afterpayClearpay, this.alipay, @@ -2495,6 +2513,7 @@ public PaymentMethodOptions build() { this.link, this.oxxo, this.p24, + this.paypal, this.sepaDebit, this.sofort, this.wechatPay); @@ -2504,7 +2523,8 @@ public PaymentMethodOptions build() { * If paying by {@code acss_debit}, this sub-hash contains details about the ACSS Debit * payment method options to pass to the order's PaymentIntent. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -2513,7 +2533,9 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If paying by {@code afterpay_clearpay}, this sub-hash contains details about the * AfterpayClearpay payment method options to pass to the order's PaymentIntent. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.AfterpayClearpay + afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -2522,7 +2544,8 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If paying by {@code alipay}, this sub-hash contains details about the Alipay payment * method options to pass to the order's PaymentIntent. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Alipay alipay) { this.alipay = alipay; return this; } @@ -2531,7 +2554,8 @@ public Builder setAlipay(Alipay alipay) { * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact * payment method options to pass to the order's PaymentIntent. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -2540,7 +2564,8 @@ public Builder setBancontact(Bancontact bancontact) { * If paying by {@code card}, this sub-hash contains details about the Card payment method * options to pass to the order's PaymentIntent. */ - public Builder setCard(Card card) { + public Builder setCard( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -2549,7 +2574,9 @@ public Builder setCard(Card card) { * If paying by {@code customer_balance}, this sub-hash contains details about the * Customer Balance payment method options to pass to the order's PaymentIntent. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + customerBalance) { this.customerBalance = customerBalance; return this; } @@ -2586,7 +2613,8 @@ public Builder putAllExtraParam(Map map) { * If paying by {@code ideal}, this sub-hash contains details about the iDEAL payment * method options to pass to the order's PaymentIntent. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Ideal ideal) { this.ideal = ideal; return this; } @@ -2595,7 +2623,8 @@ public Builder setIdeal(Ideal ideal) { * If paying by {@code klarna}, this sub-hash contains details about the Klarna payment * method options to pass to the order's PaymentIntent. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Klarna klarna) { this.klarna = klarna; return this; } @@ -2604,7 +2633,8 @@ public Builder setKlarna(Klarna klarna) { * If paying by {@code link}, this sub-hash contains details about the Link payment method * options to pass to the order's PaymentIntent. */ - public Builder setLink(Link link) { + public Builder setLink( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Link link) { this.link = link; return this; } @@ -2613,7 +2643,8 @@ public Builder setLink(Link link) { * If paying by {@code oxxo}, this sub-hash contains details about the OXXO payment method * options to pass to the order's PaymentIntent. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -2622,16 +2653,27 @@ public Builder setOxxo(Oxxo oxxo) { * If paying by {@code p24}, this sub-hash contains details about the P24 payment method * options to pass to the order's PaymentIntent. */ - public Builder setP24(P24 p24) { + public Builder setP24(OrderCreateParams.Payment.Settings.PaymentMethodOptions.P24 p24) { this.p24 = p24; return this; } + /** + * If paying by {@code paypal}, this sub-hash contains details about the PayPal payment + * method options to pass to the order's PaymentIntent. + */ + public Builder setPaypal( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Paypal paypal) { + this.paypal = paypal; + return this; + } + /** * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Debit * payment method options to pass to the order's PaymentIntent. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -2640,7 +2682,8 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If paying by {@code sofort}, this sub-hash contains details about the Sofort payment * method options to pass to the order's PaymentIntent. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Sofort sofort) { this.sofort = sofort; return this; } @@ -2649,7 +2692,8 @@ public Builder setSofort(Sofort sofort) { * If paying by {@code wechat_pay}, this sub-hash contains details about the WeChat Pay * payment method options to pass to the order's PaymentIntent. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -2693,7 +2737,7 @@ public static class AcssDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -2702,7 +2746,7 @@ public static class AcssDebit { private AcssDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; @@ -2719,13 +2763,13 @@ public static class Builder { private MandateOptions mandateOptions; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.AcssDebit build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.AcssDebit( this.extraParams, this.mandateOptions, this.setupFutureUsage, @@ -2763,7 +2807,9 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -2789,7 +2835,9 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -2821,7 +2869,9 @@ public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -2892,8 +2942,11 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.AcssDebit + .MandateOptions + build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.AcssDebit + .MandateOptions( this.customMandateUrl, this.extraParams, this.intervalDescription, @@ -2965,13 +3018,19 @@ public Builder setIntervalDescription(String intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.MandateOptions + .PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.MandateOptions + .TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -3129,8 +3188,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay( + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.AfterpayClearpay + build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.AfterpayClearpay( this.captureMethod, this.extraParams, this.reference, this.setupFutureUsage); } @@ -3143,7 +3203,10 @@ public AfterpayClearpay build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.AfterpayClearpay + .CaptureMethod + captureMethod) { this.captureMethod = captureMethod; return this; } @@ -3209,7 +3272,10 @@ public Builder setReference(String reference) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.AfterpayClearpay + .SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -3277,9 +3343,10 @@ public static class Alipay { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private Alipay(Map extraParams, EnumParam setupFutureUsage) { + private Alipay( + Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -3291,11 +3358,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams, this.setupFutureUsage); + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.Alipay build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.Alipay( + this.extraParams, this.setupFutureUsage); } /** @@ -3349,7 +3417,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Alipay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -3438,12 +3508,12 @@ public static class Bancontact { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Bancontact( Map extraParams, PreferredLanguage preferredLanguage, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.preferredLanguage = preferredLanguage; this.setupFutureUsage = setupFutureUsage; @@ -3458,11 +3528,11 @@ public static class Builder { private PreferredLanguage preferredLanguage; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact( + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.Bancontact build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.Bancontact( this.extraParams, this.preferredLanguage, this.setupFutureUsage); } @@ -3500,7 +3570,9 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Bancontact authorization page that the customer is * redirected to. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Bancontact.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -3526,7 +3598,9 @@ public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Bancontact.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -3655,12 +3729,15 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card(this.captureMethod, this.extraParams, this.setupFutureUsage); + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.Card build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.Card( + this.captureMethod, this.extraParams, this.setupFutureUsage); } /** Controls when the funds will be captured from the customer's account. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Card.CaptureMethod + captureMethod) { this.captureMethod = captureMethod; return this; } @@ -3715,7 +3792,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Card.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -3830,8 +3909,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance( + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance( this.bankTransfer, this.extraParams, this.fundingType, this.setupFutureUsage); } @@ -3839,7 +3918,9 @@ public CustomerBalance build() { * Configuration for the bank transfer funding type, if the {@code funding_type} is set * to {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance.BankTransfer + bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -3878,7 +3959,9 @@ public Builder putAllExtraParam(Map map) { * The funding method type to be used when there are not enough funds in the customer * balance. Permitted values include: {@code bank_transfer}. */ - public Builder setFundingType(FundingType fundingType) { + public Builder setFundingType( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance.FundingType + fundingType) { this.fundingType = fundingType; return this; } @@ -3904,7 +3987,10 @@ public Builder setFundingType(FundingType fundingType) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -3933,7 +4019,10 @@ public static class BankTransfer { * {@code spei}. */ @SerializedName("requested_address_types") - List requestedAddressTypes; + List< + OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.RequestedAddressType> + requestedAddressTypes; /** * The list of bank transfer types that this PaymentIntent is allowed to use for funding @@ -3946,7 +4035,10 @@ public static class BankTransfer { private BankTransfer( EuBankTransfer euBankTransfer, Map extraParams, - List requestedAddressTypes, + List< + OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.RequestedAddressType> + requestedAddressTypes, Type type) { this.euBankTransfer = euBankTransfer; this.extraParams = extraParams; @@ -3963,17 +4055,26 @@ public static class Builder { private Map extraParams; - private List requestedAddressTypes; + private List< + OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.RequestedAddressType> + requestedAddressTypes; private Type type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer( + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer + build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer( this.euBankTransfer, this.extraParams, this.requestedAddressTypes, this.type); } - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -4015,7 +4116,10 @@ public Builder putAllExtraParam(Map map) { * OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addRequestedAddressType(RequestedAddressType element) { + public Builder addRequestedAddressType( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.RequestedAddressType + element) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -4030,7 +4134,11 @@ public Builder addRequestedAddressType(RequestedAddressType element) { * OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addAllRequestedAddressType(List elements) { + public Builder addAllRequestedAddressType( + List< + OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.RequestedAddressType> + elements) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -4043,7 +4151,10 @@ public Builder addAllRequestedAddressType(List elements) { * funding Permitted values include: {@code eu_bank_transfer}, {@code * gb_bank_transfer}, {@code jp_bank_transfer}, or {@code mx_bank_transfer}. */ - public Builder setType(Type type) { + public Builder setType( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.Type + type) { this.type = type; return this; } @@ -4083,8 +4194,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer(this.country, this.extraParams); } /** @@ -4233,9 +4347,10 @@ public static class Ideal { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private Ideal(Map extraParams, EnumParam setupFutureUsage) { + private Ideal( + Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -4247,11 +4362,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.extraParams, this.setupFutureUsage); + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.Ideal build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.Ideal( + this.extraParams, this.setupFutureUsage); } /** @@ -4305,7 +4421,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Ideal.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4365,7 +4483,7 @@ public static class Klarna { * value for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -4408,7 +4526,7 @@ public static class Klarna { SetupFutureUsage setupFutureUsage; private Klarna( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, PreferredLocale preferredLocale, SetupFutureUsage setupFutureUsage) { @@ -4423,7 +4541,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -4432,8 +4550,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna( + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.Klarna build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.Klarna( this.captureMethod, this.extraParams, this.preferredLocale, @@ -4449,7 +4567,9 @@ public Klarna build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Klarna.CaptureMethod + captureMethod) { this.captureMethod = captureMethod; return this; } @@ -4502,7 +4622,9 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Klarna authorization page that the customer is redirected * to. */ - public Builder setPreferredLocale(PreferredLocale preferredLocale) { + public Builder setPreferredLocale( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Klarna.PreferredLocale + preferredLocale) { this.preferredLocale = preferredLocale; return this; } @@ -4528,7 +4650,9 @@ public Builder setPreferredLocale(PreferredLocale preferredLocale) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Klarna.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4553,6 +4677,9 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("de-AT") DE_AT("de-AT"), + @SerializedName("de-CH") + DE_CH("de-CH"), + @SerializedName("de-DE") DE_DE("de-DE"), @@ -4568,6 +4695,9 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("en-CA") EN_CA("en-CA"), + @SerializedName("en-CH") + EN_CH("en-CH"), + @SerializedName("en-DE") EN_DE("en-DE"), @@ -4601,6 +4731,12 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("en-NZ") EN_NZ("en-NZ"), + @SerializedName("en-PL") + EN_PL("en-PL"), + + @SerializedName("en-PT") + EN_PT("en-PT"), + @SerializedName("en-SE") EN_SE("en-SE"), @@ -4622,9 +4758,15 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("fr-CA") FR_CA("fr-CA"), + @SerializedName("fr-CH") + FR_CH("fr-CH"), + @SerializedName("fr-FR") FR_FR("fr-FR"), + @SerializedName("it-CH") + IT_CH("it-CH"), + @SerializedName("it-IT") IT_IT("it-IT"), @@ -4637,6 +4779,12 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("nl-NL") NL_NL("nl-NL"), + @SerializedName("pl-PL") + PL_PL("pl-PL"), + + @SerializedName("pt-PT") + PT_PT("pt-PT"), + @SerializedName("sv-FI") SV_FI("sv-FI"), @@ -4676,7 +4824,7 @@ public static class Link { * value for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -4714,13 +4862,13 @@ public static class Link { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Link( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, String persistentToken, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.captureMethod = captureMethod; this.extraParams = extraParams; this.persistentToken = persistentToken; @@ -4732,17 +4880,17 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; private String persistentToken; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link( + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.Link build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.Link( this.captureMethod, this.extraParams, this.persistentToken, @@ -4758,7 +4906,9 @@ public Link build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Link.CaptureMethod + captureMethod) { this.captureMethod = captureMethod; return this; } @@ -4834,7 +4984,9 @@ public Builder setPersistentToken(String persistentToken) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Link.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4959,8 +5111,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.expiresAfterDays, this.extraParams, this.setupFutureUsage); + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.Oxxo build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.Oxxo( + this.expiresAfterDays, this.extraParams, this.setupFutureUsage); } /** @@ -5024,7 +5177,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Oxxo.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5104,8 +5259,9 @@ public static class Builder { private Boolean tosShownAndAccepted; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.P24 build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.P24( + this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); } /** @@ -5159,7 +5315,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.P24.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5184,6 +5342,185 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + public static class Paypal { + @SerializedName("capture_method") + ApiRequestParams.EnumParam captureMethod; + + /** + * 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; + + @SerializedName("preferred_locale") + PreferredLocale preferredLocale; + + private Paypal( + ApiRequestParams.EnumParam captureMethod, + Map extraParams, + PreferredLocale preferredLocale) { + this.captureMethod = captureMethod; + this.extraParams = extraParams; + this.preferredLocale = preferredLocale; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ApiRequestParams.EnumParam captureMethod; + + private Map extraParams; + + private PreferredLocale preferredLocale; + + /** Finalize and obtain parameter instance from this builder. */ + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.Paypal build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.Paypal( + this.captureMethod, this.extraParams, this.preferredLocale); + } + + public Builder setCaptureMethod( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Paypal.CaptureMethod + captureMethod) { + this.captureMethod = captureMethod; + return this; + } + + public Builder setCaptureMethod(EmptyParam captureMethod) { + this.captureMethod = captureMethod; + 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 + * OrderCreateParams.Payment.Settings.PaymentMethodOptions.Paypal#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 + * OrderCreateParams.Payment.Settings.PaymentMethodOptions.Paypal#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 Builder setPreferredLocale( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Paypal.PreferredLocale + preferredLocale) { + this.preferredLocale = preferredLocale; + return this; + } + } + + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + + public enum PreferredLocale implements ApiRequestParams.EnumParam { + @SerializedName("cs_CZ") + CS_CZ("cs_CZ"), + + @SerializedName("da_DK") + DA_DK("da_DK"), + + @SerializedName("de_AT") + DE_AT("de_AT"), + + @SerializedName("de_DE") + DE_DE("de_DE"), + + @SerializedName("de_LU") + DE_LU("de_LU"), + + @SerializedName("el_GR") + EL_GR("el_GR"), + + @SerializedName("en_GB") + EN_GB("en_GB"), + + @SerializedName("en_US") + EN_US("en_US"), + + @SerializedName("es_ES") + ES_ES("es_ES"), + + @SerializedName("fi_FI") + FI_FI("fi_FI"), + + @SerializedName("fr_BE") + FR_BE("fr_BE"), + + @SerializedName("fr_FR") + FR_FR("fr_FR"), + + @SerializedName("fr_LU") + FR_LU("fr_LU"), + + @SerializedName("hu_HU") + HU_HU("hu_HU"), + + @SerializedName("it_IT") + IT_IT("it_IT"), + + @SerializedName("nl_BE") + NL_BE("nl_BE"), + + @SerializedName("nl_NL") + NL_NL("nl_NL"), + + @SerializedName("pl_PL") + PL_PL("pl_PL"), + + @SerializedName("pt_PT") + PT_PT("pt_PT"), + + @SerializedName("sk_SK") + SK_SK("sk_SK"), + + @SerializedName("sv_SE") + SV_SE("sv_SE"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLocale(String value) { + this.value = value; + } + } + } + @Getter public static class SepaDebit { /** @@ -5222,12 +5559,12 @@ public static class SepaDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private SepaDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; this.setupFutureUsage = setupFutureUsage; @@ -5242,11 +5579,12 @@ public static class Builder { private MandateOptions mandateOptions; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.mandateOptions, this.setupFutureUsage); + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.SepaDebit build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.SepaDebit( + this.extraParams, this.mandateOptions, this.setupFutureUsage); } /** @@ -5280,7 +5618,9 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.SepaDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5306,7 +5646,9 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.SepaDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5362,8 +5704,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams); + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.SepaDebit + .MandateOptions + build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.SepaDebit + .MandateOptions(this.extraParams); } /** @@ -5431,7 +5776,7 @@ public static class Sofort { /** Language shown to the payer on redirect. */ @SerializedName("preferred_language") - EnumParam preferredLanguage; + ApiRequestParams.EnumParam preferredLanguage; /** * Indicates that you intend to make future payments with this PaymentIntent's payment @@ -5455,12 +5800,12 @@ public static class Sofort { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Sofort( Map extraParams, - EnumParam preferredLanguage, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam preferredLanguage, + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.preferredLanguage = preferredLanguage; this.setupFutureUsage = setupFutureUsage; @@ -5473,13 +5818,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam preferredLanguage; + private ApiRequestParams.EnumParam preferredLanguage; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.extraParams, this.preferredLanguage, this.setupFutureUsage); + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.Sofort build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.Sofort( + this.extraParams, this.preferredLanguage, this.setupFutureUsage); } /** @@ -5513,7 +5859,9 @@ public Builder putAllExtraParam(Map map) { } /** Language shown to the payer on redirect. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Sofort.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -5545,7 +5893,9 @@ public Builder setPreferredLanguage(EmptyParam preferredLanguage) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.Sofort.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5692,8 +6042,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay( + public OrderCreateParams.Payment.Settings.PaymentMethodOptions.WechatPay build() { + return new OrderCreateParams.Payment.Settings.PaymentMethodOptions.WechatPay( this.appId, this.client, this.extraParams, this.setupFutureUsage); } @@ -5706,7 +6056,8 @@ public Builder setAppId(String appId) { } /** The client type that the end customer will pay from. */ - public Builder setClient(Client client) { + public Builder setClient( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.WechatPay.Client client) { this.client = client; return this; } @@ -5762,7 +6113,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderCreateParams.Payment.Settings.PaymentMethodOptions.WechatPay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5842,8 +6195,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.destination, this.extraParams); + public OrderCreateParams.Payment.Settings.TransferData build() { + return new OrderCreateParams.Payment.Settings.TransferData( + this.amount, this.destination, this.extraParams); } /** @@ -5944,6 +6298,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("p24") P24("p24"), + @SerializedName("paypal") + PAYPAL("paypal"), + @SerializedName("sepa_debit") SEPA_DEBIT("sepa_debit"), @@ -6001,8 +6358,9 @@ public static class Builder { private ShippingRateData shippingRateData; /** Finalize and obtain parameter instance from this builder. */ - public ShippingCost build() { - return new ShippingCost(this.extraParams, this.shippingRate, this.shippingRateData); + public OrderCreateParams.ShippingCost build() { + return new OrderCreateParams.ShippingCost( + this.extraParams, this.shippingRate, this.shippingRateData); } /** @@ -6038,7 +6396,8 @@ public Builder setShippingRate(String shippingRate) { } /** Parameters to create a new ad-hoc shipping rate for this order. */ - public Builder setShippingRateData(ShippingRateData shippingRateData) { + public Builder setShippingRateData( + OrderCreateParams.ShippingCost.ShippingRateData shippingRateData) { this.shippingRateData = shippingRateData; return this; } @@ -6147,8 +6506,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public ShippingRateData build() { - return new ShippingRateData( + public OrderCreateParams.ShippingCost.ShippingRateData build() { + return new OrderCreateParams.ShippingCost.ShippingRateData( this.deliveryEstimate, this.displayName, this.extraParams, @@ -6163,7 +6522,8 @@ public ShippingRateData build() { * The estimated range for how long shipping will take, meant to be displayable to the * customer. This will appear on CheckoutSessions. */ - public Builder setDeliveryEstimate(DeliveryEstimate deliveryEstimate) { + public Builder setDeliveryEstimate( + OrderCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate deliveryEstimate) { this.deliveryEstimate = deliveryEstimate; return this; } @@ -6209,7 +6569,8 @@ public Builder putAllExtraParam(Map map) { * Describes a fixed amount to charge for shipping. Must be present if type is {@code * fixed_amount}. */ - public Builder setFixedAmount(FixedAmount fixedAmount) { + public Builder setFixedAmount( + OrderCreateParams.ShippingCost.ShippingRateData.FixedAmount fixedAmount) { this.fixedAmount = fixedAmount; return this; } @@ -6245,7 +6606,8 @@ public Builder putAllMetadata(Map map) { * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of * {@code inclusive}, {@code exclusive}, or {@code unspecified}. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + OrderCreateParams.ShippingCost.ShippingRateData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -6263,7 +6625,7 @@ public Builder setTaxCode(String taxCode) { * The type of calculation to use on the shipping rate. Can only be {@code fixed_amount} for * now. */ - public Builder setType(Type type) { + public Builder setType(OrderCreateParams.ShippingCost.ShippingRateData.Type type) { this.type = type; return this; } @@ -6311,8 +6673,9 @@ public static class Builder { private Minimum minimum; /** Finalize and obtain parameter instance from this builder. */ - public DeliveryEstimate build() { - return new DeliveryEstimate(this.extraParams, this.maximum, this.minimum); + public OrderCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate build() { + return new OrderCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate( + this.extraParams, this.maximum, this.minimum); } /** @@ -6349,13 +6712,15 @@ public Builder putAllExtraParam(Map map) { * The upper bound of the estimated range. If empty, represents no upper bound i.e., * infinite. */ - public Builder setMaximum(Maximum maximum) { + public Builder setMaximum( + OrderCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum maximum) { this.maximum = maximum; return this; } /** The lower bound of the estimated range. If empty, represents no lower bound. */ - public Builder setMinimum(Minimum minimum) { + public Builder setMinimum( + OrderCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum minimum) { this.minimum = minimum; return this; } @@ -6399,8 +6764,10 @@ public static class Builder { private Long value; /** Finalize and obtain parameter instance from this builder. */ - public Maximum build() { - return new Maximum(this.extraParams, this.unit, this.value); + public OrderCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum + build() { + return new OrderCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum( + this.extraParams, this.unit, this.value); } /** @@ -6434,7 +6801,9 @@ public Builder putAllExtraParam(Map map) { } /** A unit of time. */ - public Builder setUnit(Unit unit) { + public Builder setUnit( + OrderCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum.Unit + unit) { this.unit = unit; return this; } @@ -6509,8 +6878,10 @@ public static class Builder { private Long value; /** Finalize and obtain parameter instance from this builder. */ - public Minimum build() { - return new Minimum(this.extraParams, this.unit, this.value); + public OrderCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum + build() { + return new OrderCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum( + this.extraParams, this.unit, this.value); } /** @@ -6544,7 +6915,9 @@ public Builder putAllExtraParam(Map map) { } /** A unit of time. */ - public Builder setUnit(Unit unit) { + public Builder setUnit( + OrderCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum.Unit + unit) { this.unit = unit; return this; } @@ -6602,7 +6975,8 @@ public static class FixedAmount { * href="https://stripe.com/docs/currencies">supported currency. */ @SerializedName("currency_options") - Map currencyOptions; + Map + currencyOptions; /** * Map of extra parameters for custom features not available in this client library. The @@ -6617,7 +6991,8 @@ public static class FixedAmount { private FixedAmount( Long amount, String currency, - Map currencyOptions, + Map + currencyOptions, Map extraParams) { this.amount = amount; this.currency = currency; @@ -6634,13 +7009,16 @@ public static class Builder { private String currency; - private Map currencyOptions; + private Map< + String, + OrderCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption> + currencyOptions; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public FixedAmount build() { - return new FixedAmount( + public OrderCreateParams.ShippingCost.ShippingRateData.FixedAmount build() { + return new OrderCreateParams.ShippingCost.ShippingRateData.FixedAmount( this.amount, this.currency, this.currencyOptions, this.extraParams); } @@ -6667,7 +7045,9 @@ public Builder setCurrency(String currency) { * OrderCreateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the * field documentation. */ - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption( + String key, + OrderCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption value) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -6682,7 +7062,11 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * OrderCreateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the * field documentation. */ - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption( + Map< + String, + OrderCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption> + map) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -6763,8 +7147,10 @@ public static class Builder { private TaxBehavior taxBehavior; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption(this.amount, this.extraParams, this.taxBehavior); + public OrderCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption + build() { + return new OrderCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption( + this.amount, this.extraParams, this.taxBehavior); } /** A non-negative integer in cents representing how much to charge. */ @@ -6807,7 +7193,10 @@ public Builder putAllExtraParam(Map map) { * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. * One of {@code inclusive}, {@code exclusive}, or {@code unspecified}. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + OrderCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption + .TaxBehavior + taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -6910,12 +7299,13 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public ShippingDetails build() { - return new ShippingDetails(this.address, this.extraParams, this.name, this.phone); + public OrderCreateParams.ShippingDetails build() { + return new OrderCreateParams.ShippingDetails( + this.address, this.extraParams, this.name, this.phone); } /** The shipping address for the order. */ - public Builder setAddress(Address address) { + public Builder setAddress(OrderCreateParams.ShippingDetails.Address address) { this.address = address; return this; } @@ -7037,8 +7427,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public OrderCreateParams.ShippingDetails.Address build() { + return new OrderCreateParams.ShippingDetails.Address( this.city, this.country, this.extraParams, @@ -7137,13 +7527,16 @@ public static class TaxDetails { * reverse}. */ @SerializedName("tax_exempt") - EnumParam taxExempt; + ApiRequestParams.EnumParam taxExempt; /** The purchaser's tax IDs to be used for this order. */ @SerializedName("tax_ids") - List taxIds; + List taxIds; - private TaxDetails(Map extraParams, EnumParam taxExempt, List taxIds) { + private TaxDetails( + Map extraParams, + ApiRequestParams.EnumParam taxExempt, + List taxIds) { this.extraParams = extraParams; this.taxExempt = taxExempt; this.taxIds = taxIds; @@ -7156,13 +7549,13 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam taxExempt; + private ApiRequestParams.EnumParam taxExempt; - private List taxIds; + private List taxIds; /** Finalize and obtain parameter instance from this builder. */ - public TaxDetails build() { - return new TaxDetails(this.extraParams, this.taxExempt, this.taxIds); + public OrderCreateParams.TaxDetails build() { + return new OrderCreateParams.TaxDetails(this.extraParams, this.taxExempt, this.taxIds); } /** @@ -7195,7 +7588,7 @@ public Builder putAllExtraParam(Map map) { * The purchaser's tax exemption status. One of {@code none}, {@code exempt}, or {@code * reverse}. */ - public Builder setTaxExempt(TaxExempt taxExempt) { + public Builder setTaxExempt(OrderCreateParams.TaxDetails.TaxExempt taxExempt) { this.taxExempt = taxExempt; return this; } @@ -7214,7 +7607,7 @@ public Builder setTaxExempt(EmptyParam taxExempt) { * subsequent calls adds additional elements to the original list. See {@link * OrderCreateParams.TaxDetails#taxIds} for the field documentation. */ - public Builder addTaxId(TaxId element) { + public Builder addTaxId(OrderCreateParams.TaxDetails.TaxId element) { if (this.taxIds == null) { this.taxIds = new ArrayList<>(); } @@ -7227,7 +7620,7 @@ public Builder addTaxId(TaxId element) { * and subsequent calls adds additional elements to the original list. See {@link * OrderCreateParams.TaxDetails#taxIds} for the field documentation. */ - public Builder addAllTaxId(List elements) { + public Builder addAllTaxId(List elements) { if (this.taxIds == null) { this.taxIds = new ArrayList<>(); } @@ -7283,8 +7676,8 @@ public static class Builder { private String value; /** Finalize and obtain parameter instance from this builder. */ - public TaxId build() { - return new TaxId(this.extraParams, this.type, this.value); + public OrderCreateParams.TaxDetails.TaxId build() { + return new OrderCreateParams.TaxDetails.TaxId(this.extraParams, this.type, this.value); } /** @@ -7327,7 +7720,7 @@ public Builder putAllExtraParam(Map map) { * si_tin}, {@code th_vat}, {@code tw_vat}, {@code ua_vat}, {@code us_ein}, or {@code * za_vat}. */ - public Builder setType(Type type) { + public Builder setType(OrderCreateParams.TaxDetails.TaxId.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/OrderUpdateParams.java b/src/main/java/com/stripe/param/OrderUpdateParams.java index a2e4e14954b..396a006823e 100644 --- a/src/main/java/com/stripe/param/OrderUpdateParams.java +++ b/src/main/java/com/stripe/param/OrderUpdateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; import java.util.ArrayList; @@ -76,7 +75,7 @@ public class OrderUpdateParams extends ApiRequestParams { * product, the quantity, and the resulting cost. */ @SerializedName("line_items") - List lineItems; + List lineItems; /** * Set of key-value pairs that you can attach @@ -114,7 +113,7 @@ private OrderUpdateParams( List expand, Map extraParams, Object ipAddress, - List lineItems, + List lineItems, Object metadata, Payment payment, Object shippingCost, @@ -163,7 +162,7 @@ public static class Builder { private Object ipAddress; - private List lineItems; + private List lineItems; private Object metadata; @@ -197,7 +196,7 @@ public OrderUpdateParams build() { } /** Settings for automatic tax calculation for this order. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(OrderUpdateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -206,7 +205,7 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * Billing details for the customer. If a customer is provided, this will be automatically * populated with values from that customer if override values are not provided. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails(OrderUpdateParams.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -226,7 +225,7 @@ public Builder setBillingDetails(EmptyParam billingDetails) { * OrderUpdateParams#credits} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addCredit(Credit element) { + public Builder addCredit(OrderUpdateParams.Credit element) { if (this.credits == null || this.credits instanceof EmptyParam) { this.credits = new ArrayList(); } @@ -240,7 +239,7 @@ public Builder addCredit(Credit element) { * OrderUpdateParams#credits} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllCredit(List elements) { + public Builder addAllCredit(List elements) { if (this.credits == null || this.credits instanceof EmptyParam) { this.credits = new ArrayList(); } @@ -261,7 +260,7 @@ public Builder setCredits(EmptyParam credits) { * The credits to apply to the order, only {@code gift_card} currently supported. Pass the empty * string {@code ""} to unset this field. */ - public Builder setCredits(List credits) { + public Builder setCredits(List credits) { this.credits = credits; return this; } @@ -316,7 +315,7 @@ public Builder setDescription(EmptyParam description) { * OrderUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(OrderUpdateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -330,7 +329,7 @@ public Builder addDiscount(Discount element) { * OrderUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -351,7 +350,7 @@ public Builder setDiscounts(EmptyParam discounts) { * The coupons, promotion codes, and/or discounts to apply to the order. Pass the empty string * {@code ""} to unset this field. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -425,7 +424,7 @@ public Builder setIpAddress(EmptyParam ipAddress) { * and subsequent calls adds additional elements to the original list. See {@link * OrderUpdateParams#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(OrderUpdateParams.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -438,7 +437,7 @@ public Builder addLineItem(LineItem element) { * and subsequent calls adds additional elements to the original list. See {@link * OrderUpdateParams#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -497,13 +496,13 @@ public Builder setMetadata(Map metadata) { } /** Payment information associated with the order, including payment settings. */ - public Builder setPayment(Payment payment) { + public Builder setPayment(OrderUpdateParams.Payment payment) { this.payment = payment; return this; } /** Settings for the customer cost of shipping for this order. */ - public Builder setShippingCost(ShippingCost shippingCost) { + public Builder setShippingCost(OrderUpdateParams.ShippingCost shippingCost) { this.shippingCost = shippingCost; return this; } @@ -515,7 +514,7 @@ public Builder setShippingCost(EmptyParam shippingCost) { } /** Shipping details for the order. */ - public Builder setShippingDetails(ShippingDetails shippingDetails) { + public Builder setShippingDetails(OrderUpdateParams.ShippingDetails shippingDetails) { this.shippingDetails = shippingDetails; return this; } @@ -527,7 +526,7 @@ public Builder setShippingDetails(EmptyParam shippingDetails) { } /** Additional tax details about the purchaser to be used for this order. */ - public Builder setTaxDetails(TaxDetails taxDetails) { + public Builder setTaxDetails(OrderUpdateParams.TaxDetails taxDetails) { this.taxDetails = taxDetails; return this; } @@ -565,8 +564,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public OrderUpdateParams.AutomaticTax build() { + return new OrderUpdateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -657,13 +656,13 @@ public static class Builder { private Object phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public OrderUpdateParams.BillingDetails build() { + return new OrderUpdateParams.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** The billing address provided by the customer. */ - public Builder setAddress(Address address) { + public Builder setAddress(OrderUpdateParams.BillingDetails.Address address) { this.address = address; return this; } @@ -809,8 +808,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public OrderUpdateParams.BillingDetails.Address build() { + return new OrderUpdateParams.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -972,8 +971,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Credit build() { - return new Credit(this.extraParams, this.giftCard, this.type); + public OrderUpdateParams.Credit build() { + return new OrderUpdateParams.Credit(this.extraParams, this.giftCard, this.type); } /** @@ -1015,7 +1014,7 @@ public Builder setGiftCard(EmptyParam giftCard) { } /** The type of credit to apply to the order, only {@code gift_card} currently supported. */ - public Builder setType(Type type) { + public Builder setType(OrderUpdateParams.Credit.Type type) { this.type = type; return this; } @@ -1079,8 +1078,9 @@ public static class Builder { private Object promotionCode; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams, this.promotionCode); + public OrderUpdateParams.Discount build() { + return new OrderUpdateParams.Discount( + this.coupon, this.discount, this.extraParams, this.promotionCode); } /** ID of the coupon to create a new discount for. */ @@ -1278,8 +1278,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem( + public OrderUpdateParams.LineItem build() { + return new OrderUpdateParams.LineItem( this.description, this.discounts, this.extraParams, @@ -1310,7 +1310,7 @@ public Builder setDescription(EmptyParam description) { * OrderUpdateParams.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(OrderUpdateParams.LineItem.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1324,7 +1324,7 @@ public Builder addDiscount(Discount element) { * OrderUpdateParams.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1339,7 +1339,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The discounts applied to this line item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -1422,7 +1422,7 @@ public Builder setPrice(EmptyParam price) { *

Each time you pass {@code price_data} we create a Price for the product. This Price is * hidden in both the Dashboard and API lists and cannot be reused. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(OrderUpdateParams.LineItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1461,7 +1461,7 @@ public Builder setProduct(EmptyParam product) { * created the Product. If a Product with the same ID already exists, then {@code * product_data} re-uses it to avoid duplicates. */ - public Builder setProductData(ProductData productData) { + public Builder setProductData(OrderUpdateParams.LineItem.ProductData productData) { this.productData = productData; return this; } @@ -1550,8 +1550,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public OrderUpdateParams.LineItem.Discount build() { + return new OrderUpdateParams.LineItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1692,8 +1693,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public OrderUpdateParams.LineItem.PriceData build() { + return new OrderUpdateParams.LineItem.PriceData( this.currency, this.extraParams, this.product, @@ -1777,7 +1778,8 @@ public Builder setProduct(EmptyParam product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + OrderUpdateParams.LineItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -1947,8 +1949,8 @@ public static class Builder { private Object url; /** Finalize and obtain parameter instance from this builder. */ - public ProductData build() { - return new ProductData( + public OrderUpdateParams.LineItem.ProductData build() { + return new OrderUpdateParams.LineItem.ProductData( this.description, this.extraParams, this.id, @@ -2149,7 +2151,8 @@ public Builder setName(EmptyParam name) { } /** The dimensions of this product for shipping purposes. */ - public Builder setPackageDimensions(PackageDimensions packageDimensions) { + public Builder setPackageDimensions( + OrderUpdateParams.LineItem.ProductData.PackageDimensions packageDimensions) { this.packageDimensions = packageDimensions; return this; } @@ -2248,8 +2251,8 @@ public static class Builder { private BigDecimal width; /** Finalize and obtain parameter instance from this builder. */ - public PackageDimensions build() { - return new PackageDimensions( + public OrderUpdateParams.LineItem.ProductData.PackageDimensions build() { + return new OrderUpdateParams.LineItem.ProductData.PackageDimensions( this.extraParams, this.height, this.length, this.weight, this.width); } @@ -2339,8 +2342,8 @@ public static class Builder { private Settings settings; /** Finalize and obtain parameter instance from this builder. */ - public Payment build() { - return new Payment(this.extraParams, this.settings); + public OrderUpdateParams.Payment build() { + return new OrderUpdateParams.Payment(this.extraParams, this.settings); } /** @@ -2370,7 +2373,7 @@ public Builder putAllExtraParam(Map map) { } /** Settings describing how the order should configure generated PaymentIntents. */ - public Builder setSettings(Settings settings) { + public Builder setSettings(OrderUpdateParams.Payment.Settings settings) { this.settings = settings; return this; } @@ -2405,7 +2408,7 @@ public static class Settings { * href="https://dashboard.stripe.com/settings/payment_methods">Stripe Dashboard. */ @SerializedName("payment_method_types") - List paymentMethodTypes; + List paymentMethodTypes; /** The URL to redirect the customer to after they authenticate their payment. */ @SerializedName("return_url") @@ -2435,7 +2438,7 @@ private Settings( Object applicationFeeAmount, Map extraParams, PaymentMethodOptions paymentMethodOptions, - List paymentMethodTypes, + List paymentMethodTypes, Object returnUrl, Object statementDescriptor, Object statementDescriptorSuffix, @@ -2461,7 +2464,7 @@ public static class Builder { private PaymentMethodOptions paymentMethodOptions; - private List paymentMethodTypes; + private List paymentMethodTypes; private Object returnUrl; @@ -2472,8 +2475,8 @@ public static class Builder { private Object transferData; /** Finalize and obtain parameter instance from this builder. */ - public Settings build() { - return new Settings( + public OrderUpdateParams.Payment.Settings build() { + return new OrderUpdateParams.Payment.Settings( this.applicationFeeAmount, this.extraParams, this.paymentMethodOptions, @@ -2531,7 +2534,8 @@ public Builder putAllExtraParam(Map map) { } /** PaymentMethod-specific configuration to provide to the order's PaymentIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -2542,7 +2546,8 @@ public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions * See {@link OrderUpdateParams.Payment.Settings#paymentMethodTypes} for the field * documentation. */ - public Builder addPaymentMethodType(PaymentMethodType element) { + public Builder addPaymentMethodType( + OrderUpdateParams.Payment.Settings.PaymentMethodType element) { if (this.paymentMethodTypes == null) { this.paymentMethodTypes = new ArrayList<>(); } @@ -2556,7 +2561,8 @@ public Builder addPaymentMethodType(PaymentMethodType element) { * See {@link OrderUpdateParams.Payment.Settings#paymentMethodTypes} for the field * documentation. */ - public Builder addAllPaymentMethodType(List elements) { + public Builder addAllPaymentMethodType( + List elements) { if (this.paymentMethodTypes == null) { this.paymentMethodTypes = new ArrayList<>(); } @@ -2617,7 +2623,8 @@ public Builder setStatementDescriptorSuffix(EmptyParam statementDescriptorSuffix } /** Provides configuration for completing a transfer for the order after it is paid. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + OrderUpdateParams.Payment.Settings.TransferData transferData) { this.transferData = transferData; return this; } @@ -2718,6 +2725,13 @@ public static class PaymentMethodOptions { @SerializedName("p24") Object p24; + /** + * If paying by {@code paypal}, this sub-hash contains details about the PayPal payment + * method options to pass to the order's PaymentIntent. + */ + @SerializedName("paypal") + Object paypal; + /** * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Debit * payment method options to pass to the order's PaymentIntent. @@ -2752,6 +2766,7 @@ private PaymentMethodOptions( Object link, Object oxxo, Object p24, + Object paypal, Object sepaDebit, Object sofort, Object wechatPay) { @@ -2767,6 +2782,7 @@ private PaymentMethodOptions( this.link = link; this.oxxo = oxxo; this.p24 = p24; + this.paypal = paypal; this.sepaDebit = sepaDebit; this.sofort = sofort; this.wechatPay = wechatPay; @@ -2801,6 +2817,8 @@ public static class Builder { private Object p24; + private Object paypal; + private Object sepaDebit; private Object sofort; @@ -2808,8 +2826,8 @@ public static class Builder { private Object wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions( this.acssDebit, this.afterpayClearpay, this.alipay, @@ -2822,6 +2840,7 @@ public PaymentMethodOptions build() { this.link, this.oxxo, this.p24, + this.paypal, this.sepaDebit, this.sofort, this.wechatPay); @@ -2831,7 +2850,8 @@ public PaymentMethodOptions build() { * If paying by {@code acss_debit}, this sub-hash contains details about the ACSS Debit * payment method options to pass to the order's PaymentIntent. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -2849,7 +2869,9 @@ public Builder setAcssDebit(EmptyParam acssDebit) { * If paying by {@code afterpay_clearpay}, this sub-hash contains details about the * AfterpayClearpay payment method options to pass to the order's PaymentIntent. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AfterpayClearpay + afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -2867,7 +2889,8 @@ public Builder setAfterpayClearpay(EmptyParam afterpayClearpay) { * If paying by {@code alipay}, this sub-hash contains details about the Alipay payment * method options to pass to the order's PaymentIntent. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Alipay alipay) { this.alipay = alipay; return this; } @@ -2885,7 +2908,8 @@ public Builder setAlipay(EmptyParam alipay) { * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact * payment method options to pass to the order's PaymentIntent. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -2903,7 +2927,8 @@ public Builder setBancontact(EmptyParam bancontact) { * If paying by {@code card}, this sub-hash contains details about the Card payment method * options to pass to the order's PaymentIntent. */ - public Builder setCard(Card card) { + public Builder setCard( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -2921,7 +2946,9 @@ public Builder setCard(EmptyParam card) { * If paying by {@code customer_balance}, this sub-hash contains details about the * Customer Balance payment method options to pass to the order's PaymentIntent. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + customerBalance) { this.customerBalance = customerBalance; return this; } @@ -2967,7 +2994,8 @@ public Builder putAllExtraParam(Map map) { * If paying by {@code ideal}, this sub-hash contains details about the iDEAL payment * method options to pass to the order's PaymentIntent. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Ideal ideal) { this.ideal = ideal; return this; } @@ -2985,7 +3013,8 @@ public Builder setIdeal(EmptyParam ideal) { * If paying by {@code klarna}, this sub-hash contains details about the Klarna payment * method options to pass to the order's PaymentIntent. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Klarna klarna) { this.klarna = klarna; return this; } @@ -3003,7 +3032,8 @@ public Builder setKlarna(EmptyParam klarna) { * If paying by {@code link}, this sub-hash contains details about the Link payment method * options to pass to the order's PaymentIntent. */ - public Builder setLink(Link link) { + public Builder setLink( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Link link) { this.link = link; return this; } @@ -3021,7 +3051,8 @@ public Builder setLink(EmptyParam link) { * If paying by {@code oxxo}, this sub-hash contains details about the OXXO payment method * options to pass to the order's PaymentIntent. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -3039,7 +3070,7 @@ public Builder setOxxo(EmptyParam oxxo) { * If paying by {@code p24}, this sub-hash contains details about the P24 payment method * options to pass to the order's PaymentIntent. */ - public Builder setP24(P24 p24) { + public Builder setP24(OrderUpdateParams.Payment.Settings.PaymentMethodOptions.P24 p24) { this.p24 = p24; return this; } @@ -3053,11 +3084,31 @@ public Builder setP24(EmptyParam p24) { return this; } + /** + * If paying by {@code paypal}, this sub-hash contains details about the PayPal payment + * method options to pass to the order's PaymentIntent. + */ + public Builder setPaypal( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Paypal paypal) { + this.paypal = paypal; + return this; + } + + /** + * If paying by {@code paypal}, this sub-hash contains details about the PayPal payment + * method options to pass to the order's PaymentIntent. + */ + public Builder setPaypal(EmptyParam paypal) { + this.paypal = paypal; + return this; + } + /** * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Debit * payment method options to pass to the order's PaymentIntent. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -3075,7 +3126,8 @@ public Builder setSepaDebit(EmptyParam sepaDebit) { * If paying by {@code sofort}, this sub-hash contains details about the Sofort payment * method options to pass to the order's PaymentIntent. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Sofort sofort) { this.sofort = sofort; return this; } @@ -3093,7 +3145,8 @@ public Builder setSofort(EmptyParam sofort) { * If paying by {@code wechat_pay}, this sub-hash contains details about the WeChat Pay * payment method options to pass to the order's PaymentIntent. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -3146,7 +3199,7 @@ public static class AcssDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -3155,7 +3208,7 @@ public static class AcssDebit { private AcssDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; @@ -3172,13 +3225,13 @@ public static class Builder { private MandateOptions mandateOptions; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AcssDebit build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AcssDebit( this.extraParams, this.mandateOptions, this.setupFutureUsage, @@ -3216,7 +3269,9 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -3242,7 +3297,9 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -3274,7 +3331,9 @@ public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -3345,8 +3404,11 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AcssDebit + .MandateOptions + build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AcssDebit + .MandateOptions( this.customMandateUrl, this.extraParams, this.intervalDescription, @@ -3427,13 +3489,19 @@ public Builder setIntervalDescription(EmptyParam intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.MandateOptions + .PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.MandateOptions + .TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -3591,8 +3659,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay( + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AfterpayClearpay + build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AfterpayClearpay( this.captureMethod, this.extraParams, this.reference, this.setupFutureUsage); } @@ -3605,7 +3674,10 @@ public AfterpayClearpay build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AfterpayClearpay + .CaptureMethod + captureMethod) { this.captureMethod = captureMethod; return this; } @@ -3682,7 +3754,10 @@ public Builder setReference(EmptyParam reference) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AfterpayClearpay + .SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -3750,9 +3825,10 @@ public static class Alipay { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private Alipay(Map extraParams, EnumParam setupFutureUsage) { + private Alipay( + Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -3764,11 +3840,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams, this.setupFutureUsage); + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Alipay build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Alipay( + this.extraParams, this.setupFutureUsage); } /** @@ -3822,7 +3899,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Alipay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -3911,12 +3990,12 @@ public static class Bancontact { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Bancontact( Map extraParams, PreferredLanguage preferredLanguage, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.preferredLanguage = preferredLanguage; this.setupFutureUsage = setupFutureUsage; @@ -3931,11 +4010,11 @@ public static class Builder { private PreferredLanguage preferredLanguage; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact( + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Bancontact build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Bancontact( this.extraParams, this.preferredLanguage, this.setupFutureUsage); } @@ -3973,7 +4052,9 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Bancontact authorization page that the customer is * redirected to. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Bancontact.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -3999,7 +4080,9 @@ public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Bancontact.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4128,12 +4211,15 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card(this.captureMethod, this.extraParams, this.setupFutureUsage); + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Card build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Card( + this.captureMethod, this.extraParams, this.setupFutureUsage); } /** Controls when the funds will be captured from the customer's account. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Card.CaptureMethod + captureMethod) { this.captureMethod = captureMethod; return this; } @@ -4188,7 +4274,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Card.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4303,8 +4391,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance( + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance( this.bankTransfer, this.extraParams, this.fundingType, this.setupFutureUsage); } @@ -4312,7 +4400,9 @@ public CustomerBalance build() { * Configuration for the bank transfer funding type, if the {@code funding_type} is set * to {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance.BankTransfer + bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -4351,7 +4441,9 @@ public Builder putAllExtraParam(Map map) { * The funding method type to be used when there are not enough funds in the customer * balance. Permitted values include: {@code bank_transfer}. */ - public Builder setFundingType(FundingType fundingType) { + public Builder setFundingType( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance.FundingType + fundingType) { this.fundingType = fundingType; return this; } @@ -4377,7 +4469,10 @@ public Builder setFundingType(FundingType fundingType) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4406,7 +4501,10 @@ public static class BankTransfer { * {@code spei}. */ @SerializedName("requested_address_types") - List requestedAddressTypes; + List< + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.RequestedAddressType> + requestedAddressTypes; /** * The list of bank transfer types that this PaymentIntent is allowed to use for funding @@ -4419,7 +4517,10 @@ public static class BankTransfer { private BankTransfer( EuBankTransfer euBankTransfer, Map extraParams, - List requestedAddressTypes, + List< + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.RequestedAddressType> + requestedAddressTypes, Type type) { this.euBankTransfer = euBankTransfer; this.extraParams = extraParams; @@ -4436,17 +4537,26 @@ public static class Builder { private Map extraParams; - private List requestedAddressTypes; + private List< + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.RequestedAddressType> + requestedAddressTypes; private Type type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer( + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer + build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer( this.euBankTransfer, this.extraParams, this.requestedAddressTypes, this.type); } - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -4488,7 +4598,10 @@ public Builder putAllExtraParam(Map map) { * OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addRequestedAddressType(RequestedAddressType element) { + public Builder addRequestedAddressType( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.RequestedAddressType + element) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -4503,7 +4616,11 @@ public Builder addRequestedAddressType(RequestedAddressType element) { * OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance.BankTransfer#requestedAddressTypes} * for the field documentation. */ - public Builder addAllRequestedAddressType(List elements) { + public Builder addAllRequestedAddressType( + List< + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.RequestedAddressType> + elements) { if (this.requestedAddressTypes == null) { this.requestedAddressTypes = new ArrayList<>(); } @@ -4516,7 +4633,10 @@ public Builder addAllRequestedAddressType(List elements) { * funding Permitted values include: {@code eu_bank_transfer}, {@code * gb_bank_transfer}, {@code jp_bank_transfer}, or {@code mx_bank_transfer}. */ - public Builder setType(Type type) { + public Builder setType( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.Type + type) { this.type = type; return this; } @@ -4556,8 +4676,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer(this.country, this.extraParams); } /** @@ -4715,9 +4838,10 @@ public static class Ideal { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; - private Ideal(Map extraParams, EnumParam setupFutureUsage) { + private Ideal( + Map extraParams, ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -4729,11 +4853,12 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.extraParams, this.setupFutureUsage); + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Ideal build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Ideal( + this.extraParams, this.setupFutureUsage); } /** @@ -4787,7 +4912,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Ideal.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -4847,7 +4974,7 @@ public static class Klarna { * value for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -4890,7 +5017,7 @@ public static class Klarna { SetupFutureUsage setupFutureUsage; private Klarna( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, PreferredLocale preferredLocale, SetupFutureUsage setupFutureUsage) { @@ -4905,7 +5032,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -4914,8 +5041,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna( + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Klarna build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Klarna( this.captureMethod, this.extraParams, this.preferredLocale, @@ -4931,7 +5058,9 @@ public Klarna build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Klarna.CaptureMethod + captureMethod) { this.captureMethod = captureMethod; return this; } @@ -4984,7 +5113,9 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Klarna authorization page that the customer is redirected * to. */ - public Builder setPreferredLocale(PreferredLocale preferredLocale) { + public Builder setPreferredLocale( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Klarna.PreferredLocale + preferredLocale) { this.preferredLocale = preferredLocale; return this; } @@ -5010,7 +5141,9 @@ public Builder setPreferredLocale(PreferredLocale preferredLocale) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Klarna.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5035,6 +5168,9 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("de-AT") DE_AT("de-AT"), + @SerializedName("de-CH") + DE_CH("de-CH"), + @SerializedName("de-DE") DE_DE("de-DE"), @@ -5050,6 +5186,9 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("en-CA") EN_CA("en-CA"), + @SerializedName("en-CH") + EN_CH("en-CH"), + @SerializedName("en-DE") EN_DE("en-DE"), @@ -5083,6 +5222,12 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("en-NZ") EN_NZ("en-NZ"), + @SerializedName("en-PL") + EN_PL("en-PL"), + + @SerializedName("en-PT") + EN_PT("en-PT"), + @SerializedName("en-SE") EN_SE("en-SE"), @@ -5104,9 +5249,15 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("fr-CA") FR_CA("fr-CA"), + @SerializedName("fr-CH") + FR_CH("fr-CH"), + @SerializedName("fr-FR") FR_FR("fr-FR"), + @SerializedName("it-CH") + IT_CH("it-CH"), + @SerializedName("it-IT") IT_IT("it-IT"), @@ -5119,6 +5270,12 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { @SerializedName("nl-NL") NL_NL("nl-NL"), + @SerializedName("pl-PL") + PL_PL("pl-PL"), + + @SerializedName("pt-PT") + PT_PT("pt-PT"), + @SerializedName("sv-FI") SV_FI("sv-FI"), @@ -5158,7 +5315,7 @@ public static class Link { * value for this parameter will unset the stored value for this payment method type. */ @SerializedName("capture_method") - EnumParam captureMethod; + ApiRequestParams.EnumParam captureMethod; /** * Map of extra parameters for custom features not available in this client library. The @@ -5196,13 +5353,13 @@ public static class Link { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Link( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, Object persistentToken, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.captureMethod = captureMethod; this.extraParams = extraParams; this.persistentToken = persistentToken; @@ -5214,17 +5371,17 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; private Object persistentToken; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link( + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Link build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Link( this.captureMethod, this.extraParams, this.persistentToken, @@ -5240,7 +5397,9 @@ public Link build() { *

If {@code capture_method} is already set on the PaymentIntent, providing an empty * value for this parameter will unset the stored value for this payment method type. */ - public Builder setCaptureMethod(CaptureMethod captureMethod) { + public Builder setCaptureMethod( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Link.CaptureMethod + captureMethod) { this.captureMethod = captureMethod; return this; } @@ -5322,7 +5481,9 @@ public Builder setPersistentToken(EmptyParam persistentToken) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Link.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5447,8 +5608,9 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.expiresAfterDays, this.extraParams, this.setupFutureUsage); + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Oxxo build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Oxxo( + this.expiresAfterDays, this.extraParams, this.setupFutureUsage); } /** @@ -5512,7 +5674,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Oxxo.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5592,8 +5756,9 @@ public static class Builder { private Boolean tosShownAndAccepted; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.P24 build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.P24( + this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted); } /** @@ -5647,7 +5812,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.P24.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5672,6 +5839,185 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + public static class Paypal { + @SerializedName("capture_method") + ApiRequestParams.EnumParam captureMethod; + + /** + * 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; + + @SerializedName("preferred_locale") + PreferredLocale preferredLocale; + + private Paypal( + ApiRequestParams.EnumParam captureMethod, + Map extraParams, + PreferredLocale preferredLocale) { + this.captureMethod = captureMethod; + this.extraParams = extraParams; + this.preferredLocale = preferredLocale; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ApiRequestParams.EnumParam captureMethod; + + private Map extraParams; + + private PreferredLocale preferredLocale; + + /** Finalize and obtain parameter instance from this builder. */ + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Paypal build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Paypal( + this.captureMethod, this.extraParams, this.preferredLocale); + } + + public Builder setCaptureMethod( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Paypal.CaptureMethod + captureMethod) { + this.captureMethod = captureMethod; + return this; + } + + public Builder setCaptureMethod(EmptyParam captureMethod) { + this.captureMethod = captureMethod; + 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 + * OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Paypal#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 + * OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Paypal#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 Builder setPreferredLocale( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Paypal.PreferredLocale + preferredLocale) { + this.preferredLocale = preferredLocale; + return this; + } + } + + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + + public enum PreferredLocale implements ApiRequestParams.EnumParam { + @SerializedName("cs_CZ") + CS_CZ("cs_CZ"), + + @SerializedName("da_DK") + DA_DK("da_DK"), + + @SerializedName("de_AT") + DE_AT("de_AT"), + + @SerializedName("de_DE") + DE_DE("de_DE"), + + @SerializedName("de_LU") + DE_LU("de_LU"), + + @SerializedName("el_GR") + EL_GR("el_GR"), + + @SerializedName("en_GB") + EN_GB("en_GB"), + + @SerializedName("en_US") + EN_US("en_US"), + + @SerializedName("es_ES") + ES_ES("es_ES"), + + @SerializedName("fi_FI") + FI_FI("fi_FI"), + + @SerializedName("fr_BE") + FR_BE("fr_BE"), + + @SerializedName("fr_FR") + FR_FR("fr_FR"), + + @SerializedName("fr_LU") + FR_LU("fr_LU"), + + @SerializedName("hu_HU") + HU_HU("hu_HU"), + + @SerializedName("it_IT") + IT_IT("it_IT"), + + @SerializedName("nl_BE") + NL_BE("nl_BE"), + + @SerializedName("nl_NL") + NL_NL("nl_NL"), + + @SerializedName("pl_PL") + PL_PL("pl_PL"), + + @SerializedName("pt_PT") + PT_PT("pt_PT"), + + @SerializedName("sk_SK") + SK_SK("sk_SK"), + + @SerializedName("sv_SE") + SV_SE("sv_SE"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLocale(String value) { + this.value = value; + } + } + } + @Getter public static class SepaDebit { /** @@ -5710,12 +6056,12 @@ public static class SepaDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private SepaDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; this.setupFutureUsage = setupFutureUsage; @@ -5730,11 +6076,12 @@ public static class Builder { private MandateOptions mandateOptions; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.mandateOptions, this.setupFutureUsage); + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.SepaDebit build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.SepaDebit( + this.extraParams, this.mandateOptions, this.setupFutureUsage); } /** @@ -5768,7 +6115,9 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.SepaDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5794,7 +6143,9 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.SepaDebit.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -5850,8 +6201,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams); + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.SepaDebit + .MandateOptions + build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.SepaDebit + .MandateOptions(this.extraParams); } /** @@ -5919,7 +6273,7 @@ public static class Sofort { /** Language shown to the payer on redirect. */ @SerializedName("preferred_language") - EnumParam preferredLanguage; + ApiRequestParams.EnumParam preferredLanguage; /** * Indicates that you intend to make future payments with this PaymentIntent's payment @@ -5943,12 +6297,12 @@ public static class Sofort { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; private Sofort( Map extraParams, - EnumParam preferredLanguage, - EnumParam setupFutureUsage) { + ApiRequestParams.EnumParam preferredLanguage, + ApiRequestParams.EnumParam setupFutureUsage) { this.extraParams = extraParams; this.preferredLanguage = preferredLanguage; this.setupFutureUsage = setupFutureUsage; @@ -5961,13 +6315,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam preferredLanguage; + private ApiRequestParams.EnumParam preferredLanguage; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.extraParams, this.preferredLanguage, this.setupFutureUsage); + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Sofort build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Sofort( + this.extraParams, this.preferredLanguage, this.setupFutureUsage); } /** @@ -6001,7 +6356,9 @@ public Builder putAllExtraParam(Map map) { } /** Language shown to the payer on redirect. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Sofort.PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -6033,7 +6390,9 @@ public Builder setPreferredLanguage(EmptyParam preferredLanguage) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.Sofort.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6180,8 +6539,8 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay( + public OrderUpdateParams.Payment.Settings.PaymentMethodOptions.WechatPay build() { + return new OrderUpdateParams.Payment.Settings.PaymentMethodOptions.WechatPay( this.appId, this.client, this.extraParams, this.setupFutureUsage); } @@ -6202,7 +6561,8 @@ public Builder setAppId(EmptyParam appId) { } /** The client type that the end customer will pay from. */ - public Builder setClient(Client client) { + public Builder setClient( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.WechatPay.Client client) { this.client = client; return this; } @@ -6258,7 +6618,9 @@ public Builder putAllExtraParam(Map map) { * using a publishable key, you may only update the value from {@code on_session} to * {@code off_session}. */ - public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) { + public Builder setSetupFutureUsage( + OrderUpdateParams.Payment.Settings.PaymentMethodOptions.WechatPay.SetupFutureUsage + setupFutureUsage) { this.setupFutureUsage = setupFutureUsage; return this; } @@ -6338,8 +6700,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amount, this.destination, this.extraParams); + public OrderUpdateParams.Payment.Settings.TransferData build() { + return new OrderUpdateParams.Payment.Settings.TransferData( + this.amount, this.destination, this.extraParams); } /** @@ -6446,6 +6809,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("p24") P24("p24"), + @SerializedName("paypal") + PAYPAL("paypal"), + @SerializedName("sepa_debit") SEPA_DEBIT("sepa_debit"), @@ -6503,8 +6869,9 @@ public static class Builder { private ShippingRateData shippingRateData; /** Finalize and obtain parameter instance from this builder. */ - public ShippingCost build() { - return new ShippingCost(this.extraParams, this.shippingRate, this.shippingRateData); + public OrderUpdateParams.ShippingCost build() { + return new OrderUpdateParams.ShippingCost( + this.extraParams, this.shippingRate, this.shippingRateData); } /** @@ -6546,7 +6913,8 @@ public Builder setShippingRate(EmptyParam shippingRate) { } /** Parameters to create a new ad-hoc shipping rate for this order. */ - public Builder setShippingRateData(ShippingRateData shippingRateData) { + public Builder setShippingRateData( + OrderUpdateParams.ShippingCost.ShippingRateData shippingRateData) { this.shippingRateData = shippingRateData; return this; } @@ -6655,8 +7023,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public ShippingRateData build() { - return new ShippingRateData( + public OrderUpdateParams.ShippingCost.ShippingRateData build() { + return new OrderUpdateParams.ShippingCost.ShippingRateData( this.deliveryEstimate, this.displayName, this.extraParams, @@ -6671,7 +7039,8 @@ public ShippingRateData build() { * The estimated range for how long shipping will take, meant to be displayable to the * customer. This will appear on CheckoutSessions. */ - public Builder setDeliveryEstimate(DeliveryEstimate deliveryEstimate) { + public Builder setDeliveryEstimate( + OrderUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate deliveryEstimate) { this.deliveryEstimate = deliveryEstimate; return this; } @@ -6726,7 +7095,8 @@ public Builder putAllExtraParam(Map map) { * Describes a fixed amount to charge for shipping. Must be present if type is {@code * fixed_amount}. */ - public Builder setFixedAmount(FixedAmount fixedAmount) { + public Builder setFixedAmount( + OrderUpdateParams.ShippingCost.ShippingRateData.FixedAmount fixedAmount) { this.fixedAmount = fixedAmount; return this; } @@ -6762,7 +7132,8 @@ public Builder putAllMetadata(Map map) { * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of * {@code inclusive}, {@code exclusive}, or {@code unspecified}. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + OrderUpdateParams.ShippingCost.ShippingRateData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -6789,7 +7160,7 @@ public Builder setTaxCode(EmptyParam taxCode) { * The type of calculation to use on the shipping rate. Can only be {@code fixed_amount} for * now. */ - public Builder setType(Type type) { + public Builder setType(OrderUpdateParams.ShippingCost.ShippingRateData.Type type) { this.type = type; return this; } @@ -6837,8 +7208,9 @@ public static class Builder { private Minimum minimum; /** Finalize and obtain parameter instance from this builder. */ - public DeliveryEstimate build() { - return new DeliveryEstimate(this.extraParams, this.maximum, this.minimum); + public OrderUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate build() { + return new OrderUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate( + this.extraParams, this.maximum, this.minimum); } /** @@ -6875,13 +7247,15 @@ public Builder putAllExtraParam(Map map) { * The upper bound of the estimated range. If empty, represents no upper bound i.e., * infinite. */ - public Builder setMaximum(Maximum maximum) { + public Builder setMaximum( + OrderUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum maximum) { this.maximum = maximum; return this; } /** The lower bound of the estimated range. If empty, represents no lower bound. */ - public Builder setMinimum(Minimum minimum) { + public Builder setMinimum( + OrderUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum minimum) { this.minimum = minimum; return this; } @@ -6925,8 +7299,10 @@ public static class Builder { private Long value; /** Finalize and obtain parameter instance from this builder. */ - public Maximum build() { - return new Maximum(this.extraParams, this.unit, this.value); + public OrderUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum + build() { + return new OrderUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum( + this.extraParams, this.unit, this.value); } /** @@ -6960,7 +7336,9 @@ public Builder putAllExtraParam(Map map) { } /** A unit of time. */ - public Builder setUnit(Unit unit) { + public Builder setUnit( + OrderUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum.Unit + unit) { this.unit = unit; return this; } @@ -7035,8 +7413,10 @@ public static class Builder { private Long value; /** Finalize and obtain parameter instance from this builder. */ - public Minimum build() { - return new Minimum(this.extraParams, this.unit, this.value); + public OrderUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum + build() { + return new OrderUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum( + this.extraParams, this.unit, this.value); } /** @@ -7070,7 +7450,9 @@ public Builder putAllExtraParam(Map map) { } /** A unit of time. */ - public Builder setUnit(Unit unit) { + public Builder setUnit( + OrderUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum.Unit + unit) { this.unit = unit; return this; } @@ -7128,7 +7510,8 @@ public static class FixedAmount { * href="https://stripe.com/docs/currencies">supported currency. */ @SerializedName("currency_options") - Map currencyOptions; + Map + currencyOptions; /** * Map of extra parameters for custom features not available in this client library. The @@ -7143,7 +7526,8 @@ public static class FixedAmount { private FixedAmount( Long amount, Object currency, - Map currencyOptions, + Map + currencyOptions, Map extraParams) { this.amount = amount; this.currency = currency; @@ -7160,13 +7544,16 @@ public static class Builder { private Object currency; - private Map currencyOptions; + private Map< + String, + OrderUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption> + currencyOptions; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public FixedAmount build() { - return new FixedAmount( + public OrderUpdateParams.ShippingCost.ShippingRateData.FixedAmount build() { + return new OrderUpdateParams.ShippingCost.ShippingRateData.FixedAmount( this.amount, this.currency, this.currencyOptions, this.extraParams); } @@ -7203,7 +7590,9 @@ public Builder setCurrency(EmptyParam currency) { * OrderUpdateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the * field documentation. */ - public Builder putCurrencyOption(String key, CurrencyOption value) { + public Builder putCurrencyOption( + String key, + OrderUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption value) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -7218,7 +7607,11 @@ public Builder putCurrencyOption(String key, CurrencyOption value) { * OrderUpdateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the * field documentation. */ - public Builder putAllCurrencyOption(Map map) { + public Builder putAllCurrencyOption( + Map< + String, + OrderUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption> + map) { if (this.currencyOptions == null) { this.currencyOptions = new HashMap<>(); } @@ -7299,8 +7692,10 @@ public static class Builder { private TaxBehavior taxBehavior; /** Finalize and obtain parameter instance from this builder. */ - public CurrencyOption build() { - return new CurrencyOption(this.amount, this.extraParams, this.taxBehavior); + public OrderUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption + build() { + return new OrderUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption( + this.amount, this.extraParams, this.taxBehavior); } /** A non-negative integer in cents representing how much to charge. */ @@ -7343,7 +7738,10 @@ public Builder putAllExtraParam(Map map) { * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. * One of {@code inclusive}, {@code exclusive}, or {@code unspecified}. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + OrderUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption + .TaxBehavior + taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -7446,12 +7844,13 @@ public static class Builder { private Object phone; /** Finalize and obtain parameter instance from this builder. */ - public ShippingDetails build() { - return new ShippingDetails(this.address, this.extraParams, this.name, this.phone); + public OrderUpdateParams.ShippingDetails build() { + return new OrderUpdateParams.ShippingDetails( + this.address, this.extraParams, this.name, this.phone); } /** The shipping address for the order. */ - public Builder setAddress(Address address) { + public Builder setAddress(OrderUpdateParams.ShippingDetails.Address address) { this.address = address; return this; } @@ -7585,8 +7984,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public OrderUpdateParams.ShippingDetails.Address build() { + return new OrderUpdateParams.ShippingDetails.Address( this.city, this.country, this.extraParams, @@ -7727,13 +8126,16 @@ public static class TaxDetails { * reverse}. */ @SerializedName("tax_exempt") - EnumParam taxExempt; + ApiRequestParams.EnumParam taxExempt; /** The purchaser's tax IDs to be used for this order. */ @SerializedName("tax_ids") - List taxIds; + List taxIds; - private TaxDetails(Map extraParams, EnumParam taxExempt, List taxIds) { + private TaxDetails( + Map extraParams, + ApiRequestParams.EnumParam taxExempt, + List taxIds) { this.extraParams = extraParams; this.taxExempt = taxExempt; this.taxIds = taxIds; @@ -7746,13 +8148,13 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private EnumParam taxExempt; + private ApiRequestParams.EnumParam taxExempt; - private List taxIds; + private List taxIds; /** Finalize and obtain parameter instance from this builder. */ - public TaxDetails build() { - return new TaxDetails(this.extraParams, this.taxExempt, this.taxIds); + public OrderUpdateParams.TaxDetails build() { + return new OrderUpdateParams.TaxDetails(this.extraParams, this.taxExempt, this.taxIds); } /** @@ -7785,7 +8187,7 @@ public Builder putAllExtraParam(Map map) { * The purchaser's tax exemption status. One of {@code none}, {@code exempt}, or {@code * reverse}. */ - public Builder setTaxExempt(TaxExempt taxExempt) { + public Builder setTaxExempt(OrderUpdateParams.TaxDetails.TaxExempt taxExempt) { this.taxExempt = taxExempt; return this; } @@ -7804,7 +8206,7 @@ public Builder setTaxExempt(EmptyParam taxExempt) { * subsequent calls adds additional elements to the original list. See {@link * OrderUpdateParams.TaxDetails#taxIds} for the field documentation. */ - public Builder addTaxId(TaxId element) { + public Builder addTaxId(OrderUpdateParams.TaxDetails.TaxId element) { if (this.taxIds == null) { this.taxIds = new ArrayList<>(); } @@ -7817,7 +8219,7 @@ public Builder addTaxId(TaxId element) { * and subsequent calls adds additional elements to the original list. See {@link * OrderUpdateParams.TaxDetails#taxIds} for the field documentation. */ - public Builder addAllTaxId(List elements) { + public Builder addAllTaxId(List elements) { if (this.taxIds == null) { this.taxIds = new ArrayList<>(); } @@ -7873,8 +8275,8 @@ public static class Builder { private Object value; /** Finalize and obtain parameter instance from this builder. */ - public TaxId build() { - return new TaxId(this.extraParams, this.type, this.value); + public OrderUpdateParams.TaxDetails.TaxId build() { + return new OrderUpdateParams.TaxDetails.TaxId(this.extraParams, this.type, this.value); } /** @@ -7917,7 +8319,7 @@ public Builder putAllExtraParam(Map map) { * si_tin}, {@code th_vat}, {@code tw_vat}, {@code ua_vat}, {@code us_ein}, or {@code * za_vat}. */ - public Builder setType(Type type) { + public Builder setType(OrderUpdateParams.TaxDetails.TaxId.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index b7b30166852..a945caff4ed 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -1056,6 +1056,13 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + @SerializedName("paypal") + Paypal paypal; + /** * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. @@ -1139,6 +1146,7 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Paypal paypal, Pix pix, Promptpay promptpay, RadarOptions radarOptions, @@ -1172,6 +1180,7 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; @@ -1237,6 +1246,8 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + private Pix pix; private Promptpay promptpay; @@ -1281,6 +1292,7 @@ public PaymentIntentConfirmParams.PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.paypal, this.pix, this.promptpay, this.radarOptions, @@ -1560,6 +1572,15 @@ public Builder setPaynow(PaymentIntentConfirmParams.PaymentMethodData.Paynow pay return this; } + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + public Builder setPaypal(PaymentIntentConfirmParams.PaymentMethodData.Paypal paypal) { + this.paypal = paypal; + return this; + } + /** * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. @@ -3791,6 +3812,63 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Paypal { + /** + * 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 Paypal(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodData.Paypal build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Paypal(this.extraParams); + } + + /** + * 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.Paypal#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.Paypal#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 public static class Pix { /** @@ -4442,6 +4520,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + @SerializedName("pix") PIX("pix"), @@ -4645,6 +4726,13 @@ public static class PaymentMethodOptions { @SerializedName("paynow") Object paynow; + /** + * If this is a {@code paypal} PaymentMethod, this sub-hash contains details about the PayPal + * payment method options. + */ + @SerializedName("paypal") + Object paypal; + /** * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix payment * method options. @@ -4713,6 +4801,7 @@ private PaymentMethodOptions( Object oxxo, Object p24, Object paynow, + Object paypal, Object pix, Object promptpay, Object sepaDebit, @@ -4744,6 +4833,7 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; this.pix = pix; this.promptpay = promptpay; this.sepaDebit = sepaDebit; @@ -4807,6 +4897,8 @@ public static class Builder { private Object paynow; + private Object paypal; + private Object pix; private Object promptpay; @@ -4847,6 +4939,7 @@ public PaymentIntentConfirmParams.PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.paypal, this.pix, this.promptpay, this.sepaDebit, @@ -5316,6 +5409,24 @@ public Builder setPaynow(EmptyParam paynow) { return this; } + /** + * If this is a {@code paypal} PaymentMethod, this sub-hash contains details about the PayPal + * payment method options. + */ + public Builder setPaypal(PaymentIntentConfirmParams.PaymentMethodOptions.Paypal paypal) { + this.paypal = paypal; + return this; + } + + /** + * If this is a {@code paypal} PaymentMethod, this sub-hash contains details about the PayPal + * payment method options. + */ + public Builder setPaypal(EmptyParam paypal) { + this.paypal = paypal; + return this; + } + /** * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix * payment method options. @@ -10662,6 +10773,181 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + public static class Paypal { + @SerializedName("capture_method") + ApiRequestParams.EnumParam captureMethod; + + /** + * 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; + + @SerializedName("preferred_locale") + PreferredLocale preferredLocale; + + private Paypal( + ApiRequestParams.EnumParam captureMethod, + Map extraParams, + PreferredLocale preferredLocale) { + this.captureMethod = captureMethod; + this.extraParams = extraParams; + this.preferredLocale = preferredLocale; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ApiRequestParams.EnumParam captureMethod; + + private Map extraParams; + + private PreferredLocale preferredLocale; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodOptions.Paypal build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Paypal( + this.captureMethod, this.extraParams, this.preferredLocale); + } + + public Builder setCaptureMethod( + PaymentIntentConfirmParams.PaymentMethodOptions.Paypal.CaptureMethod captureMethod) { + this.captureMethod = captureMethod; + return this; + } + + public Builder setCaptureMethod(EmptyParam captureMethod) { + this.captureMethod = captureMethod; + 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.Paypal#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.Paypal#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 Builder setPreferredLocale( + PaymentIntentConfirmParams.PaymentMethodOptions.Paypal.PreferredLocale + preferredLocale) { + this.preferredLocale = preferredLocale; + return this; + } + } + + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + + public enum PreferredLocale implements ApiRequestParams.EnumParam { + @SerializedName("cs_CZ") + CS_CZ("cs_CZ"), + + @SerializedName("da_DK") + DA_DK("da_DK"), + + @SerializedName("de_AT") + DE_AT("de_AT"), + + @SerializedName("de_DE") + DE_DE("de_DE"), + + @SerializedName("de_LU") + DE_LU("de_LU"), + + @SerializedName("el_GR") + EL_GR("el_GR"), + + @SerializedName("en_GB") + EN_GB("en_GB"), + + @SerializedName("en_US") + EN_US("en_US"), + + @SerializedName("es_ES") + ES_ES("es_ES"), + + @SerializedName("fi_FI") + FI_FI("fi_FI"), + + @SerializedName("fr_BE") + FR_BE("fr_BE"), + + @SerializedName("fr_FR") + FR_FR("fr_FR"), + + @SerializedName("fr_LU") + FR_LU("fr_LU"), + + @SerializedName("hu_HU") + HU_HU("hu_HU"), + + @SerializedName("it_IT") + IT_IT("it_IT"), + + @SerializedName("nl_BE") + NL_BE("nl_BE"), + + @SerializedName("nl_NL") + NL_NL("nl_NL"), + + @SerializedName("pl_PL") + PL_PL("pl_PL"), + + @SerializedName("pt_PT") + PT_PT("pt_PT"), + + @SerializedName("sk_SK") + SK_SK("sk_SK"), + + @SerializedName("sv_SE") + SV_SE("sv_SE"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLocale(String value) { + this.value = value; + } + } + } + @Getter public static class Pix { /** diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index f1fd08724e8..ec168634cab 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -790,7 +790,8 @@ public Builder setReturnUrl(String returnUrl) { * Indicates whether confirmation for this PaymentIntent using a secret key is {@code required} * or {@code optional}. */ - public Builder setSecretKeyConfirmation(SecretKeyConfirmation secretKeyConfirmation) { + public Builder setSecretKeyConfirmation( + PaymentIntentCreateParams.SecretKeyConfirmation secretKeyConfirmation) { this.secretKeyConfirmation = secretKeyConfirmation; return this; } @@ -1490,6 +1491,13 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + @SerializedName("paypal") + Paypal paypal; + /** * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. @@ -1573,6 +1581,7 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Paypal paypal, Pix pix, Promptpay promptpay, RadarOptions radarOptions, @@ -1606,6 +1615,7 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; @@ -1671,6 +1681,8 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + private Pix pix; private Promptpay promptpay; @@ -1715,6 +1727,7 @@ public PaymentIntentCreateParams.PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.paypal, this.pix, this.promptpay, this.radarOptions, @@ -1992,6 +2005,15 @@ public Builder setPaynow(PaymentIntentCreateParams.PaymentMethodData.Paynow payn return this; } + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + public Builder setPaypal(PaymentIntentCreateParams.PaymentMethodData.Paypal paypal) { + this.paypal = paypal; + return this; + } + /** * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. @@ -4215,6 +4237,63 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Paypal { + /** + * 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 Paypal(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodData.Paypal build() { + return new PaymentIntentCreateParams.PaymentMethodData.Paypal(this.extraParams); + } + + /** + * 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.Paypal#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.Paypal#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 public static class Pix { /** @@ -4866,6 +4945,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + @SerializedName("pix") PIX("pix"), @@ -5069,6 +5151,13 @@ public static class PaymentMethodOptions { @SerializedName("paynow") Object paynow; + /** + * If this is a {@code paypal} PaymentMethod, this sub-hash contains details about the PayPal + * payment method options. + */ + @SerializedName("paypal") + Object paypal; + /** * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix payment * method options. @@ -5137,6 +5226,7 @@ private PaymentMethodOptions( Object oxxo, Object p24, Object paynow, + Object paypal, Object pix, Object promptpay, Object sepaDebit, @@ -5168,6 +5258,7 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; this.pix = pix; this.promptpay = promptpay; this.sepaDebit = sepaDebit; @@ -5231,6 +5322,8 @@ public static class Builder { private Object paynow; + private Object paypal; + private Object pix; private Object promptpay; @@ -5271,6 +5364,7 @@ public PaymentIntentCreateParams.PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.paypal, this.pix, this.promptpay, this.sepaDebit, @@ -5740,6 +5834,24 @@ public Builder setPaynow(EmptyParam paynow) { return this; } + /** + * If this is a {@code paypal} PaymentMethod, this sub-hash contains details about the PayPal + * payment method options. + */ + public Builder setPaypal(PaymentIntentCreateParams.PaymentMethodOptions.Paypal paypal) { + this.paypal = paypal; + return this; + } + + /** + * If this is a {@code paypal} PaymentMethod, this sub-hash contains details about the PayPal + * payment method options. + */ + public Builder setPaypal(EmptyParam paypal) { + this.paypal = paypal; + return this; + } + /** * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix * payment method options. @@ -11080,6 +11192,180 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + public static class Paypal { + @SerializedName("capture_method") + ApiRequestParams.EnumParam captureMethod; + + /** + * 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; + + @SerializedName("preferred_locale") + PreferredLocale preferredLocale; + + private Paypal( + ApiRequestParams.EnumParam captureMethod, + Map extraParams, + PreferredLocale preferredLocale) { + this.captureMethod = captureMethod; + this.extraParams = extraParams; + this.preferredLocale = preferredLocale; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ApiRequestParams.EnumParam captureMethod; + + private Map extraParams; + + private PreferredLocale preferredLocale; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodOptions.Paypal build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Paypal( + this.captureMethod, this.extraParams, this.preferredLocale); + } + + public Builder setCaptureMethod( + PaymentIntentCreateParams.PaymentMethodOptions.Paypal.CaptureMethod captureMethod) { + this.captureMethod = captureMethod; + return this; + } + + public Builder setCaptureMethod(EmptyParam captureMethod) { + this.captureMethod = captureMethod; + 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.Paypal#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.Paypal#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 Builder setPreferredLocale( + PaymentIntentCreateParams.PaymentMethodOptions.Paypal.PreferredLocale preferredLocale) { + this.preferredLocale = preferredLocale; + return this; + } + } + + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + + public enum PreferredLocale implements ApiRequestParams.EnumParam { + @SerializedName("cs_CZ") + CS_CZ("cs_CZ"), + + @SerializedName("da_DK") + DA_DK("da_DK"), + + @SerializedName("de_AT") + DE_AT("de_AT"), + + @SerializedName("de_DE") + DE_DE("de_DE"), + + @SerializedName("de_LU") + DE_LU("de_LU"), + + @SerializedName("el_GR") + EL_GR("el_GR"), + + @SerializedName("en_GB") + EN_GB("en_GB"), + + @SerializedName("en_US") + EN_US("en_US"), + + @SerializedName("es_ES") + ES_ES("es_ES"), + + @SerializedName("fi_FI") + FI_FI("fi_FI"), + + @SerializedName("fr_BE") + FR_BE("fr_BE"), + + @SerializedName("fr_FR") + FR_FR("fr_FR"), + + @SerializedName("fr_LU") + FR_LU("fr_LU"), + + @SerializedName("hu_HU") + HU_HU("hu_HU"), + + @SerializedName("it_IT") + IT_IT("it_IT"), + + @SerializedName("nl_BE") + NL_BE("nl_BE"), + + @SerializedName("nl_NL") + NL_NL("nl_NL"), + + @SerializedName("pl_PL") + PL_PL("pl_PL"), + + @SerializedName("pt_PT") + PT_PT("pt_PT"), + + @SerializedName("sk_SK") + SK_SK("sk_SK"), + + @SerializedName("sv_SE") + SV_SE("sv_SE"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLocale(String value) { + this.value = value; + } + } + } + @Getter public static class Pix { /** diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 42d2158d168..36f87f8b77b 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -458,7 +458,7 @@ public Builder putAllExtraParam(Map map) { } /** This hash contains details about the Mandate to create. */ - public Builder setMandateData(MandateDataPublishableKey mandateData) { + public Builder setMandateData(PaymentIntentUpdateParams.MandateDataPublishableKey mandateData) { this.mandateData = mandateData; return this; } @@ -762,12 +762,15 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateDataPublishableKey build() { - return new MandateDataPublishableKey(this.customerAcceptance, this.extraParams); + public PaymentIntentUpdateParams.MandateDataPublishableKey build() { + return new PaymentIntentUpdateParams.MandateDataPublishableKey( + this.customerAcceptance, this.extraParams); } /** This hash contains details about the customer acceptance of the Mandate. */ - public Builder setCustomerAcceptance(CustomerAcceptance customerAcceptance) { + public Builder setCustomerAcceptance( + PaymentIntentUpdateParams.MandateDataPublishableKey.CustomerAcceptance + customerAcceptance) { this.customerAcceptance = customerAcceptance; return this; } @@ -841,8 +844,9 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public CustomerAcceptance build() { - return new CustomerAcceptance(this.extraParams, this.online, this.type); + public PaymentIntentUpdateParams.MandateDataPublishableKey.CustomerAcceptance build() { + return new PaymentIntentUpdateParams.MandateDataPublishableKey.CustomerAcceptance( + this.extraParams, this.online, this.type); } /** @@ -879,13 +883,15 @@ public Builder putAllExtraParam(Map map) { * If this is a Mandate accepted online, this hash contains details about the online * acceptance. */ - public Builder setOnline(Online online) { + public Builder setOnline( + PaymentIntentUpdateParams.MandateDataPublishableKey.CustomerAcceptance.Online online) { this.online = online; return this; } /** The type of customer acceptance information included with the Mandate. */ - public Builder setType(Type type) { + public Builder setType( + PaymentIntentUpdateParams.MandateDataPublishableKey.CustomerAcceptance.Type type) { this.type = type; return this; } @@ -929,8 +935,10 @@ public static class Builder { private Object userAgent; /** Finalize and obtain parameter instance from this builder. */ - public Online build() { - return new Online(this.extraParams, this.ipAddress, this.userAgent); + public PaymentIntentUpdateParams.MandateDataPublishableKey.CustomerAcceptance.Online + build() { + return new PaymentIntentUpdateParams.MandateDataPublishableKey.CustomerAcceptance + .Online(this.extraParams, this.ipAddress, this.userAgent); } /** @@ -1184,6 +1192,13 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + @SerializedName("paypal") + Paypal paypal; + /** * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. @@ -1267,6 +1282,7 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Paypal paypal, Pix pix, Promptpay promptpay, RadarOptions radarOptions, @@ -1300,6 +1316,7 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; @@ -1365,6 +1382,8 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + private Pix pix; private Promptpay promptpay; @@ -1409,6 +1428,7 @@ public PaymentIntentUpdateParams.PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.paypal, this.pix, this.promptpay, this.radarOptions, @@ -1686,6 +1706,15 @@ public Builder setPaynow(PaymentIntentUpdateParams.PaymentMethodData.Paynow payn return this; } + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + public Builder setPaypal(PaymentIntentUpdateParams.PaymentMethodData.Paypal paypal) { + this.paypal = paypal; + return this; + } + /** * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment * method. @@ -4011,6 +4040,63 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Paypal { + /** + * 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 Paypal(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodData.Paypal build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Paypal(this.extraParams); + } + + /** + * 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.Paypal#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.Paypal#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 public static class Pix { /** @@ -4696,6 +4782,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + @SerializedName("pix") PIX("pix"), @@ -4899,6 +4988,13 @@ public static class PaymentMethodOptions { @SerializedName("paynow") Object paynow; + /** + * If this is a {@code paypal} PaymentMethod, this sub-hash contains details about the PayPal + * payment method options. + */ + @SerializedName("paypal") + Object paypal; + /** * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix payment * method options. @@ -4967,6 +5063,7 @@ private PaymentMethodOptions( Object oxxo, Object p24, Object paynow, + Object paypal, Object pix, Object promptpay, Object sepaDebit, @@ -4998,6 +5095,7 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; this.pix = pix; this.promptpay = promptpay; this.sepaDebit = sepaDebit; @@ -5061,6 +5159,8 @@ public static class Builder { private Object paynow; + private Object paypal; + private Object pix; private Object promptpay; @@ -5101,6 +5201,7 @@ public PaymentIntentUpdateParams.PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.paypal, this.pix, this.promptpay, this.sepaDebit, @@ -5570,6 +5671,24 @@ public Builder setPaynow(EmptyParam paynow) { return this; } + /** + * If this is a {@code paypal} PaymentMethod, this sub-hash contains details about the PayPal + * payment method options. + */ + public Builder setPaypal(PaymentIntentUpdateParams.PaymentMethodOptions.Paypal paypal) { + this.paypal = paypal; + return this; + } + + /** + * If this is a {@code paypal} PaymentMethod, this sub-hash contains details about the PayPal + * payment method options. + */ + public Builder setPaypal(EmptyParam paypal) { + this.paypal = paypal; + return this; + } + /** * If this is a {@code pix} PaymentMethod, this sub-hash contains details about the Pix * payment method options. @@ -10998,6 +11117,180 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + public static class Paypal { + @SerializedName("capture_method") + ApiRequestParams.EnumParam captureMethod; + + /** + * 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; + + @SerializedName("preferred_locale") + PreferredLocale preferredLocale; + + private Paypal( + ApiRequestParams.EnumParam captureMethod, + Map extraParams, + PreferredLocale preferredLocale) { + this.captureMethod = captureMethod; + this.extraParams = extraParams; + this.preferredLocale = preferredLocale; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ApiRequestParams.EnumParam captureMethod; + + private Map extraParams; + + private PreferredLocale preferredLocale; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodOptions.Paypal build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Paypal( + this.captureMethod, this.extraParams, this.preferredLocale); + } + + public Builder setCaptureMethod( + PaymentIntentUpdateParams.PaymentMethodOptions.Paypal.CaptureMethod captureMethod) { + this.captureMethod = captureMethod; + return this; + } + + public Builder setCaptureMethod(EmptyParam captureMethod) { + this.captureMethod = captureMethod; + 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.Paypal#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.Paypal#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 Builder setPreferredLocale( + PaymentIntentUpdateParams.PaymentMethodOptions.Paypal.PreferredLocale preferredLocale) { + this.preferredLocale = preferredLocale; + return this; + } + } + + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + + public enum PreferredLocale implements ApiRequestParams.EnumParam { + @SerializedName("cs_CZ") + CS_CZ("cs_CZ"), + + @SerializedName("da_DK") + DA_DK("da_DK"), + + @SerializedName("de_AT") + DE_AT("de_AT"), + + @SerializedName("de_DE") + DE_DE("de_DE"), + + @SerializedName("de_LU") + DE_LU("de_LU"), + + @SerializedName("el_GR") + EL_GR("el_GR"), + + @SerializedName("en_GB") + EN_GB("en_GB"), + + @SerializedName("en_US") + EN_US("en_US"), + + @SerializedName("es_ES") + ES_ES("es_ES"), + + @SerializedName("fi_FI") + FI_FI("fi_FI"), + + @SerializedName("fr_BE") + FR_BE("fr_BE"), + + @SerializedName("fr_FR") + FR_FR("fr_FR"), + + @SerializedName("fr_LU") + FR_LU("fr_LU"), + + @SerializedName("hu_HU") + HU_HU("hu_HU"), + + @SerializedName("it_IT") + IT_IT("it_IT"), + + @SerializedName("nl_BE") + NL_BE("nl_BE"), + + @SerializedName("nl_NL") + NL_NL("nl_NL"), + + @SerializedName("pl_PL") + PL_PL("pl_PL"), + + @SerializedName("pt_PT") + PT_PT("pt_PT"), + + @SerializedName("sk_SK") + SK_SK("sk_SK"), + + @SerializedName("sv_SE") + SV_SE("sv_SE"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLocale(String value) { + this.value = value; + } + } + } + @Getter public static class Pix { /** diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index d236dc39fa4..e3630c1d42c 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -2804,6 +2804,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + @SerializedName("pix") PIX("pix"), diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index 8a52f7c7fc3..3959c479914 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -1914,6 +1914,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + @SerializedName("pix") PIX("pix"), diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index d0142bd6677..6d36dc140b6 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -214,6 +214,20 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal payment + * method. + */ + @SerializedName("paypal") + Paypal paypal; + + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + @SerializedName("pix") + Pix pix; + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -293,6 +307,8 @@ private PaymentMethodCreateParams( P24 p24, String paymentMethod, Paynow paynow, + Paypal paypal, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -329,6 +345,8 @@ private PaymentMethodCreateParams( this.p24 = p24; this.paymentMethod = paymentMethod; this.paynow = paynow; + this.paypal = paypal; + this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; this.sepaDebit = sepaDebit; @@ -401,6 +419,10 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -447,6 +469,8 @@ public PaymentMethodCreateParams build() { this.p24, this.paymentMethod, this.paynow, + this.paypal, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -460,7 +484,7 @@ public PaymentMethodCreateParams build() { * If this is an {@code acss_debit} PaymentMethod, this hash contains details about the ACSS * Debit payment method. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(PaymentMethodCreateParams.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -469,7 +493,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is an {@code affirm} PaymentMethod, this hash contains details about the Affirm * payment method. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(PaymentMethodCreateParams.Affirm affirm) { this.affirm = affirm; return this; } @@ -478,7 +502,8 @@ public Builder setAffirm(Affirm affirm) { * If this is an {@code AfterpayClearpay} PaymentMethod, this hash contains details about the * AfterpayClearpay payment method. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + PaymentMethodCreateParams.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -487,7 +512,7 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If this is an {@code Alipay} PaymentMethod, this hash contains details about the Alipay * payment method. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(PaymentMethodCreateParams.Alipay alipay) { this.alipay = alipay; return this; } @@ -496,7 +521,7 @@ public Builder setAlipay(Alipay alipay) { * If this is an {@code au_becs_debit} PaymentMethod, this hash contains details about the bank * account. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit(PaymentMethodCreateParams.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -505,7 +530,7 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs * Direct Debit bank account. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(PaymentMethodCreateParams.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -514,7 +539,7 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this hash contains details about the * Bancontact payment method. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact(PaymentMethodCreateParams.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -523,7 +548,7 @@ public Builder setBancontact(Bancontact bancontact) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails(PaymentMethodCreateParams.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -532,7 +557,7 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(PaymentMethodCreateParams.Blik blik) { this.blik = blik; return this; } @@ -541,7 +566,7 @@ public Builder setBlik(Blik blik) { * If this is a {@code boleto} PaymentMethod, this hash contains details about the Boleto * payment method. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(PaymentMethodCreateParams.Boleto boleto) { this.boleto = boleto; return this; } @@ -554,7 +579,7 @@ public Builder setBoleto(Boleto boleto) { * href="https://stripe.com/docs/security#validating-pci-compliance">PCI compliance. We * strongly recommend using Stripe.js instead of interacting with this API directly. */ - public Builder setCard(CardDetails card) { + public Builder setCard(PaymentMethodCreateParams.CardDetails card) { this.card = card; return this; } @@ -567,7 +592,7 @@ public Builder setCard(CardDetails card) { * href="https://stripe.com/docs/security#validating-pci-compliance">PCI compliance. We * strongly recommend using Stripe.js instead of interacting with this API directly. */ - public Builder setCard(Token card) { + public Builder setCard(PaymentMethodCreateParams.Token card) { this.card = card; return this; } @@ -582,7 +607,7 @@ public Builder setCustomer(String customer) { * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance(PaymentMethodCreateParams.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -591,7 +616,7 @@ public Builder setCustomerBalance(CustomerBalance customerBalance) { * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment * method. */ - public Builder setEps(Eps eps) { + public Builder setEps(PaymentMethodCreateParams.Eps eps) { this.eps = eps; return this; } @@ -652,7 +677,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code fpx} PaymentMethod, this hash contains details about the FPX payment * method. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(PaymentMethodCreateParams.Fpx fpx) { this.fpx = fpx; return this; } @@ -661,7 +686,7 @@ public Builder setFpx(Fpx fpx) { * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(PaymentMethodCreateParams.Giropay giropay) { this.giropay = giropay; return this; } @@ -670,7 +695,7 @@ public Builder setGiropay(Giropay giropay) { * If this is a {@code grabpay} PaymentMethod, this hash contains details about the GrabPay * payment method. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(PaymentMethodCreateParams.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -679,7 +704,7 @@ public Builder setGrabpay(Grabpay grabpay) { * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL payment * method. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(PaymentMethodCreateParams.Ideal ideal) { this.ideal = ideal; return this; } @@ -688,7 +713,7 @@ public Builder setIdeal(Ideal ideal) { * If this is an {@code interac_present} PaymentMethod, this hash contains details about the * Interac Present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent(PaymentMethodCreateParams.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -697,7 +722,7 @@ public Builder setInteracPresent(InteracPresent interacPresent) { * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna * payment method. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(PaymentMethodCreateParams.Klarna klarna) { this.klarna = klarna; return this; } @@ -706,7 +731,7 @@ public Builder setKlarna(Klarna klarna) { * If this is a {@code konbini} PaymentMethod, this hash contains details about the Konbini * payment method. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(PaymentMethodCreateParams.Konbini konbini) { this.konbini = konbini; return this; } @@ -715,7 +740,7 @@ public Builder setKonbini(Konbini konbini) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(PaymentMethodCreateParams.Link link) { this.link = link; return this; } @@ -750,7 +775,7 @@ public Builder putAllMetadata(Map map) { * If this is an {@code oxxo} PaymentMethod, this hash contains details about the OXXO payment * method. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(PaymentMethodCreateParams.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -759,7 +784,7 @@ public Builder setOxxo(Oxxo oxxo) { * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment * method. */ - public Builder setP24(P24 p24) { + public Builder setP24(PaymentMethodCreateParams.P24 p24) { this.p24 = p24; return this; } @@ -774,16 +799,34 @@ public Builder setPaymentMethod(String paymentMethod) { * If this is a {@code paynow} PaymentMethod, this hash contains details about the PayNow * payment method. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(PaymentMethodCreateParams.Paynow paynow) { this.paynow = paynow; return this; } + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + public Builder setPaypal(PaymentMethodCreateParams.Paypal paypal) { + this.paypal = paypal; + return this; + } + + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + public Builder setPix(PaymentMethodCreateParams.Pix pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay(PaymentMethodCreateParams.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -792,7 +835,7 @@ public Builder setPromptpay(Promptpay promptpay) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions(PaymentMethodCreateParams.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -801,7 +844,7 @@ public Builder setRadarOptions(RadarOptions radarOptions) { * If this is a {@code sepa_debit} PaymentMethod, this hash contains details about the SEPA * debit bank account. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(PaymentMethodCreateParams.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -810,7 +853,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code sofort} PaymentMethod, this hash contains details about the SOFORT * payment method. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(PaymentMethodCreateParams.Sofort sofort) { this.sofort = sofort; return this; } @@ -820,7 +863,7 @@ public Builder setSofort(Sofort sofort) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(PaymentMethodCreateParams.Type type) { this.type = type; return this; } @@ -829,7 +872,7 @@ public Builder setType(Type type) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount(PaymentMethodCreateParams.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -838,7 +881,7 @@ public Builder setUsBankAccount(UsBankAccount usBankAccount) { * If this is an {@code wechat_pay} PaymentMethod, this hash contains details about the * wechat_pay payment method. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay(PaymentMethodCreateParams.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -892,8 +935,8 @@ public static class Builder { private String transitNumber; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public PaymentMethodCreateParams.AcssDebit build() { + return new PaymentMethodCreateParams.AcssDebit( this.accountNumber, this.extraParams, this.institutionNumber, this.transitNumber); } @@ -966,8 +1009,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public PaymentMethodCreateParams.Affirm build() { + return new PaymentMethodCreateParams.Affirm(this.extraParams); } /** @@ -1021,8 +1064,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams); + public PaymentMethodCreateParams.AfterpayClearpay build() { + return new PaymentMethodCreateParams.AfterpayClearpay(this.extraParams); } /** @@ -1077,8 +1120,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams); + public PaymentMethodCreateParams.Alipay build() { + return new PaymentMethodCreateParams.Alipay(this.extraParams); } /** @@ -1146,8 +1189,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.accountNumber, this.bsbNumber, this.extraParams); + public PaymentMethodCreateParams.AuBecsDebit build() { + return new PaymentMethodCreateParams.AuBecsDebit( + this.accountNumber, this.bsbNumber, this.extraParams); } /** The account number for the bank account. */ @@ -1227,8 +1271,9 @@ public static class Builder { private String sortCode; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.accountNumber, this.extraParams, this.sortCode); + public PaymentMethodCreateParams.BacsDebit build() { + return new PaymentMethodCreateParams.BacsDebit( + this.accountNumber, this.extraParams, this.sortCode); } /** Account number of the bank account that the funds will be debited from. */ @@ -1294,8 +1339,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams); + public PaymentMethodCreateParams.Bancontact build() { + return new PaymentMethodCreateParams.Bancontact(this.extraParams); } /** @@ -1378,13 +1423,13 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public PaymentMethodCreateParams.BillingDetails build() { + return new PaymentMethodCreateParams.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress(PaymentMethodCreateParams.BillingDetails.Address address) { this.address = address; return this; } @@ -1522,8 +1567,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public PaymentMethodCreateParams.BillingDetails.Address build() { + return new PaymentMethodCreateParams.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -1626,8 +1671,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public PaymentMethodCreateParams.Blik build() { + return new PaymentMethodCreateParams.Blik(this.extraParams); } /** @@ -1690,8 +1735,8 @@ public static class Builder { private String taxId; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.extraParams, this.taxId); + public PaymentMethodCreateParams.Boleto build() { + return new PaymentMethodCreateParams.Boleto(this.extraParams, this.taxId); } /** @@ -1782,8 +1827,8 @@ public static class Builder { private String number; /** Finalize and obtain parameter instance from this builder. */ - public CardDetails build() { - return new CardDetails( + public PaymentMethodCreateParams.CardDetails build() { + return new PaymentMethodCreateParams.CardDetails( this.cvc, this.expMonth, this.expYear, this.extraParams, this.number); } @@ -1862,8 +1907,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.extraParams); + public PaymentMethodCreateParams.CustomerBalance build() { + return new PaymentMethodCreateParams.CustomerBalance(this.extraParams); } /** @@ -1925,12 +1970,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.bank, this.extraParams); + public PaymentMethodCreateParams.Eps build() { + return new PaymentMethodCreateParams.Eps(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentMethodCreateParams.Eps.Bank bank) { this.bank = bank; return this; } @@ -1993,6 +2038,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("capital_bank_grawe_gruppe_ag") CAPITAL_BANK_GRAWE_GRUPPE_AG("capital_bank_grawe_gruppe_ag"), + @SerializedName("deutsche_bank_ag") + DEUTSCHE_BANK_AG("deutsche_bank_ag"), + @SerializedName("dolomitenbank") DOLOMITENBANK("dolomitenbank"), @@ -2090,18 +2138,20 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.accountHolderType, this.bank, this.extraParams); + public PaymentMethodCreateParams.Fpx build() { + return new PaymentMethodCreateParams.Fpx( + this.accountHolderType, this.bank, this.extraParams); } /** Account holder type for FPX transaction. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + PaymentMethodCreateParams.Fpx.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentMethodCreateParams.Fpx.Bank bank) { this.bank = bank; return this; } @@ -2244,8 +2294,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams); + public PaymentMethodCreateParams.Giropay build() { + return new PaymentMethodCreateParams.Giropay(this.extraParams); } /** @@ -2299,8 +2349,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams); + public PaymentMethodCreateParams.Grabpay build() { + return new PaymentMethodCreateParams.Grabpay(this.extraParams); } /** @@ -2361,12 +2411,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.bank, this.extraParams); + public PaymentMethodCreateParams.Ideal build() { + return new PaymentMethodCreateParams.Ideal(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentMethodCreateParams.Ideal.Bank bank) { this.bank = bank; return this; } @@ -2470,8 +2520,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public PaymentMethodCreateParams.InteracPresent build() { + return new PaymentMethodCreateParams.InteracPresent(this.extraParams); } /** @@ -2533,12 +2583,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.dob, this.extraParams); + public PaymentMethodCreateParams.Klarna build() { + return new PaymentMethodCreateParams.Klarna(this.dob, this.extraParams); } /** Customer's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(PaymentMethodCreateParams.Klarna.Dob dob) { this.dob = dob; return this; } @@ -2614,8 +2664,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public PaymentMethodCreateParams.Klarna.Dob build() { + return new PaymentMethodCreateParams.Klarna.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -2690,8 +2741,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public PaymentMethodCreateParams.Konbini build() { + return new PaymentMethodCreateParams.Konbini(this.extraParams); } /** @@ -2745,8 +2796,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public PaymentMethodCreateParams.Link build() { + return new PaymentMethodCreateParams.Link(this.extraParams); } /** @@ -2800,8 +2851,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.extraParams); + public PaymentMethodCreateParams.Oxxo build() { + return new PaymentMethodCreateParams.Oxxo(this.extraParams); } /** @@ -2862,12 +2913,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.bank, this.extraParams); + public PaymentMethodCreateParams.P24 build() { + return new PaymentMethodCreateParams.P24(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(PaymentMethodCreateParams.P24.Bank bank) { this.bank = bank; return this; } @@ -3007,8 +3058,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams); + public PaymentMethodCreateParams.Paynow build() { + return new PaymentMethodCreateParams.Paynow(this.extraParams); } /** @@ -3039,6 +3090,116 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Paypal { + /** + * 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 Paypal(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodCreateParams.Paypal build() { + return new PaymentMethodCreateParams.Paypal(this.extraParams); + } + + /** + * 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.Paypal#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.Paypal#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 + public static class Pix { + /** + * 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 Pix(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodCreateParams.Pix build() { + return new PaymentMethodCreateParams.Pix(this.extraParams); + } + + /** + * 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.Pix#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.Pix#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 public static class Promptpay { /** @@ -3062,8 +3223,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams); + public PaymentMethodCreateParams.Promptpay build() { + return new PaymentMethodCreateParams.Promptpay(this.extraParams); } /** @@ -3128,8 +3289,8 @@ public static class Builder { private String session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public PaymentMethodCreateParams.RadarOptions build() { + return new PaymentMethodCreateParams.RadarOptions(this.extraParams, this.session); } /** @@ -3200,8 +3361,8 @@ public static class Builder { private String iban; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.iban); + public PaymentMethodCreateParams.SepaDebit build() { + return new PaymentMethodCreateParams.SepaDebit(this.extraParams, this.iban); } /** @@ -3268,12 +3429,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.country, this.extraParams); + public PaymentMethodCreateParams.Sofort build() { + return new PaymentMethodCreateParams.Sofort(this.country, this.extraParams); } /** Two-letter ISO code representing the country the bank account is located in. */ - public Builder setCountry(Country country) { + public Builder setCountry(PaymentMethodCreateParams.Sofort.Country country) { this.country = country; return this; } @@ -3362,8 +3523,8 @@ public static class Builder { private String token; /** Finalize and obtain parameter instance from this builder. */ - public Token build() { - return new Token(this.extraParams, this.token); + public PaymentMethodCreateParams.Token build() { + return new PaymentMethodCreateParams.Token(this.extraParams, this.token); } /** @@ -3463,8 +3624,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public PaymentMethodCreateParams.UsBankAccount build() { + return new PaymentMethodCreateParams.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -3474,7 +3635,8 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + PaymentMethodCreateParams.UsBankAccount.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -3486,7 +3648,8 @@ public Builder setAccountNumber(String accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + PaymentMethodCreateParams.UsBankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -3585,8 +3748,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.extraParams); + public PaymentMethodCreateParams.WechatPay build() { + return new PaymentMethodCreateParams.WechatPay(this.extraParams); } /** @@ -3684,6 +3847,12 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), diff --git a/src/main/java/com/stripe/param/PaymentMethodListParams.java b/src/main/java/com/stripe/param/PaymentMethodListParams.java index 5b3acbd21d3..826fcd30f24 100644 --- a/src/main/java/com/stripe/param/PaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodListParams.java @@ -271,6 +271,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + @SerializedName("pix") PIX("pix"), diff --git a/src/main/java/com/stripe/param/PriceUpdateParams.java b/src/main/java/com/stripe/param/PriceUpdateParams.java index a2525010daa..5e32af67b13 100644 --- a/src/main/java/com/stripe/param/PriceUpdateParams.java +++ b/src/main/java/com/stripe/param/PriceUpdateParams.java @@ -329,7 +329,7 @@ public Builder setMetadata(Map metadata) { /** * If specified, subscriptions using this price will be updated to use the new referenced price. */ - public Builder setMigrateTo(MigrateTo migrateTo) { + public Builder setMigrateTo(PriceUpdateParams.MigrateTo migrateTo) { this.migrateTo = migrateTo; return this; } @@ -975,15 +975,16 @@ public static class Builder { private Object price; /** Finalize and obtain parameter instance from this builder. */ - public MigrateTo build() { - return new MigrateTo(this.behavior, this.effectiveAfter, this.extraParams, this.price); + public PriceUpdateParams.MigrateTo build() { + return new PriceUpdateParams.MigrateTo( + this.behavior, this.effectiveAfter, this.extraParams, this.price); } /** * The behavior controlling the point in the subscription lifecycle after which to migrate the * price. Currently must be {@code at_cycle_end}. */ - public Builder setBehavior(Behavior behavior) { + public Builder setBehavior(PriceUpdateParams.MigrateTo.Behavior behavior) { this.behavior = behavior; return this; } diff --git a/src/main/java/com/stripe/param/ProductCreateParams.java b/src/main/java/com/stripe/param/ProductCreateParams.java index f8825a6fdc6..f45407b28a1 100644 --- a/src/main/java/com/stripe/param/ProductCreateParams.java +++ b/src/main/java/com/stripe/param/ProductCreateParams.java @@ -460,7 +460,7 @@ public Builder setPackageDimensions(ProductCreateParams.PackageDimensions packag } /** Provisioning configuration for this product. */ - public Builder setProvisioning(Provisioning provisioning) { + public Builder setProvisioning(ProductCreateParams.Provisioning provisioning) { this.provisioning = provisioning; return this; } @@ -1534,8 +1534,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Provisioning build() { - return new Provisioning(this.extraParams, this.giftCard, this.type); + public ProductCreateParams.Provisioning build() { + return new ProductCreateParams.Provisioning(this.extraParams, this.giftCard, this.type); } /** @@ -1564,13 +1564,13 @@ public Builder putAllExtraParam(Map map) { return this; } - public Builder setGiftCard(GiftCard giftCard) { + public Builder setGiftCard(ProductCreateParams.Provisioning.GiftCard giftCard) { this.giftCard = giftCard; return this; } /** The type of provisioning, only {@code gift_card} currently supported. */ - public Builder setType(Type type) { + public Builder setType(ProductCreateParams.Provisioning.Type type) { this.type = type; return this; } @@ -1614,8 +1614,9 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public GiftCard build() { - return new GiftCard(this.extraParams, this.fixedAmount, this.type); + public ProductCreateParams.Provisioning.GiftCard build() { + return new ProductCreateParams.Provisioning.GiftCard( + this.extraParams, this.fixedAmount, this.type); } /** @@ -1646,7 +1647,8 @@ public Builder putAllExtraParam(Map map) { return this; } - public Builder setFixedAmount(FixedAmount fixedAmount) { + public Builder setFixedAmount( + ProductCreateParams.Provisioning.GiftCard.FixedAmount fixedAmount) { this.fixedAmount = fixedAmount; return this; } @@ -1655,7 +1657,7 @@ public Builder setFixedAmount(FixedAmount fixedAmount) { * The specific type of gift_card provisioning, only {@code fixed_amount} currently * supported. */ - public Builder setType(Type type) { + public Builder setType(ProductCreateParams.Provisioning.GiftCard.Type type) { this.type = type; return this; } @@ -1698,8 +1700,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public FixedAmount build() { - return new FixedAmount(this.amount, this.currency, this.extraParams); + public ProductCreateParams.Provisioning.GiftCard.FixedAmount build() { + return new ProductCreateParams.Provisioning.GiftCard.FixedAmount( + this.amount, this.currency, this.extraParams); } /** The initial amount with which the provisioned gift card will be created. */ diff --git a/src/main/java/com/stripe/param/QuoteCreateParams.java b/src/main/java/com/stripe/param/QuoteCreateParams.java index f58a676b2d8..81e59fe8bea 100644 --- a/src/main/java/com/stripe/param/QuoteCreateParams.java +++ b/src/main/java/com/stripe/param/QuoteCreateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; import java.util.ArrayList; @@ -123,7 +122,7 @@ public class QuoteCreateParams extends ApiRequestParams { * about the product, the quantity, and the resulting cost. */ @SerializedName("line_items") - List lineItems; + List lineItems; /** * Set of key-value pairs that you can attach @@ -143,7 +142,7 @@ public class QuoteCreateParams extends ApiRequestParams { * durations, prices, and coupons. */ @SerializedName("phases") - List phases; + List phases; /** * When creating a subscription or subscription schedule, the specified configuration data will be @@ -179,10 +178,10 @@ private QuoteCreateParams( FromQuote fromQuote, String header, InvoiceSettings invoiceSettings, - List lineItems, + List lineItems, Map metadata, Object onBehalfOf, - List phases, + List phases, SubscriptionData subscriptionData, String testClock, Object transferData) { @@ -245,13 +244,13 @@ public static class Builder { private InvoiceSettings invoiceSettings; - private List lineItems; + private List lineItems; private Map metadata; private Object onBehalfOf; - private List phases; + private List phases; private SubscriptionData subscriptionData; @@ -331,7 +330,7 @@ public Builder setApplicationFeePercent(EmptyParam applicationFeePercent) { /** * Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(QuoteCreateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -343,7 +342,7 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * sending an invoice, Stripe will email your customer an invoice with payment instructions. * Defaults to {@code charge_automatically}. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(QuoteCreateParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -414,7 +413,7 @@ public Builder setDescription(String description) { * QuoteCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(QuoteCreateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -428,7 +427,7 @@ public Builder addDiscount(Discount element) { * QuoteCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -443,7 +442,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The discounts applied to the quote. You can only set up to one discount. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -526,7 +525,7 @@ public Builder setFooter(String footer) { * Clone an existing quote. The new quote will be created in {@code status=draft}. When using * this parameter, you cannot specify any other parameters except for {@code expires_at}. */ - public Builder setFromQuote(FromQuote fromQuote) { + public Builder setFromQuote(QuoteCreateParams.FromQuote fromQuote) { this.fromQuote = fromQuote; return this; } @@ -542,7 +541,7 @@ public Builder setHeader(String header) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings(QuoteCreateParams.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -552,7 +551,7 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * and subsequent calls adds additional elements to the original list. See {@link * QuoteCreateParams#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(QuoteCreateParams.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -565,7 +564,7 @@ public Builder addLineItem(LineItem element) { * and subsequent calls adds additional elements to the original list. See {@link * QuoteCreateParams#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -616,7 +615,7 @@ public Builder setOnBehalfOf(EmptyParam onBehalfOf) { * subsequent calls adds additional elements to the original list. See {@link * QuoteCreateParams#phases} for the field documentation. */ - public Builder addPhase(Phase element) { + public Builder addPhase(QuoteCreateParams.Phase element) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -629,7 +628,7 @@ public Builder addPhase(Phase element) { * subsequent calls adds additional elements to the original list. See {@link * QuoteCreateParams#phases} for the field documentation. */ - public Builder addAllPhase(List elements) { + public Builder addAllPhase(List elements) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -644,7 +643,7 @@ public Builder addAllPhase(List elements) { * subscription_data[effective_date]} is present and in the future, otherwise a subscription is * created. */ - public Builder setSubscriptionData(SubscriptionData subscriptionData) { + public Builder setSubscriptionData(QuoteCreateParams.SubscriptionData subscriptionData) { this.subscriptionData = subscriptionData; return this; } @@ -656,7 +655,7 @@ public Builder setTestClock(String testClock) { } /** The data with which to automatically create a Transfer for each of the invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(QuoteCreateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -701,8 +700,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public QuoteCreateParams.AutomaticTax build() { + return new QuoteCreateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -779,8 +778,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public QuoteCreateParams.Discount build() { + return new QuoteCreateParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -860,8 +859,8 @@ public static class Builder { private String quote; /** Finalize and obtain parameter instance from this builder. */ - public FromQuote build() { - return new FromQuote(this.extraParams, this.isRevision, this.quote); + public QuoteCreateParams.FromQuote build() { + return new QuoteCreateParams.FromQuote(this.extraParams, this.isRevision, this.quote); } /** @@ -937,8 +936,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public QuoteCreateParams.InvoiceSettings build() { + return new QuoteCreateParams.InvoiceSettings(this.daysUntilDue, this.extraParams); } /** @@ -1048,8 +1047,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem( + public QuoteCreateParams.LineItem build() { + return new QuoteCreateParams.LineItem( this.discounts, this.extraParams, this.price, @@ -1064,7 +1063,7 @@ public LineItem build() { * QuoteCreateParams.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(QuoteCreateParams.LineItem.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1078,7 +1077,7 @@ public Builder addDiscount(Discount element) { * QuoteCreateParams.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1093,7 +1092,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The discounts applied to this line item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -1134,7 +1133,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. One of {@code price} or {@code price_data} is required. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(QuoteCreateParams.LineItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1229,8 +1228,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public QuoteCreateParams.LineItem.Discount build() { + return new QuoteCreateParams.LineItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1364,8 +1364,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public QuoteCreateParams.LineItem.PriceData build() { + return new QuoteCreateParams.LineItem.PriceData( this.currency, this.extraParams, this.product, @@ -1422,7 +1422,7 @@ public Builder setProduct(String product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(QuoteCreateParams.LineItem.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -1432,7 +1432,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + QuoteCreateParams.LineItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -1502,8 +1503,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public QuoteCreateParams.LineItem.PriceData.Recurring build() { + return new QuoteCreateParams.LineItem.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -1538,7 +1540,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + QuoteCreateParams.LineItem.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -1667,7 +1670,7 @@ public static class Phase { * includes information about the product, the quantity, and the resulting cost. */ @SerializedName("line_items") - List lineItems; + List lineItems; /** * If the update changes the current phase, indicates whether the changes should be prorated. @@ -1699,7 +1702,7 @@ private Phase( Map extraParams, InvoiceSettings invoiceSettings, Long iterations, - List lineItems, + List lineItems, ProrationBehavior prorationBehavior, Boolean trial, Long trialEnd) { @@ -1738,7 +1741,7 @@ public static class Builder { private Long iterations; - private List lineItems; + private List lineItems; private ProrationBehavior prorationBehavior; @@ -1747,8 +1750,8 @@ public static class Builder { private Long trialEnd; /** Finalize and obtain parameter instance from this builder. */ - public Phase build() { - return new Phase( + public QuoteCreateParams.Phase build() { + return new QuoteCreateParams.Phase( this.billingCycleAnchor, this.collectionMethod, this.defaultTaxRates, @@ -1767,7 +1770,8 @@ public Phase build() { * When specified as {@code reset}, the subscription will always start a new billing period * when the quote is accepted. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + QuoteCreateParams.Phase.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -1779,7 +1783,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * email your customer an invoice with payment instructions. Defaults to {@code * charge_automatically} on creation. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod( + QuoteCreateParams.Phase.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -1844,7 +1849,7 @@ public Builder setDefaultTaxRates(List defaultTaxRates) { * QuoteCreateParams.Phase#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(QuoteCreateParams.Phase.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1858,7 +1863,7 @@ public Builder addDiscount(Discount element) { * QuoteCreateParams.Phase#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1881,7 +1886,7 @@ public Builder setDiscounts(EmptyParam discounts) { * discount from the subscription's customer. Pass an empty string to avoid inheriting any * discounts. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -1921,7 +1926,7 @@ public Builder putAllExtraParam(Map map) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings(QuoteCreateParams.Phase.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -1942,7 +1947,7 @@ public Builder setIterations(Long iterations) { * and subsequent calls adds additional elements to the original list. See {@link * QuoteCreateParams.Phase#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(QuoteCreateParams.Phase.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -1955,7 +1960,7 @@ public Builder addLineItem(LineItem element) { * call, and subsequent calls adds additional elements to the original list. See {@link * QuoteCreateParams.Phase#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -1967,7 +1972,8 @@ public Builder addAllLineItem(List elements) { * If the update changes the current phase, indicates whether the changes should be prorated. * The default value is {@code create_prorations}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + QuoteCreateParams.Phase.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -2028,8 +2034,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public QuoteCreateParams.Phase.Discount build() { + return new QuoteCreateParams.Phase.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2108,8 +2114,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public QuoteCreateParams.Phase.InvoiceSettings build() { + return new QuoteCreateParams.Phase.InvoiceSettings(this.daysUntilDue, this.extraParams); } /** @@ -2222,8 +2228,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem( + public QuoteCreateParams.Phase.LineItem build() { + return new QuoteCreateParams.Phase.LineItem( this.discounts, this.extraParams, this.price, @@ -2238,7 +2244,7 @@ public LineItem build() { * QuoteCreateParams.Phase.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(QuoteCreateParams.Phase.LineItem.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2252,7 +2258,7 @@ public Builder addDiscount(Discount element) { * QuoteCreateParams.Phase.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2267,7 +2273,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The discounts applied to this line item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -2310,7 +2316,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. One of {@code price} or {@code price_data} is required. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(QuoteCreateParams.Phase.LineItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -2406,8 +2412,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public QuoteCreateParams.Phase.LineItem.Discount build() { + return new QuoteCreateParams.Phase.LineItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2542,8 +2549,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public QuoteCreateParams.Phase.LineItem.PriceData build() { + return new QuoteCreateParams.Phase.LineItem.PriceData( this.currency, this.extraParams, this.product, @@ -2601,7 +2608,8 @@ public Builder setProduct(String product) { * The recurring components of a price such as {@code interval} and {@code * interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring( + QuoteCreateParams.Phase.LineItem.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -2611,7 +2619,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as * either {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + QuoteCreateParams.Phase.LineItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2682,8 +2691,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public QuoteCreateParams.Phase.LineItem.PriceData.Recurring build() { + return new QuoteCreateParams.Phase.LineItem.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -2720,7 +2730,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or * {@code year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + QuoteCreateParams.Phase.LineItem.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -2841,7 +2852,14 @@ public static class SubscriptionData { * the quote is accepted. */ @SerializedName("billing_cycle_anchor") - EnumParam billingCycleAnchor; + ApiRequestParams.EnumParam billingCycleAnchor; + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; /** * When creating a new subscription, the date of which the subscription schedule will start @@ -2921,7 +2939,8 @@ public static class SubscriptionData { private SubscriptionData( BillingBehavior billingBehavior, - EnumParam billingCycleAnchor, + ApiRequestParams.EnumParam billingCycleAnchor, + String description, Object effectiveDate, EndBehavior endBehavior, Map extraParams, @@ -2932,6 +2951,7 @@ private SubscriptionData( Object trialPeriodDays) { this.billingBehavior = billingBehavior; this.billingCycleAnchor = billingCycleAnchor; + this.description = description; this.effectiveDate = effectiveDate; this.endBehavior = endBehavior; this.extraParams = extraParams; @@ -2949,7 +2969,9 @@ public static Builder builder() { public static class Builder { private BillingBehavior billingBehavior; - private EnumParam billingCycleAnchor; + private ApiRequestParams.EnumParam billingCycleAnchor; + + private String description; private Object effectiveDate; @@ -2968,10 +2990,11 @@ public static class Builder { private Object trialPeriodDays; /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionData build() { - return new SubscriptionData( + public QuoteCreateParams.SubscriptionData build() { + return new QuoteCreateParams.SubscriptionData( this.billingBehavior, this.billingCycleAnchor, + this.description, this.effectiveDate, this.endBehavior, this.extraParams, @@ -2989,7 +3012,8 @@ public SubscriptionData build() { * changes and generate prorations at transition time.{@code prorate_up_front} will bill for * all phases within the current billing cycle up front. */ - public Builder setBillingBehavior(BillingBehavior billingBehavior) { + public Builder setBillingBehavior( + QuoteCreateParams.SubscriptionData.BillingBehavior billingBehavior) { this.billingBehavior = billingBehavior; return this; } @@ -2998,7 +3022,8 @@ public Builder setBillingBehavior(BillingBehavior billingBehavior) { * When specified as {@code reset}, the subscription will always start a new billing period * when the quote is accepted. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + QuoteCreateParams.SubscriptionData.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -3012,6 +3037,15 @@ public Builder setBillingCycleAnchor(EmptyParam billingCycleAnchor) { return this; } + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + /** * When creating a new subscription, the date of which the subscription schedule will start * after the quote is accepted. When updating a subscription, the date of which the @@ -3020,7 +3054,8 @@ public Builder setBillingCycleAnchor(EmptyParam billingCycleAnchor) { * period. The {@code effective_date} is ignored if it is in the past when the quote is * accepted. */ - public Builder setEffectiveDate(EffectiveDate effectiveDate) { + public Builder setEffectiveDate( + QuoteCreateParams.SubscriptionData.EffectiveDate effectiveDate) { this.effectiveDate = effectiveDate; return this; } @@ -3057,7 +3092,7 @@ public Builder setEffectiveDate(EmptyParam effectiveDate) { * the subscription schedule and keep the underlying subscription running.{@code cancel} will * end the subscription schedule and cancel the underlying subscription. */ - public Builder setEndBehavior(EndBehavior endBehavior) { + public Builder setEndBehavior(QuoteCreateParams.SubscriptionData.EndBehavior endBehavior) { this.endBehavior = endBehavior; return this; } @@ -3112,7 +3147,7 @@ public Builder setFromSubscription(String fromSubscription) { * If specified, the invoicing for the given billing cycle iterations will be processed when * the quote is accepted. Cannot be used with {@code effective_date}. */ - public Builder setPrebilling(Prebilling prebilling) { + public Builder setPrebilling(QuoteCreateParams.SubscriptionData.Prebilling prebilling) { this.prebilling = prebilling; return this; } @@ -3142,7 +3177,8 @@ public Builder setPrebilling(EmptyParam prebilling) { * *

Prorations can be disabled by passing {@code none}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + QuoteCreateParams.SubscriptionData.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -3196,8 +3232,9 @@ public static class Builder { private Long iterations; /** Finalize and obtain parameter instance from this builder. */ - public Prebilling build() { - return new Prebilling(this.extraParams, this.iterations); + public QuoteCreateParams.SubscriptionData.Prebilling build() { + return new QuoteCreateParams.SubscriptionData.Prebilling( + this.extraParams, this.iterations); } /** @@ -3366,8 +3403,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData( + public QuoteCreateParams.TransferData build() { + return new QuoteCreateParams.TransferData( this.amount, this.amountPercent, this.destination, this.extraParams); } diff --git a/src/main/java/com/stripe/param/QuoteUpdateParams.java b/src/main/java/com/stripe/param/QuoteUpdateParams.java index 30176a14ef0..165bdfa4873 100644 --- a/src/main/java/com/stripe/param/QuoteUpdateParams.java +++ b/src/main/java/com/stripe/param/QuoteUpdateParams.java @@ -3,7 +3,6 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiRequestParams.EnumParam; import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; import java.util.ArrayList; @@ -101,7 +100,7 @@ public class QuoteUpdateParams extends ApiRequestParams { * about the product, the quantity, and the resulting cost. */ @SerializedName("line_items") - List lineItems; + List lineItems; /** * Set of key-value pairs that you can attach @@ -121,7 +120,7 @@ public class QuoteUpdateParams extends ApiRequestParams { * durations, prices, and coupons. */ @SerializedName("phases") - List phases; + List phases; /** * When creating a subscription or subscription schedule, the specified configuration data will be @@ -152,10 +151,10 @@ private QuoteUpdateParams( Object footer, Object header, InvoiceSettings invoiceSettings, - List lineItems, + List lineItems, Map metadata, Object onBehalfOf, - List phases, + List phases, SubscriptionData subscriptionData, Object transferData) { this.applicationFeeAmount = applicationFeeAmount; @@ -213,13 +212,13 @@ public static class Builder { private InvoiceSettings invoiceSettings; - private List lineItems; + private List lineItems; private Map metadata; private Object onBehalfOf; - private List phases; + private List phases; private SubscriptionData subscriptionData; @@ -295,7 +294,7 @@ public Builder setApplicationFeePercent(EmptyParam applicationFeePercent) { /** * Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(QuoteUpdateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -307,7 +306,7 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * sending an invoice, Stripe will email your customer an invoice with payment instructions. * Defaults to {@code charge_automatically}. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(QuoteUpdateParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -388,7 +387,7 @@ public Builder setDescription(EmptyParam description) { * QuoteUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(QuoteUpdateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -402,7 +401,7 @@ public Builder addDiscount(Discount element) { * QuoteUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -417,7 +416,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The discounts applied to the quote. You can only set up to one discount. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -508,7 +507,7 @@ public Builder setHeader(EmptyParam header) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings(QuoteUpdateParams.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -518,7 +517,7 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * and subsequent calls adds additional elements to the original list. See {@link * QuoteUpdateParams#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(QuoteUpdateParams.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -531,7 +530,7 @@ public Builder addLineItem(LineItem element) { * and subsequent calls adds additional elements to the original list. See {@link * QuoteUpdateParams#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -582,7 +581,7 @@ public Builder setOnBehalfOf(EmptyParam onBehalfOf) { * subsequent calls adds additional elements to the original list. See {@link * QuoteUpdateParams#phases} for the field documentation. */ - public Builder addPhase(Phase element) { + public Builder addPhase(QuoteUpdateParams.Phase element) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -595,7 +594,7 @@ public Builder addPhase(Phase element) { * subsequent calls adds additional elements to the original list. See {@link * QuoteUpdateParams#phases} for the field documentation. */ - public Builder addAllPhase(List elements) { + public Builder addAllPhase(List elements) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -610,13 +609,13 @@ public Builder addAllPhase(List elements) { * subscription_data[effective_date]} is present and in the future, otherwise a subscription is * created. */ - public Builder setSubscriptionData(SubscriptionData subscriptionData) { + public Builder setSubscriptionData(QuoteUpdateParams.SubscriptionData subscriptionData) { this.subscriptionData = subscriptionData; return this; } /** The data with which to automatically create a Transfer for each of the invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(QuoteUpdateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -661,8 +660,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public QuoteUpdateParams.AutomaticTax build() { + return new QuoteUpdateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -739,8 +738,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public QuoteUpdateParams.Discount build() { + return new QuoteUpdateParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -828,8 +827,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public QuoteUpdateParams.InvoiceSettings build() { + return new QuoteUpdateParams.InvoiceSettings(this.daysUntilDue, this.extraParams); } /** @@ -947,8 +946,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem( + public QuoteUpdateParams.LineItem build() { + return new QuoteUpdateParams.LineItem( this.discounts, this.extraParams, this.id, @@ -964,7 +963,7 @@ public LineItem build() { * QuoteUpdateParams.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(QuoteUpdateParams.LineItem.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -978,7 +977,7 @@ public Builder addDiscount(Discount element) { * QuoteUpdateParams.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -993,7 +992,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The discounts applied to this line item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -1052,7 +1051,7 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. One of {@code price} or {@code price_data} is required. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(QuoteUpdateParams.LineItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1147,8 +1146,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public QuoteUpdateParams.LineItem.Discount build() { + return new QuoteUpdateParams.LineItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1294,8 +1294,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public QuoteUpdateParams.LineItem.PriceData build() { + return new QuoteUpdateParams.LineItem.PriceData( this.currency, this.extraParams, this.product, @@ -1368,7 +1368,7 @@ public Builder setProduct(EmptyParam product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(QuoteUpdateParams.LineItem.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -1378,7 +1378,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + QuoteUpdateParams.LineItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -1458,8 +1459,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public QuoteUpdateParams.LineItem.PriceData.Recurring build() { + return new QuoteUpdateParams.LineItem.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -1494,7 +1496,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + QuoteUpdateParams.LineItem.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -1623,7 +1626,7 @@ public static class Phase { * includes information about the product, the quantity, and the resulting cost. */ @SerializedName("line_items") - List lineItems; + List lineItems; /** * If the update changes the current phase, indicates whether the changes should be prorated. @@ -1655,7 +1658,7 @@ private Phase( Map extraParams, InvoiceSettings invoiceSettings, Long iterations, - List lineItems, + List lineItems, ProrationBehavior prorationBehavior, Boolean trial, Long trialEnd) { @@ -1694,7 +1697,7 @@ public static class Builder { private Long iterations; - private List lineItems; + private List lineItems; private ProrationBehavior prorationBehavior; @@ -1703,8 +1706,8 @@ public static class Builder { private Long trialEnd; /** Finalize and obtain parameter instance from this builder. */ - public Phase build() { - return new Phase( + public QuoteUpdateParams.Phase build() { + return new QuoteUpdateParams.Phase( this.billingCycleAnchor, this.collectionMethod, this.defaultTaxRates, @@ -1723,7 +1726,8 @@ public Phase build() { * When specified as {@code reset}, the subscription will always start a new billing period * when the quote is accepted. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + QuoteUpdateParams.Phase.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -1735,7 +1739,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * email your customer an invoice with payment instructions. Defaults to {@code * charge_automatically} on creation. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod( + QuoteUpdateParams.Phase.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -1800,7 +1805,7 @@ public Builder setDefaultTaxRates(List defaultTaxRates) { * QuoteUpdateParams.Phase#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(QuoteUpdateParams.Phase.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1814,7 +1819,7 @@ public Builder addDiscount(Discount element) { * QuoteUpdateParams.Phase#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1837,7 +1842,7 @@ public Builder setDiscounts(EmptyParam discounts) { * discount from the subscription's customer. Pass an empty string to avoid inheriting any * discounts. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -1877,7 +1882,7 @@ public Builder putAllExtraParam(Map map) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings(QuoteUpdateParams.Phase.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -1898,7 +1903,7 @@ public Builder setIterations(Long iterations) { * and subsequent calls adds additional elements to the original list. See {@link * QuoteUpdateParams.Phase#lineItems} for the field documentation. */ - public Builder addLineItem(LineItem element) { + public Builder addLineItem(QuoteUpdateParams.Phase.LineItem element) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -1911,7 +1916,7 @@ public Builder addLineItem(LineItem element) { * call, and subsequent calls adds additional elements to the original list. See {@link * QuoteUpdateParams.Phase#lineItems} for the field documentation. */ - public Builder addAllLineItem(List elements) { + public Builder addAllLineItem(List elements) { if (this.lineItems == null) { this.lineItems = new ArrayList<>(); } @@ -1923,7 +1928,8 @@ public Builder addAllLineItem(List elements) { * If the update changes the current phase, indicates whether the changes should be prorated. * The default value is {@code create_prorations}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + QuoteUpdateParams.Phase.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -1984,8 +1990,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public QuoteUpdateParams.Phase.Discount build() { + return new QuoteUpdateParams.Phase.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2076,8 +2082,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public QuoteUpdateParams.Phase.InvoiceSettings build() { + return new QuoteUpdateParams.Phase.InvoiceSettings(this.daysUntilDue, this.extraParams); } /** @@ -2190,8 +2196,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public LineItem build() { - return new LineItem( + public QuoteUpdateParams.Phase.LineItem build() { + return new QuoteUpdateParams.Phase.LineItem( this.discounts, this.extraParams, this.price, @@ -2206,7 +2212,7 @@ public LineItem build() { * QuoteUpdateParams.Phase.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(QuoteUpdateParams.Phase.LineItem.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2220,7 +2226,7 @@ public Builder addDiscount(Discount element) { * QuoteUpdateParams.Phase.LineItem#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2235,7 +2241,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The discounts applied to this line item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -2284,7 +2290,7 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. One of {@code price} or {@code price_data} is required. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(QuoteUpdateParams.Phase.LineItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -2380,8 +2386,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public QuoteUpdateParams.Phase.LineItem.Discount build() { + return new QuoteUpdateParams.Phase.LineItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2528,8 +2535,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public QuoteUpdateParams.Phase.LineItem.PriceData build() { + return new QuoteUpdateParams.Phase.LineItem.PriceData( this.currency, this.extraParams, this.product, @@ -2603,7 +2610,8 @@ public Builder setProduct(EmptyParam product) { * The recurring components of a price such as {@code interval} and {@code * interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring( + QuoteUpdateParams.Phase.LineItem.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -2613,7 +2621,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as * either {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + QuoteUpdateParams.Phase.LineItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2694,8 +2703,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public QuoteUpdateParams.Phase.LineItem.PriceData.Recurring build() { + return new QuoteUpdateParams.Phase.LineItem.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -2732,7 +2742,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or * {@code year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + QuoteUpdateParams.Phase.LineItem.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -2853,7 +2864,14 @@ public static class SubscriptionData { * the quote is accepted. */ @SerializedName("billing_cycle_anchor") - EnumParam billingCycleAnchor; + ApiRequestParams.EnumParam billingCycleAnchor; + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + Object description; /** * When creating a new subscription, the date of which the subscription schedule will start @@ -2918,7 +2936,8 @@ public static class SubscriptionData { private SubscriptionData( BillingBehavior billingBehavior, - EnumParam billingCycleAnchor, + ApiRequestParams.EnumParam billingCycleAnchor, + Object description, Object effectiveDate, EndBehavior endBehavior, Map extraParams, @@ -2927,6 +2946,7 @@ private SubscriptionData( Object trialPeriodDays) { this.billingBehavior = billingBehavior; this.billingCycleAnchor = billingCycleAnchor; + this.description = description; this.effectiveDate = effectiveDate; this.endBehavior = endBehavior; this.extraParams = extraParams; @@ -2942,7 +2962,9 @@ public static Builder builder() { public static class Builder { private BillingBehavior billingBehavior; - private EnumParam billingCycleAnchor; + private ApiRequestParams.EnumParam billingCycleAnchor; + + private Object description; private Object effectiveDate; @@ -2957,10 +2979,11 @@ public static class Builder { private Object trialPeriodDays; /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionData build() { - return new SubscriptionData( + public QuoteUpdateParams.SubscriptionData build() { + return new QuoteUpdateParams.SubscriptionData( this.billingBehavior, this.billingCycleAnchor, + this.description, this.effectiveDate, this.endBehavior, this.extraParams, @@ -2976,7 +2999,8 @@ public SubscriptionData build() { * changes and generate prorations at transition time.{@code prorate_up_front} will bill for * all phases within the current billing cycle up front. */ - public Builder setBillingBehavior(BillingBehavior billingBehavior) { + public Builder setBillingBehavior( + QuoteUpdateParams.SubscriptionData.BillingBehavior billingBehavior) { this.billingBehavior = billingBehavior; return this; } @@ -2985,7 +3009,8 @@ public Builder setBillingBehavior(BillingBehavior billingBehavior) { * When specified as {@code reset}, the subscription will always start a new billing period * when the quote is accepted. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + QuoteUpdateParams.SubscriptionData.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -2999,6 +3024,24 @@ public Builder setBillingCycleAnchor(EmptyParam billingCycleAnchor) { return this; } + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + /** * When creating a new subscription, the date of which the subscription schedule will start * after the quote is accepted. When updating a subscription, the date of which the @@ -3007,7 +3050,8 @@ public Builder setBillingCycleAnchor(EmptyParam billingCycleAnchor) { * period. The {@code effective_date} is ignored if it is in the past when the quote is * accepted. */ - public Builder setEffectiveDate(EffectiveDate effectiveDate) { + public Builder setEffectiveDate( + QuoteUpdateParams.SubscriptionData.EffectiveDate effectiveDate) { this.effectiveDate = effectiveDate; return this; } @@ -3044,7 +3088,7 @@ public Builder setEffectiveDate(EmptyParam effectiveDate) { * the subscription schedule and keep the underlying subscription running.{@code cancel} will * end the subscription schedule and cancel the underlying subscription. */ - public Builder setEndBehavior(EndBehavior endBehavior) { + public Builder setEndBehavior(QuoteUpdateParams.SubscriptionData.EndBehavior endBehavior) { this.endBehavior = endBehavior; return this; } @@ -3079,7 +3123,7 @@ public Builder putAllExtraParam(Map map) { * If specified, the invoicing for the given billing cycle iterations will be processed when * the quote is accepted. Cannot be used with {@code effective_date}. */ - public Builder setPrebilling(Prebilling prebilling) { + public Builder setPrebilling(QuoteUpdateParams.SubscriptionData.Prebilling prebilling) { this.prebilling = prebilling; return this; } @@ -3109,7 +3153,8 @@ public Builder setPrebilling(EmptyParam prebilling) { * *

Prorations can be disabled by passing {@code none}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + QuoteUpdateParams.SubscriptionData.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -3163,8 +3208,9 @@ public static class Builder { private Long iterations; /** Finalize and obtain parameter instance from this builder. */ - public Prebilling build() { - return new Prebilling(this.extraParams, this.iterations); + public QuoteUpdateParams.SubscriptionData.Prebilling build() { + return new QuoteUpdateParams.SubscriptionData.Prebilling( + this.extraParams, this.iterations); } /** @@ -3333,8 +3379,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData( + public QuoteUpdateParams.TransferData build() { + return new QuoteUpdateParams.TransferData( this.amount, this.amountPercent, this.destination, this.extraParams); } diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index f40e868275e..43884fb9dbb 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -158,7 +158,7 @@ public Builder putAllExtraParam(Map map) { } /** This hash contains details about the Mandate to create. */ - public Builder setMandateData(MandateData mandateData) { + public Builder setMandateData(SetupIntentConfirmParams.MandateData mandateData) { this.mandateData = mandateData; return this; } @@ -177,13 +177,15 @@ public Builder setPaymentMethod(String paymentMethod) { * href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method">{@code * payment_method} value in the SetupIntent. */ - public Builder setPaymentMethodData(PaymentMethodData paymentMethodData) { + public Builder setPaymentMethodData( + SetupIntentConfirmParams.PaymentMethodData paymentMethodData) { this.paymentMethodData = paymentMethodData; return this; } /** Payment-method-specific configuration for this SetupIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + SetupIntentConfirmParams.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -230,12 +232,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateData build() { - return new MandateData(this.customerAcceptance, this.extraParams); + public SetupIntentConfirmParams.MandateData build() { + return new SetupIntentConfirmParams.MandateData(this.customerAcceptance, this.extraParams); } /** This hash contains details about the customer acceptance of the Mandate. */ - public Builder setCustomerAcceptance(CustomerAcceptance customerAcceptance) { + public Builder setCustomerAcceptance( + SetupIntentConfirmParams.MandateData.CustomerAcceptance customerAcceptance) { this.customerAcceptance = customerAcceptance; return this; } @@ -332,8 +335,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public CustomerAcceptance build() { - return new CustomerAcceptance( + public SetupIntentConfirmParams.MandateData.CustomerAcceptance build() { + return new SetupIntentConfirmParams.MandateData.CustomerAcceptance( this.acceptedAt, this.extraParams, this.offline, this.online, this.type); } @@ -375,7 +378,8 @@ public Builder putAllExtraParam(Map map) { * If this is a Mandate accepted offline, this hash contains details about the offline * acceptance. */ - public Builder setOffline(Offline offline) { + public Builder setOffline( + SetupIntentConfirmParams.MandateData.CustomerAcceptance.Offline offline) { this.offline = offline; return this; } @@ -384,7 +388,8 @@ public Builder setOffline(Offline offline) { * If this is a Mandate accepted online, this hash contains details about the online * acceptance. */ - public Builder setOnline(Online online) { + public Builder setOnline( + SetupIntentConfirmParams.MandateData.CustomerAcceptance.Online online) { this.online = online; return this; } @@ -393,7 +398,7 @@ public Builder setOnline(Online online) { * The type of customer acceptance information included with the Mandate. One of {@code * online} or {@code offline}. */ - public Builder setType(Type type) { + public Builder setType(SetupIntentConfirmParams.MandateData.CustomerAcceptance.Type type) { this.type = type; return this; } @@ -423,8 +428,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Offline build() { - return new Offline(this.extraParams); + public SetupIntentConfirmParams.MandateData.CustomerAcceptance.Offline build() { + return new SetupIntentConfirmParams.MandateData.CustomerAcceptance.Offline( + this.extraParams); } /** @@ -497,8 +503,9 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public Online build() { - return new Online(this.extraParams, this.ipAddress, this.userAgent); + public SetupIntentConfirmParams.MandateData.CustomerAcceptance.Online build() { + return new SetupIntentConfirmParams.MandateData.CustomerAcceptance.Online( + this.extraParams, this.ipAddress, this.userAgent); } /** @@ -743,6 +750,20 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + @SerializedName("paypal") + Paypal paypal; + + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + @SerializedName("pix") + Pix pix; + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -819,6 +840,8 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Paypal paypal, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -851,6 +874,8 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; + this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; this.sepaDebit = sepaDebit; @@ -915,6 +940,10 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -930,8 +959,8 @@ public static class Builder { private WechatPay wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodData build() { - return new PaymentMethodData( + public SetupIntentConfirmParams.PaymentMethodData build() { + return new SetupIntentConfirmParams.PaymentMethodData( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -957,6 +986,8 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.paypal, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -970,7 +1001,7 @@ public PaymentMethodData build() { * If this is an {@code acss_debit} PaymentMethod, this hash contains details about the ACSS * Debit payment method. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(SetupIntentConfirmParams.PaymentMethodData.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -979,7 +1010,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is an {@code affirm} PaymentMethod, this hash contains details about the Affirm * payment method. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(SetupIntentConfirmParams.PaymentMethodData.Affirm affirm) { this.affirm = affirm; return this; } @@ -988,7 +1019,8 @@ public Builder setAffirm(Affirm affirm) { * If this is an {@code AfterpayClearpay} PaymentMethod, this hash contains details about the * AfterpayClearpay payment method. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + SetupIntentConfirmParams.PaymentMethodData.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -997,7 +1029,7 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If this is an {@code Alipay} PaymentMethod, this hash contains details about the Alipay * payment method. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(SetupIntentConfirmParams.PaymentMethodData.Alipay alipay) { this.alipay = alipay; return this; } @@ -1006,7 +1038,8 @@ public Builder setAlipay(Alipay alipay) { * If this is an {@code au_becs_debit} PaymentMethod, this hash contains details about the * bank account. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + SetupIntentConfirmParams.PaymentMethodData.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -1015,7 +1048,7 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs * Direct Debit bank account. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(SetupIntentConfirmParams.PaymentMethodData.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -1024,7 +1057,8 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this hash contains details about the * Bancontact payment method. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + SetupIntentConfirmParams.PaymentMethodData.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -1033,7 +1067,8 @@ public Builder setBancontact(Bancontact bancontact) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails( + SetupIntentConfirmParams.PaymentMethodData.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -1042,7 +1077,7 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentConfirmParams.PaymentMethodData.Blik blik) { this.blik = blik; return this; } @@ -1051,7 +1086,7 @@ public Builder setBlik(Blik blik) { * If this is a {@code boleto} PaymentMethod, this hash contains details about the Boleto * payment method. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(SetupIntentConfirmParams.PaymentMethodData.Boleto boleto) { this.boleto = boleto; return this; } @@ -1060,7 +1095,8 @@ public Builder setBoleto(Boleto boleto) { * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + SetupIntentConfirmParams.PaymentMethodData.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -1069,7 +1105,7 @@ public Builder setCustomerBalance(CustomerBalance customerBalance) { * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment * method. */ - public Builder setEps(Eps eps) { + public Builder setEps(SetupIntentConfirmParams.PaymentMethodData.Eps eps) { this.eps = eps; return this; } @@ -1105,7 +1141,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code fpx} PaymentMethod, this hash contains details about the FPX payment * method. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(SetupIntentConfirmParams.PaymentMethodData.Fpx fpx) { this.fpx = fpx; return this; } @@ -1114,7 +1150,7 @@ public Builder setFpx(Fpx fpx) { * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(SetupIntentConfirmParams.PaymentMethodData.Giropay giropay) { this.giropay = giropay; return this; } @@ -1123,7 +1159,7 @@ public Builder setGiropay(Giropay giropay) { * If this is a {@code grabpay} PaymentMethod, this hash contains details about the GrabPay * payment method. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(SetupIntentConfirmParams.PaymentMethodData.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -1132,7 +1168,7 @@ public Builder setGrabpay(Grabpay grabpay) { * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL * payment method. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(SetupIntentConfirmParams.PaymentMethodData.Ideal ideal) { this.ideal = ideal; return this; } @@ -1141,7 +1177,8 @@ public Builder setIdeal(Ideal ideal) { * If this is an {@code interac_present} PaymentMethod, this hash contains details about the * Interac Present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + SetupIntentConfirmParams.PaymentMethodData.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -1150,7 +1187,7 @@ public Builder setInteracPresent(InteracPresent interacPresent) { * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna * payment method. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(SetupIntentConfirmParams.PaymentMethodData.Klarna klarna) { this.klarna = klarna; return this; } @@ -1159,7 +1196,7 @@ public Builder setKlarna(Klarna klarna) { * If this is a {@code konbini} PaymentMethod, this hash contains details about the Konbini * payment method. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(SetupIntentConfirmParams.PaymentMethodData.Konbini konbini) { this.konbini = konbini; return this; } @@ -1168,7 +1205,7 @@ public Builder setKonbini(Konbini konbini) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentConfirmParams.PaymentMethodData.Link link) { this.link = link; return this; } @@ -1204,7 +1241,7 @@ public Builder putAllMetadata(Map map) { * If this is an {@code oxxo} PaymentMethod, this hash contains details about the OXXO payment * method. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(SetupIntentConfirmParams.PaymentMethodData.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -1213,7 +1250,7 @@ public Builder setOxxo(Oxxo oxxo) { * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment * method. */ - public Builder setP24(P24 p24) { + public Builder setP24(SetupIntentConfirmParams.PaymentMethodData.P24 p24) { this.p24 = p24; return this; } @@ -1222,16 +1259,34 @@ public Builder setP24(P24 p24) { * If this is a {@code paynow} PaymentMethod, this hash contains details about the PayNow * payment method. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(SetupIntentConfirmParams.PaymentMethodData.Paynow paynow) { this.paynow = paynow; return this; } + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + public Builder setPaypal(SetupIntentConfirmParams.PaymentMethodData.Paypal paypal) { + this.paypal = paypal; + return this; + } + + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + public Builder setPix(SetupIntentConfirmParams.PaymentMethodData.Pix pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay(SetupIntentConfirmParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1240,7 +1295,8 @@ public Builder setPromptpay(Promptpay promptpay) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions( + SetupIntentConfirmParams.PaymentMethodData.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -1249,7 +1305,7 @@ public Builder setRadarOptions(RadarOptions radarOptions) { * If this is a {@code sepa_debit} PaymentMethod, this hash contains details about the SEPA * debit bank account. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(SetupIntentConfirmParams.PaymentMethodData.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -1258,7 +1314,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code sofort} PaymentMethod, this hash contains details about the SOFORT * payment method. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(SetupIntentConfirmParams.PaymentMethodData.Sofort sofort) { this.sofort = sofort; return this; } @@ -1268,7 +1324,7 @@ public Builder setSofort(Sofort sofort) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(SetupIntentConfirmParams.PaymentMethodData.Type type) { this.type = type; return this; } @@ -1277,7 +1333,8 @@ public Builder setType(Type type) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentConfirmParams.PaymentMethodData.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -1286,7 +1343,7 @@ public Builder setUsBankAccount(UsBankAccount usBankAccount) { * If this is an {@code wechat_pay} PaymentMethod, this hash contains details about the * wechat_pay payment method. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay(SetupIntentConfirmParams.PaymentMethodData.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -1340,8 +1397,8 @@ public static class Builder { private String transitNumber; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentConfirmParams.PaymentMethodData.AcssDebit build() { + return new SetupIntentConfirmParams.PaymentMethodData.AcssDebit( this.accountNumber, this.extraParams, this.institutionNumber, this.transitNumber); } @@ -1416,8 +1473,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Affirm build() { + return new SetupIntentConfirmParams.PaymentMethodData.Affirm(this.extraParams); } /** @@ -1473,8 +1530,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.AfterpayClearpay build() { + return new SetupIntentConfirmParams.PaymentMethodData.AfterpayClearpay(this.extraParams); } /** @@ -1530,8 +1587,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Alipay build() { + return new SetupIntentConfirmParams.PaymentMethodData.Alipay(this.extraParams); } /** @@ -1601,8 +1658,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.accountNumber, this.bsbNumber, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.AuBecsDebit build() { + return new SetupIntentConfirmParams.PaymentMethodData.AuBecsDebit( + this.accountNumber, this.bsbNumber, this.extraParams); } /** The account number for the bank account. */ @@ -1684,8 +1742,9 @@ public static class Builder { private String sortCode; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.accountNumber, this.extraParams, this.sortCode); + public SetupIntentConfirmParams.PaymentMethodData.BacsDebit build() { + return new SetupIntentConfirmParams.PaymentMethodData.BacsDebit( + this.accountNumber, this.extraParams, this.sortCode); } /** Account number of the bank account that the funds will be debited from. */ @@ -1753,8 +1812,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Bancontact build() { + return new SetupIntentConfirmParams.PaymentMethodData.Bancontact(this.extraParams); } /** @@ -1843,13 +1902,14 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public SetupIntentConfirmParams.PaymentMethodData.BillingDetails build() { + return new SetupIntentConfirmParams.PaymentMethodData.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress( + SetupIntentConfirmParams.PaymentMethodData.BillingDetails.Address address) { this.address = address; return this; } @@ -1989,8 +2049,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public SetupIntentConfirmParams.PaymentMethodData.BillingDetails.Address build() { + return new SetupIntentConfirmParams.PaymentMethodData.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -2095,8 +2155,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Blik build() { + return new SetupIntentConfirmParams.PaymentMethodData.Blik(this.extraParams); } /** @@ -2161,8 +2221,9 @@ public static class Builder { private String taxId; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.extraParams, this.taxId); + public SetupIntentConfirmParams.PaymentMethodData.Boleto build() { + return new SetupIntentConfirmParams.PaymentMethodData.Boleto( + this.extraParams, this.taxId); } /** @@ -2227,8 +2288,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.CustomerBalance build() { + return new SetupIntentConfirmParams.PaymentMethodData.CustomerBalance(this.extraParams); } /** @@ -2291,12 +2352,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.bank, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Eps build() { + return new SetupIntentConfirmParams.PaymentMethodData.Eps(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentConfirmParams.PaymentMethodData.Eps.Bank bank) { this.bank = bank; return this; } @@ -2361,6 +2422,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("capital_bank_grawe_gruppe_ag") CAPITAL_BANK_GRAWE_GRUPPE_AG("capital_bank_grawe_gruppe_ag"), + @SerializedName("deutsche_bank_ag") + DEUTSCHE_BANK_AG("deutsche_bank_ag"), + @SerializedName("dolomitenbank") DOLOMITENBANK("dolomitenbank"), @@ -2458,18 +2522,20 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.accountHolderType, this.bank, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Fpx build() { + return new SetupIntentConfirmParams.PaymentMethodData.Fpx( + this.accountHolderType, this.bank, this.extraParams); } /** Account holder type for FPX transaction. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentConfirmParams.PaymentMethodData.Fpx.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentConfirmParams.PaymentMethodData.Fpx.Bank bank) { this.bank = bank; return this; } @@ -2614,8 +2680,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Giropay build() { + return new SetupIntentConfirmParams.PaymentMethodData.Giropay(this.extraParams); } /** @@ -2671,8 +2737,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Grabpay build() { + return new SetupIntentConfirmParams.PaymentMethodData.Grabpay(this.extraParams); } /** @@ -2735,12 +2801,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.bank, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Ideal build() { + return new SetupIntentConfirmParams.PaymentMethodData.Ideal(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentConfirmParams.PaymentMethodData.Ideal.Bank bank) { this.bank = bank; return this; } @@ -2846,8 +2912,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.InteracPresent build() { + return new SetupIntentConfirmParams.PaymentMethodData.InteracPresent(this.extraParams); } /** @@ -2910,12 +2976,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.dob, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Klarna build() { + return new SetupIntentConfirmParams.PaymentMethodData.Klarna(this.dob, this.extraParams); } /** Customer's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(SetupIntentConfirmParams.PaymentMethodData.Klarna.Dob dob) { this.dob = dob; return this; } @@ -2994,8 +3060,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public SetupIntentConfirmParams.PaymentMethodData.Klarna.Dob build() { + return new SetupIntentConfirmParams.PaymentMethodData.Klarna.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -3070,8 +3137,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Konbini build() { + return new SetupIntentConfirmParams.PaymentMethodData.Konbini(this.extraParams); } /** @@ -3127,8 +3194,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Link build() { + return new SetupIntentConfirmParams.PaymentMethodData.Link(this.extraParams); } /** @@ -3184,8 +3251,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Oxxo build() { + return new SetupIntentConfirmParams.PaymentMethodData.Oxxo(this.extraParams); } /** @@ -3248,12 +3315,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.bank, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.P24 build() { + return new SetupIntentConfirmParams.PaymentMethodData.P24(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentConfirmParams.PaymentMethodData.P24.Bank bank) { this.bank = bank; return this; } @@ -3395,8 +3462,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Paynow build() { + return new SetupIntentConfirmParams.PaymentMethodData.Paynow(this.extraParams); } /** @@ -3429,6 +3496,120 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Paypal { + /** + * 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 Paypal(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodData.Paypal build() { + return new SetupIntentConfirmParams.PaymentMethodData.Paypal(this.extraParams); + } + + /** + * 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.Paypal#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.Paypal#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 + public static class Pix { + /** + * 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 Pix(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodData.Pix build() { + return new SetupIntentConfirmParams.PaymentMethodData.Pix(this.extraParams); + } + + /** + * 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.Pix#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.Pix#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 public static class Promptpay { /** @@ -3452,8 +3633,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Promptpay build() { + return new SetupIntentConfirmParams.PaymentMethodData.Promptpay(this.extraParams); } /** @@ -3520,8 +3701,9 @@ public static class Builder { private String session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public SetupIntentConfirmParams.PaymentMethodData.RadarOptions build() { + return new SetupIntentConfirmParams.PaymentMethodData.RadarOptions( + this.extraParams, this.session); } /** @@ -3594,8 +3776,9 @@ public static class Builder { private String iban; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.iban); + public SetupIntentConfirmParams.PaymentMethodData.SepaDebit build() { + return new SetupIntentConfirmParams.PaymentMethodData.SepaDebit( + this.extraParams, this.iban); } /** @@ -3664,12 +3847,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.country, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.Sofort build() { + return new SetupIntentConfirmParams.PaymentMethodData.Sofort( + this.country, this.extraParams); } /** Two-letter ISO code representing the country the bank account is located in. */ - public Builder setCountry(Country country) { + public Builder setCountry( + SetupIntentConfirmParams.PaymentMethodData.Sofort.Country country) { this.country = country; return this; } @@ -3795,8 +3980,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentConfirmParams.PaymentMethodData.UsBankAccount build() { + return new SetupIntentConfirmParams.PaymentMethodData.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -3806,7 +3991,9 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentConfirmParams.PaymentMethodData.UsBankAccount.AccountHolderType + accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -3818,7 +4005,8 @@ public Builder setAccountNumber(String accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + SetupIntentConfirmParams.PaymentMethodData.UsBankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -3918,8 +4106,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodData.WechatPay build() { + return new SetupIntentConfirmParams.PaymentMethodData.WechatPay(this.extraParams); } /** @@ -4016,6 +4204,12 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), @@ -4127,8 +4321,8 @@ public static class Builder { private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public SetupIntentConfirmParams.PaymentMethodOptions build() { + return new SetupIntentConfirmParams.PaymentMethodOptions( this.acssDebit, this.blik, this.card, @@ -4142,7 +4336,8 @@ public PaymentMethodOptions build() { * If this is a {@code acss_debit} SetupIntent, this sub-hash contains details about the ACSS * Debit payment method options. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -4151,13 +4346,13 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentConfirmParams.PaymentMethodOptions.Blik blik) { this.blik = blik; return this; } /** Configuration for any card setup attempted on this SetupIntent. */ - public Builder setCard(Card card) { + public Builder setCard(SetupIntentConfirmParams.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -4193,7 +4388,7 @@ public Builder putAllExtraParam(Map map) { * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentConfirmParams.PaymentMethodOptions.Link link) { this.link = link; return this; } @@ -4202,7 +4397,8 @@ public Builder setLink(Link link) { * If this is a {@code sepa_debit} SetupIntent, this sub-hash contains details about the SEPA * Debit payment method options. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -4211,7 +4407,8 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the * US bank account payment method options. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -4269,8 +4466,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit( this.currency, this.extraParams, this.mandateOptions, this.verificationMethod); } @@ -4279,7 +4476,8 @@ public AcssDebit build() { * code, in lowercase. Must be a supported * currency. */ - public Builder setCurrency(Currency currency) { + public Builder setCurrency( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.Currency currency) { this.currency = currency; return this; } @@ -4313,13 +4511,16 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -4338,7 +4539,8 @@ public static class MandateOptions { /** List of Stripe products where this mandate can be selected automatically. */ @SerializedName("default_for") - List defaultFor; + List + defaultFor; /** * Map of extra parameters for custom features not available in this client library. The @@ -4367,7 +4569,8 @@ public static class MandateOptions { private MandateOptions( Object customMandateUrl, - List defaultFor, + List + defaultFor, Map extraParams, String intervalDescription, PaymentSchedule paymentSchedule, @@ -4387,7 +4590,9 @@ public static Builder builder() { public static class Builder { private Object customMandateUrl; - private List defaultFor; + private List< + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor> + defaultFor; private Map extraParams; @@ -4398,8 +4603,8 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions( this.customMandateUrl, this.defaultFor, this.extraParams, @@ -4436,7 +4641,9 @@ public Builder setCustomMandateUrl(EmptyParam customMandateUrl) { * SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addDefaultFor(DefaultFor element) { + public Builder addDefaultFor( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor + element) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4450,7 +4657,11 @@ public Builder addDefaultFor(DefaultFor element) { * SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addAllDefaultFor(List elements) { + public Builder addAllDefaultFor( + List< + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions + .DefaultFor> + elements) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4498,13 +4709,17 @@ public Builder setIntervalDescription(String intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions.PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.MandateOptions.TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -4626,8 +4841,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.code, this.extraParams); + public SetupIntentConfirmParams.PaymentMethodOptions.Blik build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Blik( + this.code, this.extraParams); } /** @@ -4742,8 +4958,8 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public SetupIntentConfirmParams.PaymentMethodOptions.Card build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Card( this.extraParams, this.mandateOptions, this.moto, @@ -4780,7 +4996,8 @@ public Builder putAllExtraParam(Map map) { } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -4799,7 +5016,8 @@ public Builder setMoto(Boolean moto) { * Selected network to process this SetupIntent on. Depends on the available networks of the * card attached to the SetupIntent. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + SetupIntentConfirmParams.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -4815,7 +5033,9 @@ public Builder setNetwork(Network network) { * Secure for more information on how this configuration interacts with Radar and our * SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + SetupIntentConfirmParams.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -4896,7 +5116,8 @@ public static class MandateOptions { /** Specifies the type of mandates supported. Possible values are {@code india}. */ @SerializedName("supported_types") - List supportedTypes; + List + supportedTypes; private MandateOptions( Long amount, @@ -4909,7 +5130,8 @@ private MandateOptions( Long intervalCount, String reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.currency = currency; @@ -4948,11 +5170,13 @@ public static class Builder { private Long startDate; - private List supportedTypes; + private List< + SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.SupportedType> + supportedTypes; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions( this.amount, this.amountType, this.currency, @@ -4977,7 +5201,9 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.AmountType + amountType) { this.amountType = amountType; return this; } @@ -5045,7 +5271,8 @@ public Builder putAllExtraParam(Map map) { * Specifies payment frequency. One of {@code day}, {@code week}, {@code month}, {@code * year}, or {@code sporadic}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.Interval interval) { this.interval = interval; return this; } @@ -5083,7 +5310,9 @@ public Builder setStartDate(Long startDate) { * SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addSupportedType(SupportedType element) { + public Builder addSupportedType( + SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions.SupportedType + element) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5098,7 +5327,9 @@ public Builder addSupportedType(SupportedType element) { * SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addAllSupportedType(List elements) { + public Builder addAllSupportedType( + List + elements) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5244,8 +5475,9 @@ public static class Builder { private String persistentToken; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams, this.persistentToken); + public SetupIntentConfirmParams.PaymentMethodOptions.Link build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Link( + this.extraParams, this.persistentToken); } /** @@ -5314,8 +5546,9 @@ public static class Builder { private MandateOptions mandateOptions; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.mandateOptions); + public SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit( + this.extraParams, this.mandateOptions); } /** @@ -5347,7 +5580,8 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5377,8 +5611,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams); + public SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit.MandateOptions build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.SepaDebit.MandateOptions( + this.extraParams); } /** @@ -5462,8 +5697,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.networks, this.verificationMethod); } @@ -5496,19 +5731,24 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Additional fields for network related functions. */ - public Builder setNetworks(Networks networks) { + public Builder setNetworks( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks networks) { this.networks = networks; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -5532,7 +5772,10 @@ public static class FinancialConnections { * {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; /** * For webview integrations only. Upon completing OAuth login in the native browser, the @@ -5542,7 +5785,12 @@ public static class FinancialConnections { String returnUrl; private FinancialConnections( - Map extraParams, List permissions, String returnUrl) { + Map extraParams, + List< + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions, + String returnUrl) { this.extraParams = extraParams; this.permissions = permissions; this.returnUrl = returnUrl; @@ -5555,13 +5803,18 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; private String returnUrl; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions, this.returnUrl); + public SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions, this.returnUrl); } /** @@ -5600,7 +5853,10 @@ public Builder putAllExtraParam(Map map) { * SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -5615,7 +5871,11 @@ public Builder addPermission(Permission element) { * SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -5669,9 +5929,13 @@ public static class Networks { /** Triggers validations to run across the selected networks. */ @SerializedName("requested") - List requested; + List + requested; - private Networks(Map extraParams, List requested) { + private Networks( + Map extraParams, + List + requested) { this.extraParams = extraParams; this.requested = requested; } @@ -5683,11 +5947,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List requested; + private List< + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks.Requested> + requested; /** Finalize and obtain parameter instance from this builder. */ - public Networks build() { - return new Networks(this.extraParams, this.requested); + public SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks( + this.extraParams, this.requested); } /** @@ -5726,7 +5993,9 @@ public Builder putAllExtraParam(Map map) { * SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addRequested(Requested element) { + public Builder addRequested( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks.Requested + element) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -5740,7 +6009,9 @@ public Builder addRequested(Requested element) { * SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addAllRequested(List elements) { + public Builder addAllRequested( + List + elements) { if (this.requested == null) { this.requested = new ArrayList<>(); } diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index 28f574b7f28..ce95e719cc0 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -65,7 +65,7 @@ public class SetupIntentCreateParams extends ApiRequestParams { * send funds to. You can include both if you intend to use the payment method for both purposes. */ @SerializedName("flow_directions") - List flowDirections; + List flowDirections; /** * This hash contains details about the Mandate to create. This parameter can only be used with expand, Map extraParams, - List flowDirections, + List flowDirections, MandateData mandateData, Map metadata, String onBehalfOf, @@ -189,7 +189,7 @@ public static class Builder { private Map extraParams; - private List flowDirections; + private List flowDirections; private MandateData mandateData; @@ -332,7 +332,7 @@ public Builder putAllExtraParam(Map map) { * call, and subsequent calls adds additional elements to the original list. See {@link * SetupIntentCreateParams#flowDirections} for the field documentation. */ - public Builder addFlowDirection(FlowDirection element) { + public Builder addFlowDirection(SetupIntentCreateParams.FlowDirection element) { if (this.flowDirections == null) { this.flowDirections = new ArrayList<>(); } @@ -345,7 +345,7 @@ public Builder addFlowDirection(FlowDirection element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SetupIntentCreateParams#flowDirections} for the field documentation. */ - public Builder addAllFlowDirection(List elements) { + public Builder addAllFlowDirection(List elements) { if (this.flowDirections == null) { this.flowDirections = new ArrayList<>(); } @@ -358,7 +358,7 @@ public Builder addAllFlowDirection(List elements) { * {@code * confirm=true}. */ - public Builder setMandateData(MandateData mandateData) { + public Builder setMandateData(SetupIntentCreateParams.MandateData mandateData) { this.mandateData = mandateData; return this; } @@ -409,13 +409,15 @@ public Builder setPaymentMethod(String paymentMethod) { * href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method">{@code * payment_method} value in the SetupIntent. */ - public Builder setPaymentMethodData(PaymentMethodData paymentMethodData) { + public Builder setPaymentMethodData( + SetupIntentCreateParams.PaymentMethodData paymentMethodData) { this.paymentMethodData = paymentMethodData; return this; } /** Payment-method-specific configuration for this SetupIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + SetupIntentCreateParams.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -461,7 +463,7 @@ public Builder setReturnUrl(String returnUrl) { /** * If this hash is populated, this SetupIntent will generate a single_use Mandate on success. */ - public Builder setSingleUse(SingleUse singleUse) { + public Builder setSingleUse(SetupIntentCreateParams.SingleUse singleUse) { this.singleUse = singleUse; return this; } @@ -470,7 +472,7 @@ public Builder setSingleUse(SingleUse singleUse) { * Indicates how the payment method is intended to be used in the future. If not provided, this * value defaults to {@code off_session}. */ - public Builder setUsage(Usage usage) { + public Builder setUsage(SetupIntentCreateParams.Usage usage) { this.usage = usage; return this; } @@ -506,12 +508,13 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateData build() { - return new MandateData(this.customerAcceptance, this.extraParams); + public SetupIntentCreateParams.MandateData build() { + return new SetupIntentCreateParams.MandateData(this.customerAcceptance, this.extraParams); } /** This hash contains details about the customer acceptance of the Mandate. */ - public Builder setCustomerAcceptance(CustomerAcceptance customerAcceptance) { + public Builder setCustomerAcceptance( + SetupIntentCreateParams.MandateData.CustomerAcceptance customerAcceptance) { this.customerAcceptance = customerAcceptance; return this; } @@ -608,8 +611,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public CustomerAcceptance build() { - return new CustomerAcceptance( + public SetupIntentCreateParams.MandateData.CustomerAcceptance build() { + return new SetupIntentCreateParams.MandateData.CustomerAcceptance( this.acceptedAt, this.extraParams, this.offline, this.online, this.type); } @@ -651,7 +654,8 @@ public Builder putAllExtraParam(Map map) { * If this is a Mandate accepted offline, this hash contains details about the offline * acceptance. */ - public Builder setOffline(Offline offline) { + public Builder setOffline( + SetupIntentCreateParams.MandateData.CustomerAcceptance.Offline offline) { this.offline = offline; return this; } @@ -660,7 +664,8 @@ public Builder setOffline(Offline offline) { * If this is a Mandate accepted online, this hash contains details about the online * acceptance. */ - public Builder setOnline(Online online) { + public Builder setOnline( + SetupIntentCreateParams.MandateData.CustomerAcceptance.Online online) { this.online = online; return this; } @@ -669,7 +674,7 @@ public Builder setOnline(Online online) { * The type of customer acceptance information included with the Mandate. One of {@code * online} or {@code offline}. */ - public Builder setType(Type type) { + public Builder setType(SetupIntentCreateParams.MandateData.CustomerAcceptance.Type type) { this.type = type; return this; } @@ -699,8 +704,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Offline build() { - return new Offline(this.extraParams); + public SetupIntentCreateParams.MandateData.CustomerAcceptance.Offline build() { + return new SetupIntentCreateParams.MandateData.CustomerAcceptance.Offline( + this.extraParams); } /** @@ -773,8 +779,9 @@ public static class Builder { private String userAgent; /** Finalize and obtain parameter instance from this builder. */ - public Online build() { - return new Online(this.extraParams, this.ipAddress, this.userAgent); + public SetupIntentCreateParams.MandateData.CustomerAcceptance.Online build() { + return new SetupIntentCreateParams.MandateData.CustomerAcceptance.Online( + this.extraParams, this.ipAddress, this.userAgent); } /** @@ -1019,6 +1026,20 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + @SerializedName("paypal") + Paypal paypal; + + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + @SerializedName("pix") + Pix pix; + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -1095,6 +1116,8 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Paypal paypal, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -1127,6 +1150,8 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; + this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; this.sepaDebit = sepaDebit; @@ -1191,6 +1216,10 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -1206,8 +1235,8 @@ public static class Builder { private WechatPay wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodData build() { - return new PaymentMethodData( + public SetupIntentCreateParams.PaymentMethodData build() { + return new SetupIntentCreateParams.PaymentMethodData( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -1233,6 +1262,8 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.paypal, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -1246,7 +1277,7 @@ public PaymentMethodData build() { * If this is an {@code acss_debit} PaymentMethod, this hash contains details about the ACSS * Debit payment method. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(SetupIntentCreateParams.PaymentMethodData.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -1255,7 +1286,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is an {@code affirm} PaymentMethod, this hash contains details about the Affirm * payment method. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(SetupIntentCreateParams.PaymentMethodData.Affirm affirm) { this.affirm = affirm; return this; } @@ -1264,7 +1295,8 @@ public Builder setAffirm(Affirm affirm) { * If this is an {@code AfterpayClearpay} PaymentMethod, this hash contains details about the * AfterpayClearpay payment method. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + SetupIntentCreateParams.PaymentMethodData.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -1273,7 +1305,7 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If this is an {@code Alipay} PaymentMethod, this hash contains details about the Alipay * payment method. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(SetupIntentCreateParams.PaymentMethodData.Alipay alipay) { this.alipay = alipay; return this; } @@ -1282,7 +1314,8 @@ public Builder setAlipay(Alipay alipay) { * If this is an {@code au_becs_debit} PaymentMethod, this hash contains details about the * bank account. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + SetupIntentCreateParams.PaymentMethodData.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -1291,7 +1324,7 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs * Direct Debit bank account. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(SetupIntentCreateParams.PaymentMethodData.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -1300,7 +1333,8 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this hash contains details about the * Bancontact payment method. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + SetupIntentCreateParams.PaymentMethodData.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -1309,7 +1343,8 @@ public Builder setBancontact(Bancontact bancontact) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails( + SetupIntentCreateParams.PaymentMethodData.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -1318,7 +1353,7 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentCreateParams.PaymentMethodData.Blik blik) { this.blik = blik; return this; } @@ -1327,7 +1362,7 @@ public Builder setBlik(Blik blik) { * If this is a {@code boleto} PaymentMethod, this hash contains details about the Boleto * payment method. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(SetupIntentCreateParams.PaymentMethodData.Boleto boleto) { this.boleto = boleto; return this; } @@ -1336,7 +1371,8 @@ public Builder setBoleto(Boleto boleto) { * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + SetupIntentCreateParams.PaymentMethodData.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -1345,7 +1381,7 @@ public Builder setCustomerBalance(CustomerBalance customerBalance) { * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment * method. */ - public Builder setEps(Eps eps) { + public Builder setEps(SetupIntentCreateParams.PaymentMethodData.Eps eps) { this.eps = eps; return this; } @@ -1381,7 +1417,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code fpx} PaymentMethod, this hash contains details about the FPX payment * method. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(SetupIntentCreateParams.PaymentMethodData.Fpx fpx) { this.fpx = fpx; return this; } @@ -1390,7 +1426,7 @@ public Builder setFpx(Fpx fpx) { * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(SetupIntentCreateParams.PaymentMethodData.Giropay giropay) { this.giropay = giropay; return this; } @@ -1399,7 +1435,7 @@ public Builder setGiropay(Giropay giropay) { * If this is a {@code grabpay} PaymentMethod, this hash contains details about the GrabPay * payment method. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(SetupIntentCreateParams.PaymentMethodData.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -1408,7 +1444,7 @@ public Builder setGrabpay(Grabpay grabpay) { * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL * payment method. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(SetupIntentCreateParams.PaymentMethodData.Ideal ideal) { this.ideal = ideal; return this; } @@ -1417,7 +1453,8 @@ public Builder setIdeal(Ideal ideal) { * If this is an {@code interac_present} PaymentMethod, this hash contains details about the * Interac Present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + SetupIntentCreateParams.PaymentMethodData.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -1426,7 +1463,7 @@ public Builder setInteracPresent(InteracPresent interacPresent) { * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna * payment method. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(SetupIntentCreateParams.PaymentMethodData.Klarna klarna) { this.klarna = klarna; return this; } @@ -1435,7 +1472,7 @@ public Builder setKlarna(Klarna klarna) { * If this is a {@code konbini} PaymentMethod, this hash contains details about the Konbini * payment method. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(SetupIntentCreateParams.PaymentMethodData.Konbini konbini) { this.konbini = konbini; return this; } @@ -1444,7 +1481,7 @@ public Builder setKonbini(Konbini konbini) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentCreateParams.PaymentMethodData.Link link) { this.link = link; return this; } @@ -1479,7 +1516,7 @@ public Builder putAllMetadata(Map map) { * If this is an {@code oxxo} PaymentMethod, this hash contains details about the OXXO payment * method. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(SetupIntentCreateParams.PaymentMethodData.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -1488,7 +1525,7 @@ public Builder setOxxo(Oxxo oxxo) { * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment * method. */ - public Builder setP24(P24 p24) { + public Builder setP24(SetupIntentCreateParams.PaymentMethodData.P24 p24) { this.p24 = p24; return this; } @@ -1497,16 +1534,34 @@ public Builder setP24(P24 p24) { * If this is a {@code paynow} PaymentMethod, this hash contains details about the PayNow * payment method. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(SetupIntentCreateParams.PaymentMethodData.Paynow paynow) { this.paynow = paynow; return this; } + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + public Builder setPaypal(SetupIntentCreateParams.PaymentMethodData.Paypal paypal) { + this.paypal = paypal; + return this; + } + + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + public Builder setPix(SetupIntentCreateParams.PaymentMethodData.Pix pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay(SetupIntentCreateParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1515,7 +1570,8 @@ public Builder setPromptpay(Promptpay promptpay) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions( + SetupIntentCreateParams.PaymentMethodData.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -1524,7 +1580,7 @@ public Builder setRadarOptions(RadarOptions radarOptions) { * If this is a {@code sepa_debit} PaymentMethod, this hash contains details about the SEPA * debit bank account. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(SetupIntentCreateParams.PaymentMethodData.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -1533,7 +1589,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code sofort} PaymentMethod, this hash contains details about the SOFORT * payment method. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(SetupIntentCreateParams.PaymentMethodData.Sofort sofort) { this.sofort = sofort; return this; } @@ -1543,7 +1599,7 @@ public Builder setSofort(Sofort sofort) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(SetupIntentCreateParams.PaymentMethodData.Type type) { this.type = type; return this; } @@ -1552,7 +1608,8 @@ public Builder setType(Type type) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentCreateParams.PaymentMethodData.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -1561,7 +1618,7 @@ public Builder setUsBankAccount(UsBankAccount usBankAccount) { * If this is an {@code wechat_pay} PaymentMethod, this hash contains details about the * wechat_pay payment method. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay(SetupIntentCreateParams.PaymentMethodData.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -1615,8 +1672,8 @@ public static class Builder { private String transitNumber; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentCreateParams.PaymentMethodData.AcssDebit build() { + return new SetupIntentCreateParams.PaymentMethodData.AcssDebit( this.accountNumber, this.extraParams, this.institutionNumber, this.transitNumber); } @@ -1691,8 +1748,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Affirm build() { + return new SetupIntentCreateParams.PaymentMethodData.Affirm(this.extraParams); } /** @@ -1748,8 +1805,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.AfterpayClearpay build() { + return new SetupIntentCreateParams.PaymentMethodData.AfterpayClearpay(this.extraParams); } /** @@ -1805,8 +1862,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Alipay build() { + return new SetupIntentCreateParams.PaymentMethodData.Alipay(this.extraParams); } /** @@ -1876,8 +1933,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.accountNumber, this.bsbNumber, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.AuBecsDebit build() { + return new SetupIntentCreateParams.PaymentMethodData.AuBecsDebit( + this.accountNumber, this.bsbNumber, this.extraParams); } /** The account number for the bank account. */ @@ -1959,8 +2017,9 @@ public static class Builder { private String sortCode; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.accountNumber, this.extraParams, this.sortCode); + public SetupIntentCreateParams.PaymentMethodData.BacsDebit build() { + return new SetupIntentCreateParams.PaymentMethodData.BacsDebit( + this.accountNumber, this.extraParams, this.sortCode); } /** Account number of the bank account that the funds will be debited from. */ @@ -2028,8 +2087,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Bancontact build() { + return new SetupIntentCreateParams.PaymentMethodData.Bancontact(this.extraParams); } /** @@ -2118,13 +2177,14 @@ public static class Builder { private String phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public SetupIntentCreateParams.PaymentMethodData.BillingDetails build() { + return new SetupIntentCreateParams.PaymentMethodData.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress( + SetupIntentCreateParams.PaymentMethodData.BillingDetails.Address address) { this.address = address; return this; } @@ -2264,8 +2324,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public SetupIntentCreateParams.PaymentMethodData.BillingDetails.Address build() { + return new SetupIntentCreateParams.PaymentMethodData.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -2370,8 +2430,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Blik build() { + return new SetupIntentCreateParams.PaymentMethodData.Blik(this.extraParams); } /** @@ -2436,8 +2496,8 @@ public static class Builder { private String taxId; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.extraParams, this.taxId); + public SetupIntentCreateParams.PaymentMethodData.Boleto build() { + return new SetupIntentCreateParams.PaymentMethodData.Boleto(this.extraParams, this.taxId); } /** @@ -2502,8 +2562,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.CustomerBalance build() { + return new SetupIntentCreateParams.PaymentMethodData.CustomerBalance(this.extraParams); } /** @@ -2566,12 +2626,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.bank, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Eps build() { + return new SetupIntentCreateParams.PaymentMethodData.Eps(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentCreateParams.PaymentMethodData.Eps.Bank bank) { this.bank = bank; return this; } @@ -2636,6 +2696,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("capital_bank_grawe_gruppe_ag") CAPITAL_BANK_GRAWE_GRUPPE_AG("capital_bank_grawe_gruppe_ag"), + @SerializedName("deutsche_bank_ag") + DEUTSCHE_BANK_AG("deutsche_bank_ag"), + @SerializedName("dolomitenbank") DOLOMITENBANK("dolomitenbank"), @@ -2733,18 +2796,20 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.accountHolderType, this.bank, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Fpx build() { + return new SetupIntentCreateParams.PaymentMethodData.Fpx( + this.accountHolderType, this.bank, this.extraParams); } /** Account holder type for FPX transaction. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentCreateParams.PaymentMethodData.Fpx.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentCreateParams.PaymentMethodData.Fpx.Bank bank) { this.bank = bank; return this; } @@ -2889,8 +2954,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Giropay build() { + return new SetupIntentCreateParams.PaymentMethodData.Giropay(this.extraParams); } /** @@ -2946,8 +3011,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Grabpay build() { + return new SetupIntentCreateParams.PaymentMethodData.Grabpay(this.extraParams); } /** @@ -3010,12 +3075,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.bank, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Ideal build() { + return new SetupIntentCreateParams.PaymentMethodData.Ideal(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentCreateParams.PaymentMethodData.Ideal.Bank bank) { this.bank = bank; return this; } @@ -3121,8 +3186,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.InteracPresent build() { + return new SetupIntentCreateParams.PaymentMethodData.InteracPresent(this.extraParams); } /** @@ -3185,12 +3250,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.dob, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Klarna build() { + return new SetupIntentCreateParams.PaymentMethodData.Klarna(this.dob, this.extraParams); } /** Customer's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(SetupIntentCreateParams.PaymentMethodData.Klarna.Dob dob) { this.dob = dob; return this; } @@ -3269,8 +3334,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public SetupIntentCreateParams.PaymentMethodData.Klarna.Dob build() { + return new SetupIntentCreateParams.PaymentMethodData.Klarna.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -3345,8 +3411,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Konbini build() { + return new SetupIntentCreateParams.PaymentMethodData.Konbini(this.extraParams); } /** @@ -3402,8 +3468,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Link build() { + return new SetupIntentCreateParams.PaymentMethodData.Link(this.extraParams); } /** @@ -3459,8 +3525,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Oxxo build() { + return new SetupIntentCreateParams.PaymentMethodData.Oxxo(this.extraParams); } /** @@ -3523,12 +3589,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.bank, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.P24 build() { + return new SetupIntentCreateParams.PaymentMethodData.P24(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentCreateParams.PaymentMethodData.P24.Bank bank) { this.bank = bank; return this; } @@ -3670,8 +3736,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Paynow build() { + return new SetupIntentCreateParams.PaymentMethodData.Paynow(this.extraParams); } /** @@ -3704,6 +3770,120 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Paypal { + /** + * 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 Paypal(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodData.Paypal build() { + return new SetupIntentCreateParams.PaymentMethodData.Paypal(this.extraParams); + } + + /** + * 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.Paypal#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.Paypal#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 + public static class Pix { + /** + * 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 Pix(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodData.Pix build() { + return new SetupIntentCreateParams.PaymentMethodData.Pix(this.extraParams); + } + + /** + * 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.Pix#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.Pix#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 public static class Promptpay { /** @@ -3727,8 +3907,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Promptpay build() { + return new SetupIntentCreateParams.PaymentMethodData.Promptpay(this.extraParams); } /** @@ -3795,8 +3975,9 @@ public static class Builder { private String session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public SetupIntentCreateParams.PaymentMethodData.RadarOptions build() { + return new SetupIntentCreateParams.PaymentMethodData.RadarOptions( + this.extraParams, this.session); } /** @@ -3869,8 +4050,9 @@ public static class Builder { private String iban; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.iban); + public SetupIntentCreateParams.PaymentMethodData.SepaDebit build() { + return new SetupIntentCreateParams.PaymentMethodData.SepaDebit( + this.extraParams, this.iban); } /** @@ -3939,12 +4121,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.country, this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.Sofort build() { + return new SetupIntentCreateParams.PaymentMethodData.Sofort( + this.country, this.extraParams); } /** Two-letter ISO code representing the country the bank account is located in. */ - public Builder setCountry(Country country) { + public Builder setCountry( + SetupIntentCreateParams.PaymentMethodData.Sofort.Country country) { this.country = country; return this; } @@ -4070,8 +4254,8 @@ public static class Builder { private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentCreateParams.PaymentMethodData.UsBankAccount build() { + return new SetupIntentCreateParams.PaymentMethodData.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -4081,7 +4265,9 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentCreateParams.PaymentMethodData.UsBankAccount.AccountHolderType + accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -4093,7 +4279,8 @@ public Builder setAccountNumber(String accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + SetupIntentCreateParams.PaymentMethodData.UsBankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -4193,8 +4380,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.extraParams); + public SetupIntentCreateParams.PaymentMethodData.WechatPay build() { + return new SetupIntentCreateParams.PaymentMethodData.WechatPay(this.extraParams); } /** @@ -4291,6 +4478,12 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), @@ -4402,8 +4595,8 @@ public static class Builder { private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public SetupIntentCreateParams.PaymentMethodOptions build() { + return new SetupIntentCreateParams.PaymentMethodOptions( this.acssDebit, this.blik, this.card, @@ -4417,7 +4610,8 @@ public PaymentMethodOptions build() { * If this is a {@code acss_debit} SetupIntent, this sub-hash contains details about the ACSS * Debit payment method options. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -4426,13 +4620,13 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentCreateParams.PaymentMethodOptions.Blik blik) { this.blik = blik; return this; } /** Configuration for any card setup attempted on this SetupIntent. */ - public Builder setCard(Card card) { + public Builder setCard(SetupIntentCreateParams.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -4468,7 +4662,7 @@ public Builder putAllExtraParam(Map map) { * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentCreateParams.PaymentMethodOptions.Link link) { this.link = link; return this; } @@ -4477,7 +4671,8 @@ public Builder setLink(Link link) { * If this is a {@code sepa_debit} SetupIntent, this sub-hash contains details about the SEPA * Debit payment method options. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + SetupIntentCreateParams.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -4486,7 +4681,8 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the * US bank account payment method options. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -4544,8 +4740,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentCreateParams.PaymentMethodOptions.AcssDebit build() { + return new SetupIntentCreateParams.PaymentMethodOptions.AcssDebit( this.currency, this.extraParams, this.mandateOptions, this.verificationMethod); } @@ -4554,7 +4750,8 @@ public AcssDebit build() { * code, in lowercase. Must be a supported * currency. */ - public Builder setCurrency(Currency currency) { + public Builder setCurrency( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.Currency currency) { this.currency = currency; return this; } @@ -4588,13 +4785,16 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -4613,7 +4813,8 @@ public static class MandateOptions { /** List of Stripe products where this mandate can be selected automatically. */ @SerializedName("default_for") - List defaultFor; + List + defaultFor; /** * Map of extra parameters for custom features not available in this client library. The @@ -4642,7 +4843,8 @@ public static class MandateOptions { private MandateOptions( Object customMandateUrl, - List defaultFor, + List + defaultFor, Map extraParams, String intervalDescription, PaymentSchedule paymentSchedule, @@ -4662,7 +4864,9 @@ public static Builder builder() { public static class Builder { private Object customMandateUrl; - private List defaultFor; + private List< + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor> + defaultFor; private Map extraParams; @@ -4673,8 +4877,8 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions build() { + return new SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions( this.customMandateUrl, this.defaultFor, this.extraParams, @@ -4711,7 +4915,9 @@ public Builder setCustomMandateUrl(EmptyParam customMandateUrl) { * SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addDefaultFor(DefaultFor element) { + public Builder addDefaultFor( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor + element) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4725,7 +4931,9 @@ public Builder addDefaultFor(DefaultFor element) { * SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addAllDefaultFor(List elements) { + public Builder addAllDefaultFor( + List + elements) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4773,13 +4981,17 @@ public Builder setIntervalDescription(String intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions.PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.MandateOptions.TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -4901,8 +5113,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.code, this.extraParams); + public SetupIntentCreateParams.PaymentMethodOptions.Blik build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Blik(this.code, this.extraParams); } /** @@ -5017,8 +5229,8 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public SetupIntentCreateParams.PaymentMethodOptions.Card build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Card( this.extraParams, this.mandateOptions, this.moto, @@ -5055,7 +5267,8 @@ public Builder putAllExtraParam(Map map) { } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5074,7 +5287,8 @@ public Builder setMoto(Boolean moto) { * Selected network to process this SetupIntent on. Depends on the available networks of the * card attached to the SetupIntent. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + SetupIntentCreateParams.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -5090,7 +5304,9 @@ public Builder setNetwork(Network network) { * Secure for more information on how this configuration interacts with Radar and our * SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + SetupIntentCreateParams.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -5171,7 +5387,8 @@ public static class MandateOptions { /** Specifies the type of mandates supported. Possible values are {@code india}. */ @SerializedName("supported_types") - List supportedTypes; + List + supportedTypes; private MandateOptions( Long amount, @@ -5184,7 +5401,8 @@ private MandateOptions( Long intervalCount, String reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.currency = currency; @@ -5223,11 +5441,13 @@ public static class Builder { private Long startDate; - private List supportedTypes; + private List< + SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType> + supportedTypes; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions( this.amount, this.amountType, this.currency, @@ -5252,7 +5472,9 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.AmountType + amountType) { this.amountType = amountType; return this; } @@ -5320,7 +5542,8 @@ public Builder putAllExtraParam(Map map) { * Specifies payment frequency. One of {@code day}, {@code week}, {@code month}, {@code * year}, or {@code sporadic}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.Interval interval) { this.interval = interval; return this; } @@ -5358,7 +5581,9 @@ public Builder setStartDate(Long startDate) { * SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addSupportedType(SupportedType element) { + public Builder addSupportedType( + SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType + element) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5373,7 +5598,9 @@ public Builder addSupportedType(SupportedType element) { * SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addAllSupportedType(List elements) { + public Builder addAllSupportedType( + List + elements) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5519,8 +5746,9 @@ public static class Builder { private String persistentToken; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams, this.persistentToken); + public SetupIntentCreateParams.PaymentMethodOptions.Link build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Link( + this.extraParams, this.persistentToken); } /** @@ -5589,8 +5817,9 @@ public static class Builder { private MandateOptions mandateOptions; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.mandateOptions); + public SetupIntentCreateParams.PaymentMethodOptions.SepaDebit build() { + return new SetupIntentCreateParams.PaymentMethodOptions.SepaDebit( + this.extraParams, this.mandateOptions); } /** @@ -5622,7 +5851,8 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5652,8 +5882,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams); + public SetupIntentCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions build() { + return new SetupIntentCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions( + this.extraParams); } /** @@ -5737,8 +5968,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount build() { + return new SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.networks, this.verificationMethod); } @@ -5771,19 +6002,24 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Additional fields for network related functions. */ - public Builder setNetworks(Networks networks) { + public Builder setNetworks( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks networks) { this.networks = networks; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -5807,7 +6043,10 @@ public static class FinancialConnections { * {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; /** * For webview integrations only. Upon completing OAuth login in the native browser, the @@ -5817,7 +6056,12 @@ public static class FinancialConnections { String returnUrl; private FinancialConnections( - Map extraParams, List permissions, String returnUrl) { + Map extraParams, + List< + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions, + String returnUrl) { this.extraParams = extraParams; this.permissions = permissions; this.returnUrl = returnUrl; @@ -5830,13 +6074,18 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; private String returnUrl; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions, this.returnUrl); + public SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + build() { + return new SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions, this.returnUrl); } /** @@ -5875,7 +6124,10 @@ public Builder putAllExtraParam(Map map) { * SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -5890,7 +6142,11 @@ public Builder addPermission(Permission element) { * SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -5944,9 +6200,13 @@ public static class Networks { /** Triggers validations to run across the selected networks. */ @SerializedName("requested") - List requested; + List + requested; - private Networks(Map extraParams, List requested) { + private Networks( + Map extraParams, + List + requested) { this.extraParams = extraParams; this.requested = requested; } @@ -5958,11 +6218,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List requested; + private List< + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested> + requested; /** Finalize and obtain parameter instance from this builder. */ - public Networks build() { - return new Networks(this.extraParams, this.requested); + public SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks build() { + return new SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks( + this.extraParams, this.requested); } /** @@ -6001,7 +6264,9 @@ public Builder putAllExtraParam(Map map) { * SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addRequested(Requested element) { + public Builder addRequested( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested + element) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -6015,7 +6280,9 @@ public Builder addRequested(Requested element) { * SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addAllRequested(List elements) { + public Builder addAllRequested( + List + elements) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -6109,8 +6376,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public SingleUse build() { - return new SingleUse(this.amount, this.currency, this.extraParams); + public SetupIntentCreateParams.SingleUse build() { + return new SetupIntentCreateParams.SingleUse(this.amount, this.currency, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index e1dc506001e..bf87e5ea998 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -57,7 +57,7 @@ public class SetupIntentUpdateParams extends ApiRequestParams { * send funds to. You can include both if you intend to use the payment method for both purposes. */ @SerializedName("flow_directions") - List flowDirections; + List flowDirections; /** * Set of key-value pairs that you can attach @@ -100,7 +100,7 @@ private SetupIntentUpdateParams( Object description, List expand, Map extraParams, - List flowDirections, + List flowDirections, Object metadata, Object paymentMethod, PaymentMethodData paymentMethodData, @@ -134,7 +134,7 @@ public static class Builder { private Map extraParams; - private List flowDirections; + private List flowDirections; private Object metadata; @@ -269,7 +269,7 @@ public Builder putAllExtraParam(Map map) { * call, and subsequent calls adds additional elements to the original list. See {@link * SetupIntentUpdateParams#flowDirections} for the field documentation. */ - public Builder addFlowDirection(FlowDirection element) { + public Builder addFlowDirection(SetupIntentUpdateParams.FlowDirection element) { if (this.flowDirections == null) { this.flowDirections = new ArrayList<>(); } @@ -282,7 +282,7 @@ public Builder addFlowDirection(FlowDirection element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SetupIntentUpdateParams#flowDirections} for the field documentation. */ - public Builder addAllFlowDirection(List elements) { + public Builder addAllFlowDirection(List elements) { if (this.flowDirections == null) { this.flowDirections = new ArrayList<>(); } @@ -363,13 +363,15 @@ public Builder setPaymentMethod(EmptyParam paymentMethod) { * href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method">{@code * payment_method} value in the SetupIntent. */ - public Builder setPaymentMethodData(PaymentMethodData paymentMethodData) { + public Builder setPaymentMethodData( + SetupIntentUpdateParams.PaymentMethodData paymentMethodData) { this.paymentMethodData = paymentMethodData; return this; } /** Payment-method-specific configuration for this SetupIntent. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + SetupIntentUpdateParams.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -582,6 +584,20 @@ public static class PaymentMethodData { @SerializedName("paynow") Paynow paynow; + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + @SerializedName("paypal") + Paypal paypal; + + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + @SerializedName("pix") + Pix pix; + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the PromptPay * payment method. @@ -658,6 +674,8 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Paypal paypal, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -690,6 +708,8 @@ private PaymentMethodData( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; + this.pix = pix; this.promptpay = promptpay; this.radarOptions = radarOptions; this.sepaDebit = sepaDebit; @@ -754,6 +774,10 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -769,8 +793,8 @@ public static class Builder { private WechatPay wechatPay; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodData build() { - return new PaymentMethodData( + public SetupIntentUpdateParams.PaymentMethodData build() { + return new SetupIntentUpdateParams.PaymentMethodData( this.acssDebit, this.affirm, this.afterpayClearpay, @@ -796,6 +820,8 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.paypal, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -809,7 +835,7 @@ public PaymentMethodData build() { * If this is an {@code acss_debit} PaymentMethod, this hash contains details about the ACSS * Debit payment method. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit(SetupIntentUpdateParams.PaymentMethodData.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -818,7 +844,7 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is an {@code affirm} PaymentMethod, this hash contains details about the Affirm * payment method. */ - public Builder setAffirm(Affirm affirm) { + public Builder setAffirm(SetupIntentUpdateParams.PaymentMethodData.Affirm affirm) { this.affirm = affirm; return this; } @@ -827,7 +853,8 @@ public Builder setAffirm(Affirm affirm) { * If this is an {@code AfterpayClearpay} PaymentMethod, this hash contains details about the * AfterpayClearpay payment method. */ - public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { + public Builder setAfterpayClearpay( + SetupIntentUpdateParams.PaymentMethodData.AfterpayClearpay afterpayClearpay) { this.afterpayClearpay = afterpayClearpay; return this; } @@ -836,7 +863,7 @@ public Builder setAfterpayClearpay(AfterpayClearpay afterpayClearpay) { * If this is an {@code Alipay} PaymentMethod, this hash contains details about the Alipay * payment method. */ - public Builder setAlipay(Alipay alipay) { + public Builder setAlipay(SetupIntentUpdateParams.PaymentMethodData.Alipay alipay) { this.alipay = alipay; return this; } @@ -845,7 +872,8 @@ public Builder setAlipay(Alipay alipay) { * If this is an {@code au_becs_debit} PaymentMethod, this hash contains details about the * bank account. */ - public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { + public Builder setAuBecsDebit( + SetupIntentUpdateParams.PaymentMethodData.AuBecsDebit auBecsDebit) { this.auBecsDebit = auBecsDebit; return this; } @@ -854,7 +882,7 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) { * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs * Direct Debit bank account. */ - public Builder setBacsDebit(BacsDebit bacsDebit) { + public Builder setBacsDebit(SetupIntentUpdateParams.PaymentMethodData.BacsDebit bacsDebit) { this.bacsDebit = bacsDebit; return this; } @@ -863,7 +891,8 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { * If this is a {@code bancontact} PaymentMethod, this hash contains details about the * Bancontact payment method. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + SetupIntentUpdateParams.PaymentMethodData.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -872,7 +901,8 @@ public Builder setBancontact(Bancontact bancontact) { * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. */ - public Builder setBillingDetails(BillingDetails billingDetails) { + public Builder setBillingDetails( + SetupIntentUpdateParams.PaymentMethodData.BillingDetails billingDetails) { this.billingDetails = billingDetails; return this; } @@ -881,7 +911,7 @@ public Builder setBillingDetails(BillingDetails billingDetails) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentUpdateParams.PaymentMethodData.Blik blik) { this.blik = blik; return this; } @@ -890,7 +920,7 @@ public Builder setBlik(Blik blik) { * If this is a {@code boleto} PaymentMethod, this hash contains details about the Boleto * payment method. */ - public Builder setBoleto(Boleto boleto) { + public Builder setBoleto(SetupIntentUpdateParams.PaymentMethodData.Boleto boleto) { this.boleto = boleto; return this; } @@ -899,7 +929,8 @@ public Builder setBoleto(Boleto boleto) { * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + SetupIntentUpdateParams.PaymentMethodData.CustomerBalance customerBalance) { this.customerBalance = customerBalance; return this; } @@ -908,7 +939,7 @@ public Builder setCustomerBalance(CustomerBalance customerBalance) { * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment * method. */ - public Builder setEps(Eps eps) { + public Builder setEps(SetupIntentUpdateParams.PaymentMethodData.Eps eps) { this.eps = eps; return this; } @@ -944,7 +975,7 @@ public Builder putAllExtraParam(Map map) { * If this is an {@code fpx} PaymentMethod, this hash contains details about the FPX payment * method. */ - public Builder setFpx(Fpx fpx) { + public Builder setFpx(SetupIntentUpdateParams.PaymentMethodData.Fpx fpx) { this.fpx = fpx; return this; } @@ -953,7 +984,7 @@ public Builder setFpx(Fpx fpx) { * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. */ - public Builder setGiropay(Giropay giropay) { + public Builder setGiropay(SetupIntentUpdateParams.PaymentMethodData.Giropay giropay) { this.giropay = giropay; return this; } @@ -962,7 +993,7 @@ public Builder setGiropay(Giropay giropay) { * If this is a {@code grabpay} PaymentMethod, this hash contains details about the GrabPay * payment method. */ - public Builder setGrabpay(Grabpay grabpay) { + public Builder setGrabpay(SetupIntentUpdateParams.PaymentMethodData.Grabpay grabpay) { this.grabpay = grabpay; return this; } @@ -971,7 +1002,7 @@ public Builder setGrabpay(Grabpay grabpay) { * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL * payment method. */ - public Builder setIdeal(Ideal ideal) { + public Builder setIdeal(SetupIntentUpdateParams.PaymentMethodData.Ideal ideal) { this.ideal = ideal; return this; } @@ -980,7 +1011,8 @@ public Builder setIdeal(Ideal ideal) { * If this is an {@code interac_present} PaymentMethod, this hash contains details about the * Interac Present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + SetupIntentUpdateParams.PaymentMethodData.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -989,7 +1021,7 @@ public Builder setInteracPresent(InteracPresent interacPresent) { * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna * payment method. */ - public Builder setKlarna(Klarna klarna) { + public Builder setKlarna(SetupIntentUpdateParams.PaymentMethodData.Klarna klarna) { this.klarna = klarna; return this; } @@ -998,7 +1030,7 @@ public Builder setKlarna(Klarna klarna) { * If this is a {@code konbini} PaymentMethod, this hash contains details about the Konbini * payment method. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini(SetupIntentUpdateParams.PaymentMethodData.Konbini konbini) { this.konbini = konbini; return this; } @@ -1007,7 +1039,7 @@ public Builder setKonbini(Konbini konbini) { * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment * method. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentUpdateParams.PaymentMethodData.Link link) { this.link = link; return this; } @@ -1042,7 +1074,7 @@ public Builder putAllMetadata(Map map) { * If this is an {@code oxxo} PaymentMethod, this hash contains details about the OXXO payment * method. */ - public Builder setOxxo(Oxxo oxxo) { + public Builder setOxxo(SetupIntentUpdateParams.PaymentMethodData.Oxxo oxxo) { this.oxxo = oxxo; return this; } @@ -1051,7 +1083,7 @@ public Builder setOxxo(Oxxo oxxo) { * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment * method. */ - public Builder setP24(P24 p24) { + public Builder setP24(SetupIntentUpdateParams.PaymentMethodData.P24 p24) { this.p24 = p24; return this; } @@ -1060,16 +1092,34 @@ public Builder setP24(P24 p24) { * If this is a {@code paynow} PaymentMethod, this hash contains details about the PayNow * payment method. */ - public Builder setPaynow(Paynow paynow) { + public Builder setPaynow(SetupIntentUpdateParams.PaymentMethodData.Paynow paynow) { this.paynow = paynow; return this; } + /** + * If this is a {@code paypal} PaymentMethod, this hash contains details about the PayPal + * payment method. + */ + public Builder setPaypal(SetupIntentUpdateParams.PaymentMethodData.Paypal paypal) { + this.paypal = paypal; + return this; + } + + /** + * If this is a {@code pix} PaymentMethod, this hash contains details about the Pix payment + * method. + */ + public Builder setPix(SetupIntentUpdateParams.PaymentMethodData.Pix pix) { + this.pix = pix; + return this; + } + /** * If this is a {@code promptpay} PaymentMethod, this hash contains details about the * PromptPay payment method. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay(SetupIntentUpdateParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1078,7 +1128,8 @@ public Builder setPromptpay(Promptpay promptpay) { * Options to configure Radar. See Radar * Session for more information. */ - public Builder setRadarOptions(RadarOptions radarOptions) { + public Builder setRadarOptions( + SetupIntentUpdateParams.PaymentMethodData.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } @@ -1087,7 +1138,7 @@ public Builder setRadarOptions(RadarOptions radarOptions) { * If this is a {@code sepa_debit} PaymentMethod, this hash contains details about the SEPA * debit bank account. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit(SetupIntentUpdateParams.PaymentMethodData.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -1096,7 +1147,7 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code sofort} PaymentMethod, this hash contains details about the SOFORT * payment method. */ - public Builder setSofort(Sofort sofort) { + public Builder setSofort(SetupIntentUpdateParams.PaymentMethodData.Sofort sofort) { this.sofort = sofort; return this; } @@ -1106,7 +1157,7 @@ public Builder setSofort(Sofort sofort) { * name matching this value. It contains additional information specific to the PaymentMethod * type. */ - public Builder setType(Type type) { + public Builder setType(SetupIntentUpdateParams.PaymentMethodData.Type type) { this.type = type; return this; } @@ -1115,7 +1166,8 @@ public Builder setType(Type type) { * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentUpdateParams.PaymentMethodData.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -1124,7 +1176,7 @@ public Builder setUsBankAccount(UsBankAccount usBankAccount) { * If this is an {@code wechat_pay} PaymentMethod, this hash contains details about the * wechat_pay payment method. */ - public Builder setWechatPay(WechatPay wechatPay) { + public Builder setWechatPay(SetupIntentUpdateParams.PaymentMethodData.WechatPay wechatPay) { this.wechatPay = wechatPay; return this; } @@ -1178,8 +1230,8 @@ public static class Builder { private Object transitNumber; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentUpdateParams.PaymentMethodData.AcssDebit build() { + return new SetupIntentUpdateParams.PaymentMethodData.AcssDebit( this.accountNumber, this.extraParams, this.institutionNumber, this.transitNumber); } @@ -1272,8 +1324,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Affirm build() { - return new Affirm(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Affirm build() { + return new SetupIntentUpdateParams.PaymentMethodData.Affirm(this.extraParams); } /** @@ -1329,8 +1381,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AfterpayClearpay build() { - return new AfterpayClearpay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.AfterpayClearpay build() { + return new SetupIntentUpdateParams.PaymentMethodData.AfterpayClearpay(this.extraParams); } /** @@ -1386,8 +1438,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Alipay build() { - return new Alipay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Alipay build() { + return new SetupIntentUpdateParams.PaymentMethodData.Alipay(this.extraParams); } /** @@ -1457,8 +1509,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AuBecsDebit build() { - return new AuBecsDebit(this.accountNumber, this.bsbNumber, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.AuBecsDebit build() { + return new SetupIntentUpdateParams.PaymentMethodData.AuBecsDebit( + this.accountNumber, this.bsbNumber, this.extraParams); } /** The account number for the bank account. */ @@ -1552,8 +1605,9 @@ public static class Builder { private Object sortCode; /** Finalize and obtain parameter instance from this builder. */ - public BacsDebit build() { - return new BacsDebit(this.accountNumber, this.extraParams, this.sortCode); + public SetupIntentUpdateParams.PaymentMethodData.BacsDebit build() { + return new SetupIntentUpdateParams.PaymentMethodData.BacsDebit( + this.accountNumber, this.extraParams, this.sortCode); } /** Account number of the bank account that the funds will be debited from. */ @@ -1633,8 +1687,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Bancontact build() { + return new SetupIntentUpdateParams.PaymentMethodData.Bancontact(this.extraParams); } /** @@ -1723,13 +1777,14 @@ public static class Builder { private Object phone; /** Finalize and obtain parameter instance from this builder. */ - public BillingDetails build() { - return new BillingDetails( + public SetupIntentUpdateParams.PaymentMethodData.BillingDetails build() { + return new SetupIntentUpdateParams.PaymentMethodData.BillingDetails( this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ - public Builder setAddress(Address address) { + public Builder setAddress( + SetupIntentUpdateParams.PaymentMethodData.BillingDetails.Address address) { this.address = address; return this; } @@ -1881,8 +1936,8 @@ public static class Builder { private Object state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public SetupIntentUpdateParams.PaymentMethodData.BillingDetails.Address build() { + return new SetupIntentUpdateParams.PaymentMethodData.BillingDetails.Address( this.city, this.country, this.extraParams, @@ -2026,8 +2081,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Blik build() { + return new SetupIntentUpdateParams.PaymentMethodData.Blik(this.extraParams); } /** @@ -2092,8 +2147,8 @@ public static class Builder { private Object taxId; /** Finalize and obtain parameter instance from this builder. */ - public Boleto build() { - return new Boleto(this.extraParams, this.taxId); + public SetupIntentUpdateParams.PaymentMethodData.Boleto build() { + return new SetupIntentUpdateParams.PaymentMethodData.Boleto(this.extraParams, this.taxId); } /** @@ -2167,8 +2222,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.CustomerBalance build() { + return new SetupIntentUpdateParams.PaymentMethodData.CustomerBalance(this.extraParams); } /** @@ -2231,12 +2286,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Eps build() { - return new Eps(this.bank, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Eps build() { + return new SetupIntentUpdateParams.PaymentMethodData.Eps(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentUpdateParams.PaymentMethodData.Eps.Bank bank) { this.bank = bank; return this; } @@ -2301,6 +2356,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("capital_bank_grawe_gruppe_ag") CAPITAL_BANK_GRAWE_GRUPPE_AG("capital_bank_grawe_gruppe_ag"), + @SerializedName("deutsche_bank_ag") + DEUTSCHE_BANK_AG("deutsche_bank_ag"), + @SerializedName("dolomitenbank") DOLOMITENBANK("dolomitenbank"), @@ -2398,18 +2456,20 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Fpx build() { - return new Fpx(this.accountHolderType, this.bank, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Fpx build() { + return new SetupIntentUpdateParams.PaymentMethodData.Fpx( + this.accountHolderType, this.bank, this.extraParams); } /** Account holder type for FPX transaction. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentUpdateParams.PaymentMethodData.Fpx.AccountHolderType accountHolderType) { this.accountHolderType = accountHolderType; return this; } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentUpdateParams.PaymentMethodData.Fpx.Bank bank) { this.bank = bank; return this; } @@ -2554,8 +2614,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Giropay build() { - return new Giropay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Giropay build() { + return new SetupIntentUpdateParams.PaymentMethodData.Giropay(this.extraParams); } /** @@ -2611,8 +2671,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Grabpay build() { - return new Grabpay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Grabpay build() { + return new SetupIntentUpdateParams.PaymentMethodData.Grabpay(this.extraParams); } /** @@ -2675,12 +2735,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ideal build() { - return new Ideal(this.bank, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Ideal build() { + return new SetupIntentUpdateParams.PaymentMethodData.Ideal(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentUpdateParams.PaymentMethodData.Ideal.Bank bank) { this.bank = bank; return this; } @@ -2786,8 +2846,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.InteracPresent build() { + return new SetupIntentUpdateParams.PaymentMethodData.InteracPresent(this.extraParams); } /** @@ -2850,12 +2910,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Klarna build() { - return new Klarna(this.dob, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Klarna build() { + return new SetupIntentUpdateParams.PaymentMethodData.Klarna(this.dob, this.extraParams); } /** Customer's date of birth. */ - public Builder setDob(Dob dob) { + public Builder setDob(SetupIntentUpdateParams.PaymentMethodData.Klarna.Dob dob) { this.dob = dob; return this; } @@ -2934,8 +2994,9 @@ public static class Builder { private Long year; /** Finalize and obtain parameter instance from this builder. */ - public Dob build() { - return new Dob(this.day, this.extraParams, this.month, this.year); + public SetupIntentUpdateParams.PaymentMethodData.Klarna.Dob build() { + return new SetupIntentUpdateParams.PaymentMethodData.Klarna.Dob( + this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -3010,8 +3071,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Konbini build() { + return new SetupIntentUpdateParams.PaymentMethodData.Konbini(this.extraParams); } /** @@ -3067,8 +3128,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Link build() { + return new SetupIntentUpdateParams.PaymentMethodData.Link(this.extraParams); } /** @@ -3124,8 +3185,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Oxxo build() { - return new Oxxo(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Oxxo build() { + return new SetupIntentUpdateParams.PaymentMethodData.Oxxo(this.extraParams); } /** @@ -3188,12 +3249,12 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public P24 build() { - return new P24(this.bank, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.P24 build() { + return new SetupIntentUpdateParams.PaymentMethodData.P24(this.bank, this.extraParams); } /** The customer's bank. */ - public Builder setBank(Bank bank) { + public Builder setBank(SetupIntentUpdateParams.PaymentMethodData.P24.Bank bank) { this.bank = bank; return this; } @@ -3335,8 +3396,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Paynow build() { - return new Paynow(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Paynow build() { + return new SetupIntentUpdateParams.PaymentMethodData.Paynow(this.extraParams); } /** @@ -3369,6 +3430,120 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Paypal { + /** + * 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 Paypal(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodData.Paypal build() { + return new SetupIntentUpdateParams.PaymentMethodData.Paypal(this.extraParams); + } + + /** + * 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.Paypal#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.Paypal#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 + public static class Pix { + /** + * 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 Pix(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodData.Pix build() { + return new SetupIntentUpdateParams.PaymentMethodData.Pix(this.extraParams); + } + + /** + * 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.Pix#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.Pix#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 public static class Promptpay { /** @@ -3392,8 +3567,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Promptpay build() { - return new Promptpay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Promptpay build() { + return new SetupIntentUpdateParams.PaymentMethodData.Promptpay(this.extraParams); } /** @@ -3460,8 +3635,9 @@ public static class Builder { private Object session; /** Finalize and obtain parameter instance from this builder. */ - public RadarOptions build() { - return new RadarOptions(this.extraParams, this.session); + public SetupIntentUpdateParams.PaymentMethodData.RadarOptions build() { + return new SetupIntentUpdateParams.PaymentMethodData.RadarOptions( + this.extraParams, this.session); } /** @@ -3544,8 +3720,9 @@ public static class Builder { private Object iban; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.iban); + public SetupIntentUpdateParams.PaymentMethodData.SepaDebit build() { + return new SetupIntentUpdateParams.PaymentMethodData.SepaDebit( + this.extraParams, this.iban); } /** @@ -3620,12 +3797,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Sofort build() { - return new Sofort(this.country, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.Sofort build() { + return new SetupIntentUpdateParams.PaymentMethodData.Sofort( + this.country, this.extraParams); } /** Two-letter ISO code representing the country the bank account is located in. */ - public Builder setCountry(Country country) { + public Builder setCountry( + SetupIntentUpdateParams.PaymentMethodData.Sofort.Country country) { this.country = country; return this; } @@ -3751,8 +3930,8 @@ public static class Builder { private Object routingNumber; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentUpdateParams.PaymentMethodData.UsBankAccount build() { + return new SetupIntentUpdateParams.PaymentMethodData.UsBankAccount( this.accountHolderType, this.accountNumber, this.accountType, @@ -3762,7 +3941,9 @@ public UsBankAccount build() { } /** Account holder type: individual or company. */ - public Builder setAccountHolderType(AccountHolderType accountHolderType) { + public Builder setAccountHolderType( + SetupIntentUpdateParams.PaymentMethodData.UsBankAccount.AccountHolderType + accountHolderType) { this.accountHolderType = accountHolderType; return this; } @@ -3780,7 +3961,8 @@ public Builder setAccountNumber(EmptyParam accountNumber) { } /** Account type: checkings or savings. Defaults to checking if omitted. */ - public Builder setAccountType(AccountType accountType) { + public Builder setAccountType( + SetupIntentUpdateParams.PaymentMethodData.UsBankAccount.AccountType accountType) { this.accountType = accountType; return this; } @@ -3892,8 +4074,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public WechatPay build() { - return new WechatPay(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodData.WechatPay build() { + return new SetupIntentUpdateParams.PaymentMethodData.WechatPay(this.extraParams); } /** @@ -3990,6 +4172,12 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), @@ -4101,8 +4289,8 @@ public static class Builder { private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public SetupIntentUpdateParams.PaymentMethodOptions build() { + return new SetupIntentUpdateParams.PaymentMethodOptions( this.acssDebit, this.blik, this.card, @@ -4116,7 +4304,8 @@ public PaymentMethodOptions build() { * If this is a {@code acss_debit} SetupIntent, this sub-hash contains details about the ACSS * Debit payment method options. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -4125,13 +4314,13 @@ public Builder setAcssDebit(AcssDebit acssDebit) { * If this is a {@code blik} PaymentMethod, this hash contains details about the BLIK payment * method. */ - public Builder setBlik(Blik blik) { + public Builder setBlik(SetupIntentUpdateParams.PaymentMethodOptions.Blik blik) { this.blik = blik; return this; } /** Configuration for any card setup attempted on this SetupIntent. */ - public Builder setCard(Card card) { + public Builder setCard(SetupIntentUpdateParams.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -4167,7 +4356,7 @@ public Builder putAllExtraParam(Map map) { * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. */ - public Builder setLink(Link link) { + public Builder setLink(SetupIntentUpdateParams.PaymentMethodOptions.Link link) { this.link = link; return this; } @@ -4176,7 +4365,8 @@ public Builder setLink(Link link) { * If this is a {@code sepa_debit} SetupIntent, this sub-hash contains details about the SEPA * Debit payment method options. */ - public Builder setSepaDebit(SepaDebit sepaDebit) { + public Builder setSepaDebit( + SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit sepaDebit) { this.sepaDebit = sepaDebit; return this; } @@ -4185,7 +4375,8 @@ public Builder setSepaDebit(SepaDebit sepaDebit) { * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the * US bank account payment method options. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -4243,8 +4434,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit( + public SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit( this.currency, this.extraParams, this.mandateOptions, this.verificationMethod); } @@ -4253,7 +4444,8 @@ public AcssDebit build() { * code, in lowercase. Must be a supported * currency. */ - public Builder setCurrency(Currency currency) { + public Builder setCurrency( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.Currency currency) { this.currency = currency; return this; } @@ -4287,13 +4479,16 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -4312,7 +4507,8 @@ public static class MandateOptions { /** List of Stripe products where this mandate can be selected automatically. */ @SerializedName("default_for") - List defaultFor; + List + defaultFor; /** * Map of extra parameters for custom features not available in this client library. The @@ -4341,7 +4537,8 @@ public static class MandateOptions { private MandateOptions( Object customMandateUrl, - List defaultFor, + List + defaultFor, Map extraParams, Object intervalDescription, PaymentSchedule paymentSchedule, @@ -4361,7 +4558,9 @@ public static Builder builder() { public static class Builder { private Object customMandateUrl; - private List defaultFor; + private List< + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor> + defaultFor; private Map extraParams; @@ -4372,8 +4571,8 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions( this.customMandateUrl, this.defaultFor, this.extraParams, @@ -4410,7 +4609,9 @@ public Builder setCustomMandateUrl(EmptyParam customMandateUrl) { * SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addDefaultFor(DefaultFor element) { + public Builder addDefaultFor( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions.DefaultFor + element) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4424,7 +4625,9 @@ public Builder addDefaultFor(DefaultFor element) { * SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions#defaultFor} for * the field documentation. */ - public Builder addAllDefaultFor(List elements) { + public Builder addAllDefaultFor( + List + elements) { if (this.defaultFor == null) { this.defaultFor = new ArrayList<>(); } @@ -4481,13 +4684,17 @@ public Builder setIntervalDescription(EmptyParam intervalDescription) { } /** Payment schedule for the mandate. */ - public Builder setPaymentSchedule(PaymentSchedule paymentSchedule) { + public Builder setPaymentSchedule( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions.PaymentSchedule + paymentSchedule) { this.paymentSchedule = paymentSchedule; return this; } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.MandateOptions.TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -4609,8 +4816,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Blik build() { - return new Blik(this.code, this.extraParams); + public SetupIntentUpdateParams.PaymentMethodOptions.Blik build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Blik(this.code, this.extraParams); } /** @@ -4734,8 +4941,8 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public SetupIntentUpdateParams.PaymentMethodOptions.Card build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Card( this.extraParams, this.mandateOptions, this.moto, @@ -4772,7 +4979,8 @@ public Builder putAllExtraParam(Map map) { } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -4791,7 +4999,8 @@ public Builder setMoto(Boolean moto) { * Selected network to process this SetupIntent on. Depends on the available networks of the * card attached to the SetupIntent. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + SetupIntentUpdateParams.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -4807,7 +5016,9 @@ public Builder setNetwork(Network network) { * Secure for more information on how this configuration interacts with Radar and our * SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + SetupIntentUpdateParams.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -4888,7 +5099,8 @@ public static class MandateOptions { /** Specifies the type of mandates supported. Possible values are {@code india}. */ @SerializedName("supported_types") - List supportedTypes; + List + supportedTypes; private MandateOptions( Long amount, @@ -4901,7 +5113,8 @@ private MandateOptions( Long intervalCount, Object reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.currency = currency; @@ -4940,11 +5153,13 @@ public static class Builder { private Long startDate; - private List supportedTypes; + private List< + SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType> + supportedTypes; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( + public SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions( this.amount, this.amountType, this.currency, @@ -4969,7 +5184,9 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.AmountType + amountType) { this.amountType = amountType; return this; } @@ -5057,7 +5274,8 @@ public Builder putAllExtraParam(Map map) { * Specifies payment frequency. One of {@code day}, {@code week}, {@code month}, {@code * year}, or {@code sporadic}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.Interval interval) { this.interval = interval; return this; } @@ -5101,7 +5319,9 @@ public Builder setStartDate(Long startDate) { * SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addSupportedType(SupportedType element) { + public Builder addSupportedType( + SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions.SupportedType + element) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5116,7 +5336,9 @@ public Builder addSupportedType(SupportedType element) { * SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions#supportedTypes} for * the field documentation. */ - public Builder addAllSupportedType(List elements) { + public Builder addAllSupportedType( + List + elements) { if (this.supportedTypes == null) { this.supportedTypes = new ArrayList<>(); } @@ -5262,8 +5484,9 @@ public static class Builder { private Object persistentToken; /** Finalize and obtain parameter instance from this builder. */ - public Link build() { - return new Link(this.extraParams, this.persistentToken); + public SetupIntentUpdateParams.PaymentMethodOptions.Link build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Link( + this.extraParams, this.persistentToken); } /** @@ -5338,8 +5561,9 @@ public static class Builder { private MandateOptions mandateOptions; /** Finalize and obtain parameter instance from this builder. */ - public SepaDebit build() { - return new SepaDebit(this.extraParams, this.mandateOptions); + public SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit( + this.extraParams, this.mandateOptions); } /** @@ -5371,7 +5595,8 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit.MandateOptions mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -5401,8 +5626,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams); + public SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit.MandateOptions build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.SepaDebit.MandateOptions( + this.extraParams); } /** @@ -5486,8 +5712,8 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.networks, this.verificationMethod); } @@ -5520,19 +5746,24 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Additional fields for network related functions. */ - public Builder setNetworks(Networks networks) { + public Builder setNetworks( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks networks) { this.networks = networks; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -5556,7 +5787,10 @@ public static class FinancialConnections { * {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; /** * For webview integrations only. Upon completing OAuth login in the native browser, the @@ -5566,7 +5800,12 @@ public static class FinancialConnections { Object returnUrl; private FinancialConnections( - Map extraParams, List permissions, Object returnUrl) { + Map extraParams, + List< + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions, + Object returnUrl) { this.extraParams = extraParams; this.permissions = permissions; this.returnUrl = returnUrl; @@ -5579,13 +5818,18 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission> + permissions; private Object returnUrl; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions, this.returnUrl); + public SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions, this.returnUrl); } /** @@ -5624,7 +5868,10 @@ public Builder putAllExtraParam(Map map) { * SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections + .Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -5639,7 +5886,11 @@ public Builder addPermission(Permission element) { * SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -5702,9 +5953,13 @@ public static class Networks { /** Triggers validations to run across the selected networks. */ @SerializedName("requested") - List requested; + List + requested; - private Networks(Map extraParams, List requested) { + private Networks( + Map extraParams, + List + requested) { this.extraParams = extraParams; this.requested = requested; } @@ -5716,11 +5971,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List requested; + private List< + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested> + requested; /** Finalize and obtain parameter instance from this builder. */ - public Networks build() { - return new Networks(this.extraParams, this.requested); + public SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks( + this.extraParams, this.requested); } /** @@ -5759,7 +6017,9 @@ public Builder putAllExtraParam(Map map) { * SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addRequested(Requested element) { + public Builder addRequested( + SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks.Requested + element) { if (this.requested == null) { this.requested = new ArrayList<>(); } @@ -5773,7 +6033,9 @@ public Builder addRequested(Requested element) { * SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.Networks#requested} for the * field documentation. */ - public Builder addAllRequested(List elements) { + public Builder addAllRequested( + List + elements) { if (this.requested == null) { this.requested = new ArrayList<>(); } diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index 945671c9980..44d5b5297ee 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -18,7 +18,7 @@ public class SubscriptionCreateParams extends ApiRequestParams { * for this subscription. You may pass up to 20 items. */ @SerializedName("add_invoice_items") - List addInvoiceItems; + List addInvoiceItems; /** * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the @@ -171,7 +171,7 @@ public class SubscriptionCreateParams extends ApiRequestParams { /** A list of up to 20 subscription items, each with an attached price. */ @SerializedName("items") - List items; + List items; /** * Set of key-value pairs that you can attach @@ -288,7 +288,7 @@ public class SubscriptionCreateParams extends ApiRequestParams { Long trialPeriodDays; private SubscriptionCreateParams( - List addInvoiceItems, + List addInvoiceItems, BigDecimal applicationFeePercent, AutomaticTax automaticTax, Long backdateStartDate, @@ -308,7 +308,7 @@ private SubscriptionCreateParams( Object discounts, List expand, Map extraParams, - List items, + List items, Object metadata, Boolean offSession, PaymentBehavior paymentBehavior, @@ -361,7 +361,7 @@ public static Builder builder() { } public static class Builder { - private List addInvoiceItems; + private List addInvoiceItems; private BigDecimal applicationFeePercent; @@ -401,7 +401,7 @@ public static class Builder { private Map extraParams; - private List items; + private List items; private Object metadata; @@ -470,7 +470,7 @@ public SubscriptionCreateParams build() { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionCreateParams#addInvoiceItems} for the field documentation. */ - public Builder addAddInvoiceItem(AddInvoiceItem element) { + public Builder addAddInvoiceItem(SubscriptionCreateParams.AddInvoiceItem element) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -483,7 +483,7 @@ public Builder addAddInvoiceItem(AddInvoiceItem element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionCreateParams#addInvoiceItems} for the field documentation. */ - public Builder addAllAddInvoiceItem(List elements) { + public Builder addAllAddInvoiceItem(List elements) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -508,7 +508,7 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { * Automatic tax settings for this subscription. We recommend you only include this parameter * when the existing value is being changed. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(SubscriptionCreateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -539,7 +539,8 @@ public Builder setBillingCycleAnchor(Long billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionCreateParams.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -578,7 +579,7 @@ public Builder setCancelAtPeriodEnd(Boolean cancelAtPeriodEnd) { * attached to the customer. When sending an invoice, Stripe will email your customer an invoice * with payment instructions. Defaults to {@code charge_automatically}. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(SubscriptionCreateParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -707,7 +708,7 @@ public Builder setDescription(String description) { * SubscriptionCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionCreateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -721,7 +722,7 @@ public Builder addDiscount(Discount element) { * SubscriptionCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -742,7 +743,7 @@ public Builder setDiscounts(EmptyParam discounts) { * The coupons to redeem into discounts for the subscription. If not specified or empty, * inherits the discount from the subscription's customer. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -804,7 +805,7 @@ public Builder putAllExtraParam(Map map) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionCreateParams#items} for the field documentation. */ - public Builder addItem(Item element) { + public Builder addItem(SubscriptionCreateParams.Item element) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -817,7 +818,7 @@ public Builder addItem(Item element) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionCreateParams#items} for the field documentation. */ - public Builder addAllItem(List elements) { + public Builder addAllItem(List elements) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -909,13 +910,13 @@ public Builder setOffSession(Boolean offSession) { *

{@code pending_if_incomplete} is only used with updates and cannot be passed when creating * a subscription. */ - public Builder setPaymentBehavior(PaymentBehavior paymentBehavior) { + public Builder setPaymentBehavior(SubscriptionCreateParams.PaymentBehavior paymentBehavior) { this.paymentBehavior = paymentBehavior; return this; } /** Payment settings to pass to invoices created by the subscription. */ - public Builder setPaymentSettings(PaymentSettings paymentSettings) { + public Builder setPaymentSettings(SubscriptionCreateParams.PaymentSettings paymentSettings) { this.paymentSettings = paymentSettings; return this; } @@ -926,7 +927,7 @@ public Builder setPaymentSettings(PaymentSettings paymentSettings) { * given subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval( - PendingInvoiceItemInterval pendingInvoiceItemInterval) { + SubscriptionCreateParams.PendingInvoiceItemInterval pendingInvoiceItemInterval) { this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; return this; } @@ -942,7 +943,7 @@ public Builder setPendingInvoiceItemInterval(EmptyParam pendingInvoiceItemInterv } /** If specified, the invoicing for the given billing cycle iterations will be processed now. */ - public Builder setPrebilling(Prebilling prebilling) { + public Builder setPrebilling(SubscriptionCreateParams.Prebilling prebilling) { this.prebilling = prebilling; return this; } @@ -962,7 +963,8 @@ public Builder setPromotionCode(String promotionCode) { * resulting from the {@code billing_cycle_anchor}. If no value is passed, the default is {@code * create_prorations}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionCreateParams.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -971,7 +973,7 @@ public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { * If specified, the funds from the subscription's invoices will be transferred to the * destination and the ID of the resulting transfers will be found on the resulting charges. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(SubscriptionCreateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -985,7 +987,7 @@ public Builder setTransferData(TransferData transferData) { * Using trial periods on * subscriptions to learn more. */ - public Builder setTrialEnd(TrialEnd trialEnd) { + public Builder setTrialEnd(SubscriptionCreateParams.TrialEnd trialEnd) { this.trialEnd = trialEnd; return this; } @@ -1032,7 +1034,7 @@ public Builder setTrialPeriodDays(Long trialPeriodDays) { public static class AddInvoiceItem { /** The coupons to redeem into discounts for the item. */ @SerializedName("discounts") - List discounts; + List discounts; /** * Map of extra parameters for custom features not available in this client library. The content @@ -1066,7 +1068,7 @@ public static class AddInvoiceItem { Object taxRates; private AddInvoiceItem( - List discounts, + List discounts, Map extraParams, String price, PriceData priceData, @@ -1085,7 +1087,7 @@ public static Builder builder() { } public static class Builder { - private List discounts; + private List discounts; private Map extraParams; @@ -1098,8 +1100,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public AddInvoiceItem build() { - return new AddInvoiceItem( + public SubscriptionCreateParams.AddInvoiceItem build() { + return new SubscriptionCreateParams.AddInvoiceItem( this.discounts, this.extraParams, this.price, @@ -1113,7 +1115,7 @@ public AddInvoiceItem build() { * and subsequent calls adds additional elements to the original list. See {@link * SubscriptionCreateParams.AddInvoiceItem#discounts} for the field documentation. */ - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionCreateParams.AddInvoiceItem.Discount element) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -1126,7 +1128,8 @@ public Builder addDiscount(Discount element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionCreateParams.AddInvoiceItem#discounts} for the field documentation. */ - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount( + List elements) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -1171,7 +1174,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(SubscriptionCreateParams.AddInvoiceItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1266,8 +1269,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionCreateParams.AddInvoiceItem.Discount build() { + return new SubscriptionCreateParams.AddInvoiceItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1391,8 +1395,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionCreateParams.AddInvoiceItem.PriceData build() { + return new SubscriptionCreateParams.AddInvoiceItem.PriceData( this.currency, this.extraParams, this.product, @@ -1450,7 +1454,8 @@ public Builder setProduct(String product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionCreateParams.AddInvoiceItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -1528,8 +1533,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionCreateParams.AutomaticTax build() { + return new SubscriptionCreateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -1611,8 +1616,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionCreateParams.BillingThresholds build() { + return new SubscriptionCreateParams.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -1698,8 +1703,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionCreateParams.Discount build() { + return new SubscriptionCreateParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1855,8 +1860,8 @@ public static class Builder { private Trial trial; /** Finalize and obtain parameter instance from this builder. */ - public Item build() { - return new Item( + public SubscriptionCreateParams.Item build() { + return new SubscriptionCreateParams.Item( this.billingThresholds, this.discounts, this.extraParams, @@ -1874,7 +1879,8 @@ public Item build() { * billing period. When updating, pass an empty string to remove previously-defined * thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionCreateParams.Item.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -1895,7 +1901,7 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * SubscriptionCreateParams.Item#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionCreateParams.Item.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1909,7 +1915,7 @@ public Builder addDiscount(Discount element) { * SubscriptionCreateParams.Item#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1924,7 +1930,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The coupons to redeem into discounts for the subscription item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -1997,7 +2003,7 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(SubscriptionCreateParams.Item.PriceData priceData) { this.priceData = priceData; return this; } @@ -2061,7 +2067,7 @@ public Builder setTaxRates(List taxRates) { } /** Define options to configure the trial on the subscription item. */ - public Builder setTrial(Trial trial) { + public Builder setTrial(SubscriptionCreateParams.Item.Trial trial) { this.trial = trial; return this; } @@ -2097,8 +2103,9 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public SubscriptionCreateParams.Item.BillingThresholds build() { + return new SubscriptionCreateParams.Item.BillingThresholds( + this.extraParams, this.usageGte); } /** @@ -2174,8 +2181,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionCreateParams.Item.Discount build() { + return new SubscriptionCreateParams.Item.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2309,8 +2317,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionCreateParams.Item.PriceData build() { + return new SubscriptionCreateParams.Item.PriceData( this.currency, this.extraParams, this.product, @@ -2367,7 +2375,7 @@ public Builder setProduct(String product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(SubscriptionCreateParams.Item.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -2377,7 +2385,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionCreateParams.Item.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2447,8 +2456,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public SubscriptionCreateParams.Item.PriceData.Recurring build() { + return new SubscriptionCreateParams.Item.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -2483,7 +2493,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionCreateParams.Item.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -2570,8 +2581,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Trial build() { - return new Trial(this.extraParams, this.type); + public SubscriptionCreateParams.Item.Trial build() { + return new SubscriptionCreateParams.Item.Trial(this.extraParams, this.type); } /** @@ -2603,7 +2614,7 @@ public Builder putAllExtraParam(Map map) { } /** Determines the type of trial for this item. */ - public Builder setType(Type type) { + public Builder setType(SubscriptionCreateParams.Item.Trial.Type type) { this.type = type; return this; } @@ -2683,8 +2694,8 @@ public static class Builder { private SaveDefaultPaymentMethod saveDefaultPaymentMethod; /** Finalize and obtain parameter instance from this builder. */ - public PaymentSettings build() { - return new PaymentSettings( + public SubscriptionCreateParams.PaymentSettings build() { + return new SubscriptionCreateParams.PaymentSettings( this.extraParams, this.paymentMethodOptions, this.paymentMethodTypes, @@ -2721,7 +2732,8 @@ public Builder putAllExtraParam(Map map) { /** * Payment-method-specific configuration to provide to invoices created by the subscription. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -2733,7 +2745,8 @@ public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions * documentation. */ @SuppressWarnings("unchecked") - public Builder addPaymentMethodType(PaymentMethodType element) { + public Builder addPaymentMethodType( + SubscriptionCreateParams.PaymentSettings.PaymentMethodType element) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -2750,7 +2763,8 @@ public Builder addPaymentMethodType(PaymentMethodType element) { * documentation. */ @SuppressWarnings("unchecked") - public Builder addAllPaymentMethodType(List elements) { + public Builder addAllPaymentMethodType( + List elements) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -2779,7 +2793,8 @@ public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) { * default payment method, and your invoice template settings. */ - public Builder setPaymentMethodTypes(List paymentMethodTypes) { + public Builder setPaymentMethodTypes( + List paymentMethodTypes) { this.paymentMethodTypes = paymentMethodTypes; return this; } @@ -2789,7 +2804,8 @@ public Builder setPaymentMethodTypes(List paymentMethodTypes) * {@code subscription.default_payment_method} when a subscription payment succeeds. */ public Builder setSaveDefaultPaymentMethod( - SaveDefaultPaymentMethod saveDefaultPaymentMethod) { + SubscriptionCreateParams.PaymentSettings.SaveDefaultPaymentMethod + saveDefaultPaymentMethod) { this.saveDefaultPaymentMethod = saveDefaultPaymentMethod; return this; } @@ -2885,8 +2901,8 @@ public static class Builder { private Object usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions( this.acssDebit, this.bancontact, this.card, @@ -2900,7 +2916,8 @@ public PaymentMethodOptions build() { * This sub-hash contains details about the Canadian pre-authorized debit payment method * options to pass to the invoice’s PaymentIntent. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -2918,7 +2935,8 @@ public Builder setAcssDebit(EmptyParam acssDebit) { * This sub-hash contains details about the Bancontact payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -2936,7 +2954,8 @@ public Builder setBancontact(EmptyParam bancontact) { * This sub-hash contains details about the Card payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setCard(Card card) { + public Builder setCard( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -2954,7 +2973,9 @@ public Builder setCard(EmptyParam card) { * This sub-hash contains details about the Bank transfer payment method options to pass to * the invoice’s PaymentIntent. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + customerBalance) { this.customerBalance = customerBalance; return this; } @@ -3002,7 +3023,8 @@ public Builder putAllExtraParam(Map map) { * This sub-hash contains details about the Konbini payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Konbini konbini) { this.konbini = konbini; return this; } @@ -3020,7 +3042,9 @@ public Builder setKonbini(EmptyParam konbini) { * This sub-hash contains details about the ACH direct debit payment method options to pass * to the invoice’s PaymentIntent. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -3076,8 +3100,9 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit(this.extraParams, this.mandateOptions, this.verificationMethod); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit( + this.extraParams, this.mandateOptions, this.verificationMethod); } /** @@ -3111,13 +3136,18 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -3154,8 +3184,11 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams, this.transactionType); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions(this.extraParams, this.transactionType); } /** @@ -3189,7 +3222,10 @@ public Builder putAllExtraParam(Map map) { } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions.TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -3264,8 +3300,9 @@ public static class Builder { private PreferredLanguage preferredLanguage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams, this.preferredLanguage); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact( + this.extraParams, this.preferredLanguage); } /** @@ -3302,7 +3339,10 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Bancontact authorization page that the customer is redirected * to. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact + .PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -3391,8 +3431,8 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card( this.extraParams, this.mandateOptions, this.network, this.requestThreeDSecure); } @@ -3427,7 +3467,9 @@ public Builder putAllExtraParam(Map map) { } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -3436,7 +3478,8 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * Selected network to process this Subscription on. Depends on the available networks of * the card attached to the Subscription. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -3451,7 +3494,9 @@ public Builder setNetwork(Network network) { * 3D Secure for more information on how this configuration interacts with Radar and * our SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -3513,9 +3558,10 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( - this.amount, this.amountType, this.description, this.extraParams); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card + .MandateOptions(this.amount, this.amountType, this.description, this.extraParams); } /** Amount to be charged for future payments. */ @@ -3529,7 +3575,10 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + .AmountType + amountType) { this.amountType = amountType; return this; } @@ -3690,15 +3739,20 @@ public static class Builder { private String fundingType; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.bankTransfer, this.extraParams, this.fundingType); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance(this.bankTransfer, this.extraParams, this.fundingType); } /** * Configuration for the bank transfer funding type, if the {@code funding_type} is set to * {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer + bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -3786,12 +3840,18 @@ public static class Builder { private String type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer(this.euBankTransfer, this.extraParams, this.type); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance.BankTransfer(this.euBankTransfer, this.extraParams, this.type); } /** Configuration for eu_bank_transfer funding type. */ - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -3871,8 +3931,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance.BankTransfer.EuBankTransfer(this.country, this.extraParams); } /** @@ -3942,8 +4005,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Konbini build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Konbini( + this.extraParams); } /** @@ -4019,8 +4083,9 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.verificationMethod); } @@ -4055,13 +4120,19 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -4085,10 +4156,17 @@ public static class FinancialConnections { * balances}, {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; private FinancialConnections( - Map extraParams, List permissions) { + Map extraParams, + List< + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions) { this.extraParams = extraParams; this.permissions = permissions; } @@ -4100,11 +4178,17 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions); + public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + build() { + return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions); } /** @@ -4144,7 +4228,10 @@ public Builder putAllExtraParam(Map map) { * SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -4159,7 +4246,11 @@ public Builder addPermission(Permission element) { * SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -4346,8 +4437,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public PendingInvoiceItemInterval build() { - return new PendingInvoiceItemInterval(this.extraParams, this.interval, this.intervalCount); + public SubscriptionCreateParams.PendingInvoiceItemInterval build() { + return new SubscriptionCreateParams.PendingInvoiceItemInterval( + this.extraParams, this.interval, this.intervalCount); } /** @@ -4382,7 +4474,8 @@ public Builder putAllExtraParam(Map map) { * Specifies invoicing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionCreateParams.PendingInvoiceItemInterval.Interval interval) { this.interval = interval; return this; } @@ -4450,8 +4543,8 @@ public static class Builder { private Long iterations; /** Finalize and obtain parameter instance from this builder. */ - public Prebilling build() { - return new Prebilling(this.extraParams, this.iterations); + public SubscriptionCreateParams.Prebilling build() { + return new SubscriptionCreateParams.Prebilling(this.extraParams, this.iterations); } /** @@ -4530,8 +4623,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionCreateParams.TransferData build() { + return new SubscriptionCreateParams.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java index de53c02110a..6b3138b60a0 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java @@ -244,7 +244,7 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * SubscriptionItemCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionItemCreateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -258,7 +258,7 @@ public Builder addDiscount(Discount element) { * SubscriptionItemCreateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -273,7 +273,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The coupons to redeem into discounts for the subscription item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -498,7 +498,7 @@ public Builder setTaxRates(List taxRates) { } /** Options that configure the trial on the subscription item. */ - public Builder setTrial(Trial trial) { + public Builder setTrial(SubscriptionItemCreateParams.Trial trial) { this.trial = trial; return this; } @@ -610,8 +610,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionItemCreateParams.Discount build() { + return new SubscriptionItemCreateParams.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1002,8 +1003,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Trial build() { - return new Trial(this.extraParams, this.type); + public SubscriptionItemCreateParams.Trial build() { + return new SubscriptionItemCreateParams.Trial(this.extraParams, this.type); } /** @@ -1033,7 +1034,7 @@ public Builder putAllExtraParam(Map map) { } /** Determines the type of trial for this item. */ - public Builder setType(Type type) { + public Builder setType(SubscriptionItemCreateParams.Trial.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java index aadff6c7db0..fc5a5d01711 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java @@ -238,7 +238,7 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * SubscriptionItemUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionItemUpdateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -252,7 +252,7 @@ public Builder addDiscount(Discount element) { * SubscriptionItemUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -267,7 +267,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The coupons to redeem into discounts for the subscription item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -640,8 +640,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionItemUpdateParams.Discount build() { + return new SubscriptionItemUpdateParams.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java index 1dc9c9aed1f..063e81f30f5 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java @@ -13,7 +13,7 @@ public class SubscriptionScheduleAmendParams extends ApiRequestParams { /** Changes to apply to the phases of the subscription schedule, in the order provided. */ @SerializedName("amendments") - List amendments; + List amendments; /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") @@ -29,7 +29,9 @@ public class SubscriptionScheduleAmendParams extends ApiRequestParams { Map extraParams; private SubscriptionScheduleAmendParams( - List amendments, List expand, Map extraParams) { + List amendments, + List expand, + Map extraParams) { this.amendments = amendments; this.expand = expand; this.extraParams = extraParams; @@ -40,7 +42,7 @@ public static Builder builder() { } public static class Builder { - private List amendments; + private List amendments; private List expand; @@ -56,7 +58,7 @@ public SubscriptionScheduleAmendParams build() { * and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleAmendParams#amendments} for the field documentation. */ - public Builder addAmendment(Amendment element) { + public Builder addAmendment(SubscriptionScheduleAmendParams.Amendment element) { if (this.amendments == null) { this.amendments = new ArrayList<>(); } @@ -69,7 +71,7 @@ public Builder addAmendment(Amendment element) { * and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleAmendParams#amendments} for the field documentation. */ - public Builder addAllAmendment(List elements) { + public Builder addAllAmendment(List elements) { if (this.amendments == null) { this.amendments = new ArrayList<>(); } @@ -150,7 +152,7 @@ public static class Amendment { * span. */ @SerializedName("discount_actions") - List discountActions; + List discountActions; /** * Map of extra parameters for custom features not available in this client library. The content @@ -163,7 +165,7 @@ public static class Amendment { /** Changes to the subscription items during the amendment time span. */ @SerializedName("item_actions") - List itemActions; + List itemActions; /** * Changes to how Stripe handles prorations during the amendment time span. Affects if and how @@ -178,9 +180,9 @@ public static class Amendment { private Amendment( AmendmentEnd amendmentEnd, AmendmentStart amendmentStart, - List discountActions, + List discountActions, Map extraParams, - List itemActions, + List itemActions, ProrationBehavior prorationBehavior) { this.amendmentEnd = amendmentEnd; this.amendmentStart = amendmentStart; @@ -199,17 +201,17 @@ public static class Builder { private AmendmentStart amendmentStart; - private List discountActions; + private List discountActions; private Map extraParams; - private List itemActions; + private List itemActions; private ProrationBehavior prorationBehavior; /** Finalize and obtain parameter instance from this builder. */ - public Amendment build() { - return new Amendment( + public SubscriptionScheduleAmendParams.Amendment build() { + return new SubscriptionScheduleAmendParams.Amendment( this.amendmentEnd, this.amendmentStart, this.discountActions, @@ -224,7 +226,8 @@ public Amendment build() { * timestamp at {@code amendment_start}, and a restricted set of attributes is supported on * the amendment. */ - public Builder setAmendmentEnd(AmendmentEnd amendmentEnd) { + public Builder setAmendmentEnd( + SubscriptionScheduleAmendParams.Amendment.AmendmentEnd amendmentEnd) { this.amendmentEnd = amendmentEnd; return this; } @@ -232,7 +235,8 @@ public Builder setAmendmentEnd(AmendmentEnd amendmentEnd) { /** * Details to identify the earliest timestamp where the proposed change should take effect. */ - public Builder setAmendmentStart(AmendmentStart amendmentStart) { + public Builder setAmendmentStart( + SubscriptionScheduleAmendParams.Amendment.AmendmentStart amendmentStart) { this.amendmentStart = amendmentStart; return this; } @@ -242,7 +246,8 @@ public Builder setAmendmentStart(AmendmentStart amendmentStart) { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleAmendParams.Amendment#discountActions} for the field documentation. */ - public Builder addDiscountAction(DiscountAction element) { + public Builder addDiscountAction( + SubscriptionScheduleAmendParams.Amendment.DiscountAction element) { if (this.discountActions == null) { this.discountActions = new ArrayList<>(); } @@ -256,7 +261,8 @@ public Builder addDiscountAction(DiscountAction element) { * {@link SubscriptionScheduleAmendParams.Amendment#discountActions} for the field * documentation. */ - public Builder addAllDiscountAction(List elements) { + public Builder addAllDiscountAction( + List elements) { if (this.discountActions == null) { this.discountActions = new ArrayList<>(); } @@ -296,7 +302,7 @@ public Builder putAllExtraParam(Map map) { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleAmendParams.Amendment#itemActions} for the field documentation. */ - public Builder addItemAction(ItemAction element) { + public Builder addItemAction(SubscriptionScheduleAmendParams.Amendment.ItemAction element) { if (this.itemActions == null) { this.itemActions = new ArrayList<>(); } @@ -309,7 +315,8 @@ public Builder addItemAction(ItemAction element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleAmendParams.Amendment#itemActions} for the field documentation. */ - public Builder addAllItemAction(List elements) { + public Builder addAllItemAction( + List elements) { if (this.itemActions == null) { this.itemActions = new ArrayList<>(); } @@ -324,7 +331,8 @@ public Builder addAllItemAction(List elements) { * of the request. Also supported as a point-in-time operation when {@code amendment_end} is * {@code null}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionScheduleAmendParams.Amendment.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -378,12 +386,14 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public AmendmentEnd build() { - return new AmendmentEnd(this.duration, this.extraParams, this.timestamp, this.type); + public SubscriptionScheduleAmendParams.Amendment.AmendmentEnd build() { + return new SubscriptionScheduleAmendParams.Amendment.AmendmentEnd( + this.duration, this.extraParams, this.timestamp, this.type); } /** Time span for the amendment starting from the {@code amendment_start}. */ - public Builder setDuration(Duration duration) { + public Builder setDuration( + SubscriptionScheduleAmendParams.Amendment.AmendmentEnd.Duration duration) { this.duration = duration; return this; } @@ -420,13 +430,14 @@ public Builder putAllExtraParam(Map map) { * A precise Unix timestamp for the amendment to end. Must be after the {@code * amendment_start}. */ - public Builder setTimestamp(Timestamp timestamp) { + public Builder setTimestamp( + SubscriptionScheduleAmendParams.Amendment.AmendmentEnd.Timestamp timestamp) { this.timestamp = timestamp; return this; } /** Select one of three ways to pass the {@code amendment_end}. */ - public Builder setType(Type type) { + public Builder setType(SubscriptionScheduleAmendParams.Amendment.AmendmentEnd.Type type) { this.type = type; return this; } @@ -476,8 +487,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Duration build() { - return new Duration(this.extraParams, this.interval, this.intervalCount); + public SubscriptionScheduleAmendParams.Amendment.AmendmentEnd.Duration build() { + return new SubscriptionScheduleAmendParams.Amendment.AmendmentEnd.Duration( + this.extraParams, this.interval, this.intervalCount); } /** @@ -514,7 +526,8 @@ public Builder putAllExtraParam(Map map) { * Specifies a type of interval unit. Either {@code day}, {@code week}, {@code month} or * {@code year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionScheduleAmendParams.Amendment.AmendmentEnd.Duration.Interval interval) { this.interval = interval; return this; } @@ -585,8 +598,9 @@ public static class Builder { private Long value; /** Finalize and obtain parameter instance from this builder. */ - public Timestamp build() { - return new Timestamp(this.extraParams, this.value); + public SubscriptionScheduleAmendParams.Amendment.AmendmentEnd.Timestamp build() { + return new SubscriptionScheduleAmendParams.Amendment.AmendmentEnd.Timestamp( + this.extraParams, this.value); } /** @@ -700,15 +714,17 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public AmendmentStart build() { - return new AmendmentStart(this.amendmentEnd, this.extraParams, this.timestamp, this.type); + public SubscriptionScheduleAmendParams.Amendment.AmendmentStart build() { + return new SubscriptionScheduleAmendParams.Amendment.AmendmentStart( + this.amendmentEnd, this.extraParams, this.timestamp, this.type); } /** * Details of another amendment in the same array, immediately after which this amendment * should begin. */ - public Builder setAmendmentEnd(AmendmentEnd amendmentEnd) { + public Builder setAmendmentEnd( + SubscriptionScheduleAmendParams.Amendment.AmendmentStart.AmendmentEnd amendmentEnd) { this.amendmentEnd = amendmentEnd; return this; } @@ -742,13 +758,14 @@ public Builder putAllExtraParam(Map map) { } /** A precise Unix timestamp for the amendment to start. */ - public Builder setTimestamp(Timestamp timestamp) { + public Builder setTimestamp( + SubscriptionScheduleAmendParams.Amendment.AmendmentStart.Timestamp timestamp) { this.timestamp = timestamp; return this; } /** Select one of three ways to pass the {@code amendment_start}. */ - public Builder setType(Type type) { + public Builder setType(SubscriptionScheduleAmendParams.Amendment.AmendmentStart.Type type) { this.type = type; return this; } @@ -789,8 +806,9 @@ public static class Builder { private Long index; /** Finalize and obtain parameter instance from this builder. */ - public AmendmentEnd build() { - return new AmendmentEnd(this.extraParams, this.index); + public SubscriptionScheduleAmendParams.Amendment.AmendmentStart.AmendmentEnd build() { + return new SubscriptionScheduleAmendParams.Amendment.AmendmentStart.AmendmentEnd( + this.extraParams, this.index); } /** @@ -869,8 +887,9 @@ public static class Builder { private Long value; /** Finalize and obtain parameter instance from this builder. */ - public Timestamp build() { - return new Timestamp(this.extraParams, this.value); + public SubscriptionScheduleAmendParams.Amendment.AmendmentStart.Timestamp build() { + return new SubscriptionScheduleAmendParams.Amendment.AmendmentStart.Timestamp( + this.extraParams, this.value); } /** @@ -985,12 +1004,13 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public DiscountAction build() { - return new DiscountAction(this.add, this.extraParams, this.remove, this.set, this.type); + public SubscriptionScheduleAmendParams.Amendment.DiscountAction build() { + return new SubscriptionScheduleAmendParams.Amendment.DiscountAction( + this.add, this.extraParams, this.remove, this.set, this.type); } /** Details of the discount to add. */ - public Builder setAdd(Add add) { + public Builder setAdd(SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add add) { this.add = add; return this; } @@ -1024,19 +1044,20 @@ public Builder putAllExtraParam(Map map) { } /** Details of the discount to remove. */ - public Builder setRemove(Remove remove) { + public Builder setRemove( + SubscriptionScheduleAmendParams.Amendment.DiscountAction.Remove remove) { this.remove = remove; return this; } /** Details of the discount to replace the existing discounts with. */ - public Builder setSet(Set set) { + public Builder setSet(SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set set) { this.set = set; return this; } /** Determines the type of discount action. */ - public Builder setType(Type type) { + public Builder setType(SubscriptionScheduleAmendParams.Amendment.DiscountAction.Type type) { this.type = type; return this; } @@ -1090,8 +1111,9 @@ public static class Builder { private Long index; /** Finalize and obtain parameter instance from this builder. */ - public Add build() { - return new Add(this.coupon, this.discount, this.extraParams, this.index); + public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add build() { + return new SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add( + this.coupon, this.discount, this.extraParams, this.index); } /** The coupon code to redeem. */ @@ -1185,8 +1207,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Remove build() { - return new Remove(this.coupon, this.discount, this.extraParams); + public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Remove build() { + return new SubscriptionScheduleAmendParams.Amendment.DiscountAction.Remove( + this.coupon, this.discount, this.extraParams); } /** The coupon code to remove from the {@code discounts} array. */ @@ -1271,8 +1294,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Set build() { - return new Set(this.coupon, this.discount, this.extraParams); + public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set build() { + return new SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set( + this.coupon, this.discount, this.extraParams); } /** The coupon code to replace the {@code discounts} array with. */ @@ -1341,7 +1365,8 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter public static class ItemAction { /** - * Details of the subscription item to add. The {@code price} must be unique across all items. + * Details of the subscription item to add. If an item with the same {@code price} exists, it + * will be replaced by this new item. Otherwise, it adds the new item. */ @SerializedName("add") Add add; @@ -1397,15 +1422,16 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public ItemAction build() { - return new ItemAction(this.add, this.extraParams, this.remove, this.set, this.type); + public SubscriptionScheduleAmendParams.Amendment.ItemAction build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction( + this.add, this.extraParams, this.remove, this.set, this.type); } /** - * Details of the subscription item to add. The {@code price} must be unique across all - * items. + * Details of the subscription item to add. If an item with the same {@code price} exists, + * it will be replaced by this new item. Otherwise, it adds the new item. */ - public Builder setAdd(Add add) { + public Builder setAdd(SubscriptionScheduleAmendParams.Amendment.ItemAction.Add add) { this.add = add; return this; } @@ -1439,7 +1465,8 @@ public Builder putAllExtraParam(Map map) { } /** Details of the subscription item to remove. */ - public Builder setRemove(Remove remove) { + public Builder setRemove( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Remove remove) { this.remove = remove; return this; } @@ -1450,13 +1477,13 @@ public Builder setRemove(Remove remove) { * of the other {@code set} properties that are passed in this request will replace the * existing values for the configuration item. */ - public Builder setSet(Set set) { + public Builder setSet(SubscriptionScheduleAmendParams.Amendment.ItemAction.Set set) { this.set = set; return this; } /** Determines the type of item action. */ - public Builder setType(Type type) { + public Builder setType(SubscriptionScheduleAmendParams.Amendment.ItemAction.Type type) { this.type = type; return this; } @@ -1469,7 +1496,7 @@ public static class Add { * subscription discounts. */ @SerializedName("discounts") - List discounts; + List discounts; /** * Map of extra parameters for custom features not available in this client library. The @@ -1510,7 +1537,7 @@ public static class Add { Trial trial; private Add( - List discounts, + List discounts, Map extraParams, Map metadata, String price, @@ -1531,7 +1558,7 @@ public static Builder builder() { } public static class Builder { - private List discounts; + private List discounts; private Map extraParams; @@ -1546,8 +1573,8 @@ public static class Builder { private Trial trial; /** Finalize and obtain parameter instance from this builder. */ - public Add build() { - return new Add( + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Add build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Add( this.discounts, this.extraParams, this.metadata, @@ -1563,7 +1590,8 @@ public Add build() { * SubscriptionScheduleAmendParams.Amendment.ItemAction.Add#discounts} for the field * documentation. */ - public Builder addDiscount(Discount element) { + public Builder addDiscount( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount element) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -1577,7 +1605,8 @@ public Builder addDiscount(Discount element) { * SubscriptionScheduleAmendParams.Amendment.ItemAction.Add#discounts} for the field * documentation. */ - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount( + List elements) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -1682,7 +1711,8 @@ public Builder addAllTaxRate(List elements) { } /** Options that configure the trial on the subscription item. */ - public Builder setTrial(Trial trial) { + public Builder setTrial( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Trial trial) { this.trial = trial; return this; } @@ -1726,8 +1756,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1805,8 +1836,9 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Trial build() { - return new Trial(this.extraParams, this.type); + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Trial build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Trial( + this.extraParams, this.type); } /** @@ -1840,7 +1872,8 @@ public Builder putAllExtraParam(Map map) { } /** Determines the type of trial for this item. */ - public Builder setType(Type type) { + public Builder setType( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Trial.Type type) { this.type = type; return this; } @@ -1894,8 +1927,9 @@ public static class Builder { private String price; /** Finalize and obtain parameter instance from this builder. */ - public Remove build() { - return new Remove(this.extraParams, this.price); + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Remove build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Remove( + this.extraParams, this.price); } /** @@ -1945,7 +1979,7 @@ public static class Set { * discounts}. */ @SerializedName("discounts") - List discounts; + List discounts; /** * Map of extra parameters for custom features not available in this client library. The @@ -1997,7 +2031,7 @@ public static class Set { Trial trial; private Set( - List discounts, + List discounts, Map extraParams, Map metadata, String price, @@ -2018,7 +2052,7 @@ public static Builder builder() { } public static class Builder { - private List discounts; + private List discounts; private Map extraParams; @@ -2033,8 +2067,8 @@ public static class Builder { private Trial trial; /** Finalize and obtain parameter instance from this builder. */ - public Set build() { - return new Set( + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Set build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Set( this.discounts, this.extraParams, this.metadata, @@ -2050,7 +2084,8 @@ public Set build() { * SubscriptionScheduleAmendParams.Amendment.ItemAction.Set#discounts} for the field * documentation. */ - public Builder addDiscount(Discount element) { + public Builder addDiscount( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount element) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -2064,7 +2099,8 @@ public Builder addDiscount(Discount element) { * SubscriptionScheduleAmendParams.Amendment.ItemAction.Set#discounts} for the field * documentation. */ - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount( + List elements) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -2178,7 +2214,8 @@ public Builder addAllTaxRate(List elements) { * Otherwise, the {@code items} array is cleared and a single new item is added with the * supplied {@code trial}. */ - public Builder setTrial(Trial trial) { + public Builder setTrial( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Trial trial) { this.trial = trial; return this; } @@ -2222,8 +2259,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2301,8 +2339,9 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Trial build() { - return new Trial(this.extraParams, this.type); + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Trial build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Trial( + this.extraParams, this.type); } /** @@ -2336,7 +2375,8 @@ public Builder putAllExtraParam(Map map) { } /** Determines the type of trial for this item. */ - public Builder setType(Type type) { + public Builder setType( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Trial.Type type) { this.type = type; return this; } diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java index f905ff4c7ad..bb365674276 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java @@ -78,7 +78,7 @@ public class SubscriptionScheduleCreateParams extends ApiRequestParams { * one phase will always equal the {@code start_date} of the next phase. */ @SerializedName("phases") - List phases; + List phases; /** If specified, the invoicing for the given billing cycle iterations will be processed now. */ @SerializedName("prebilling") @@ -101,7 +101,7 @@ private SubscriptionScheduleCreateParams( Map extraParams, String fromSubscription, Object metadata, - List phases, + List phases, Prebilling prebilling, Object startDate) { this.billingBehavior = billingBehavior; @@ -138,7 +138,7 @@ public static class Builder { private Object metadata; - private List phases; + private List phases; private Prebilling prebilling; @@ -167,7 +167,8 @@ public SubscriptionScheduleCreateParams build() { * changes and generate prorations at transition time.{@code prorate_up_front} will bill for all * phases within the current billing cycle up front. */ - public Builder setBillingBehavior(BillingBehavior billingBehavior) { + public Builder setBillingBehavior( + SubscriptionScheduleCreateParams.BillingBehavior billingBehavior) { this.billingBehavior = billingBehavior; return this; } @@ -179,7 +180,8 @@ public Builder setCustomer(String customer) { } /** Object representing the subscription schedule's default settings. */ - public Builder setDefaultSettings(DefaultSettings defaultSettings) { + public Builder setDefaultSettings( + SubscriptionScheduleCreateParams.DefaultSettings defaultSettings) { this.defaultSettings = defaultSettings; return this; } @@ -190,7 +192,7 @@ public Builder setDefaultSettings(DefaultSettings defaultSettings) { * the subscription schedule and keep the underlying subscription running.{@code cancel} will * end the subscription schedule and cancel the underlying subscription. */ - public Builder setEndBehavior(EndBehavior endBehavior) { + public Builder setEndBehavior(SubscriptionScheduleCreateParams.EndBehavior endBehavior) { this.endBehavior = endBehavior; return this; } @@ -314,7 +316,7 @@ public Builder setMetadata(Map metadata) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleCreateParams#phases} for the field documentation. */ - public Builder addPhase(Phase element) { + public Builder addPhase(SubscriptionScheduleCreateParams.Phase element) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -327,7 +329,7 @@ public Builder addPhase(Phase element) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleCreateParams#phases} for the field documentation. */ - public Builder addAllPhase(List elements) { + public Builder addAllPhase(List elements) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -336,7 +338,7 @@ public Builder addAllPhase(List elements) { } /** If specified, the invoicing for the given billing cycle iterations will be processed now. */ - public Builder setPrebilling(Prebilling prebilling) { + public Builder setPrebilling(SubscriptionScheduleCreateParams.Prebilling prebilling) { this.prebilling = prebilling; return this; } @@ -356,7 +358,7 @@ public Builder setStartDate(Long startDate) { * subscription immediately. You can also use a Unix timestamp to backdate the subscription so * that it starts on a past date, or set a future date for the subscription to start on. */ - public Builder setStartDate(StartDate startDate) { + public Builder setStartDate(SubscriptionScheduleCreateParams.StartDate startDate) { this.startDate = startDate; return this; } @@ -413,6 +415,13 @@ public static class DefaultSettings { @SerializedName("default_payment_method") String defaultPaymentMethod; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** * 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 @@ -440,6 +449,7 @@ private DefaultSettings( Object billingThresholds, CollectionMethod collectionMethod, String defaultPaymentMethod, + String description, Map extraParams, InvoiceSettings invoiceSettings, Object transferData) { @@ -449,6 +459,7 @@ private DefaultSettings( this.billingThresholds = billingThresholds; this.collectionMethod = collectionMethod; this.defaultPaymentMethod = defaultPaymentMethod; + this.description = description; this.extraParams = extraParams; this.invoiceSettings = invoiceSettings; this.transferData = transferData; @@ -471,6 +482,8 @@ public static class Builder { private String defaultPaymentMethod; + private String description; + private Map extraParams; private InvoiceSettings invoiceSettings; @@ -478,14 +491,15 @@ public static class Builder { private Object transferData; /** Finalize and obtain parameter instance from this builder. */ - public DefaultSettings build() { - return new DefaultSettings( + public SubscriptionScheduleCreateParams.DefaultSettings build() { + return new SubscriptionScheduleCreateParams.DefaultSettings( this.applicationFeePercent, this.automaticTax, this.billingCycleAnchor, this.billingThresholds, this.collectionMethod, this.defaultPaymentMethod, + this.description, this.extraParams, this.invoiceSettings, this.transferData); @@ -505,7 +519,8 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { } /** Default settings for automatic tax computation. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax( + SubscriptionScheduleCreateParams.DefaultSettings.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -516,7 +531,8 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * this phase specifies a trial. For more information, see the billing cycle documentation. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + SubscriptionScheduleCreateParams.DefaultSettings.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -525,7 +541,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleCreateParams.DefaultSettings.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -546,7 +563,8 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * email your customer an invoice with payment instructions. Defaults to {@code * charge_automatically} on creation. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod( + SubscriptionScheduleCreateParams.DefaultSettings.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -561,6 +579,15 @@ public Builder setDefaultPaymentMethod(String defaultPaymentMethod) { return this; } + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + 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 @@ -589,7 +616,8 @@ public Builder putAllExtraParam(Map map) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings( + SubscriptionScheduleCreateParams.DefaultSettings.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -598,7 +626,8 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * The data with which to automatically create a Transfer for each of the associated * subscription's invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + SubscriptionScheduleCreateParams.DefaultSettings.TransferData transferData) { this.transferData = transferData; return this; } @@ -646,8 +675,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionScheduleCreateParams.DefaultSettings.AutomaticTax build() { + return new SubscriptionScheduleCreateParams.DefaultSettings.AutomaticTax( + this.enabled, this.extraParams); } /** @@ -733,8 +763,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionScheduleCreateParams.DefaultSettings.BillingThresholds build() { + return new SubscriptionScheduleCreateParams.DefaultSettings.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -820,8 +850,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public SubscriptionScheduleCreateParams.DefaultSettings.InvoiceSettings build() { + return new SubscriptionScheduleCreateParams.DefaultSettings.InvoiceSettings( + this.daysUntilDue, this.extraParams); } /** @@ -908,8 +939,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionScheduleCreateParams.DefaultSettings.TransferData build() { + return new SubscriptionScheduleCreateParams.DefaultSettings.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** @@ -999,7 +1031,7 @@ public static class Phase { * for this phase. You may pass up to 20 items. */ @SerializedName("add_invoice_items") - List addInvoiceItems; + List addInvoiceItems; /** * A non-negative decimal between 0 and 100, with at most two decimal places. This represents @@ -1073,6 +1105,13 @@ public static class Phase { @SerializedName("default_tax_rates") Object defaultTaxRates; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + String description; + /** * The coupons to redeem into discounts for the schedule phase. If not specified, inherits the * discount from the subscription's customer. Pass an empty string to avoid inheriting any @@ -1106,7 +1145,7 @@ public static class Phase { * subscription schedule. */ @SerializedName("items") - List items; + List items; /** * Integer representing the multiplier applied to the price interval. For example, {@code @@ -1163,7 +1202,7 @@ public static class Phase { Long trialEnd; private Phase( - List addInvoiceItems, + List addInvoiceItems, BigDecimal applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, @@ -1173,11 +1212,12 @@ private Phase( String currency, String defaultPaymentMethod, Object defaultTaxRates, + String description, Object discounts, Long endDate, Map extraParams, InvoiceSettings invoiceSettings, - List items, + List items, Long iterations, Map metadata, ProrationBehavior prorationBehavior, @@ -1195,6 +1235,7 @@ private Phase( this.currency = currency; this.defaultPaymentMethod = defaultPaymentMethod; this.defaultTaxRates = defaultTaxRates; + this.description = description; this.discounts = discounts; this.endDate = endDate; this.extraParams = extraParams; @@ -1214,7 +1255,7 @@ public static Builder builder() { } public static class Builder { - private List addInvoiceItems; + private List addInvoiceItems; private BigDecimal applicationFeePercent; @@ -1234,6 +1275,8 @@ public static class Builder { private Object defaultTaxRates; + private String description; + private Object discounts; private Long endDate; @@ -1242,7 +1285,7 @@ public static class Builder { private InvoiceSettings invoiceSettings; - private List items; + private List items; private Long iterations; @@ -1259,8 +1302,8 @@ public static class Builder { private Long trialEnd; /** Finalize and obtain parameter instance from this builder. */ - public Phase build() { - return new Phase( + public SubscriptionScheduleCreateParams.Phase build() { + return new SubscriptionScheduleCreateParams.Phase( this.addInvoiceItems, this.applicationFeePercent, this.automaticTax, @@ -1271,6 +1314,7 @@ public Phase build() { this.currency, this.defaultPaymentMethod, this.defaultTaxRates, + this.description, this.discounts, this.endDate, this.extraParams, @@ -1290,7 +1334,8 @@ public Phase build() { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleCreateParams.Phase#addInvoiceItems} for the field documentation. */ - public Builder addAddInvoiceItem(AddInvoiceItem element) { + public Builder addAddInvoiceItem( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem element) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -1303,7 +1348,8 @@ public Builder addAddInvoiceItem(AddInvoiceItem element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link SubscriptionScheduleCreateParams.Phase#addInvoiceItems} for the field documentation. */ - public Builder addAllAddInvoiceItem(List elements) { + public Builder addAllAddInvoiceItem( + List elements) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -1325,7 +1371,8 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { } /** Automatic tax settings for this phase. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax( + SubscriptionScheduleCreateParams.Phase.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -1336,7 +1383,8 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * this phase specifies a trial. For more information, see the billing cycle documentation. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + SubscriptionScheduleCreateParams.Phase.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -1345,7 +1393,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleCreateParams.Phase.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -1366,7 +1415,8 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * email your customer an invoice with payment instructions. Defaults to {@code * charge_automatically} on creation. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod( + SubscriptionScheduleCreateParams.Phase.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -1451,13 +1501,22 @@ public Builder setDefaultTaxRates(List defaultTaxRates) { return this; } + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + /** * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleCreateParams.Phase#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionScheduleCreateParams.Phase.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1471,7 +1530,8 @@ public Builder addDiscount(Discount element) { * SubscriptionScheduleCreateParams.Phase#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount( + List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1494,7 +1554,7 @@ public Builder setDiscounts(EmptyParam discounts) { * discount from the subscription's customer. Pass an empty string to avoid inheriting any * discounts. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -1535,7 +1595,8 @@ public Builder putAllExtraParam(Map map) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings( + SubscriptionScheduleCreateParams.Phase.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -1545,7 +1606,7 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleCreateParams.Phase#items} for the field documentation. */ - public Builder addItem(Item element) { + public Builder addItem(SubscriptionScheduleCreateParams.Phase.Item element) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1558,7 +1619,7 @@ public Builder addItem(Item element) { * and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleCreateParams.Phase#items} for the field documentation. */ - public Builder addAllItem(List elements) { + public Builder addAllItem(List elements) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1608,7 +1669,8 @@ public Builder putAllMetadata(Map map) { * href="https://stripe.com/docs/billing/subscriptions/prorations">prorations when * transitioning to this phase. The default value is {@code create_prorations}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionScheduleCreateParams.Phase.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -1617,7 +1679,8 @@ public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { * The data with which to automatically create a Transfer for each of the associated * subscription's invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + SubscriptionScheduleCreateParams.Phase.TransferData transferData) { this.transferData = transferData; return this; } @@ -1632,7 +1695,8 @@ public Builder setTrial(Boolean trial) { } /** Specify trial behavior when crossing phase boundaries. */ - public Builder setTrialContinuation(TrialContinuation trialContinuation) { + public Builder setTrialContinuation( + SubscriptionScheduleCreateParams.Phase.TrialContinuation trialContinuation) { this.trialContinuation = trialContinuation; return this; } @@ -1651,7 +1715,7 @@ public Builder setTrialEnd(Long trialEnd) { public static class AddInvoiceItem { /** The coupons to redeem into discounts for the item. */ @SerializedName("discounts") - List discounts; + List discounts; /** * Map of extra parameters for custom features not available in this client library. The @@ -1685,7 +1749,7 @@ public static class AddInvoiceItem { Object taxRates; private AddInvoiceItem( - List discounts, + List discounts, Map extraParams, String price, PriceData priceData, @@ -1704,7 +1768,7 @@ public static Builder builder() { } public static class Builder { - private List discounts; + private List discounts; private Map extraParams; @@ -1717,8 +1781,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public AddInvoiceItem build() { - return new AddInvoiceItem( + public SubscriptionScheduleCreateParams.Phase.AddInvoiceItem build() { + return new SubscriptionScheduleCreateParams.Phase.AddInvoiceItem( this.discounts, this.extraParams, this.price, @@ -1733,7 +1797,8 @@ public AddInvoiceItem build() { * SubscriptionScheduleCreateParams.Phase.AddInvoiceItem#discounts} for the field * documentation. */ - public Builder addDiscount(Discount element) { + public Builder addDiscount( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Discount element) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -1747,7 +1812,8 @@ public Builder addDiscount(Discount element) { * SubscriptionScheduleCreateParams.Phase.AddInvoiceItem#discounts} for the field * documentation. */ - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount( + List elements) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -1793,7 +1859,8 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1891,8 +1958,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Discount build() { + return new SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2019,8 +2087,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.PriceData build() { + return new SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.PriceData( this.currency, this.extraParams, this.product, @@ -2080,7 +2148,9 @@ public Builder setProduct(String product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as * either {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.PriceData.TaxBehavior + taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2158,8 +2228,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionScheduleCreateParams.Phase.AutomaticTax build() { + return new SubscriptionScheduleCreateParams.Phase.AutomaticTax( + this.enabled, this.extraParams); } /** @@ -2243,8 +2314,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionScheduleCreateParams.Phase.BillingThresholds build() { + return new SubscriptionScheduleCreateParams.Phase.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -2331,8 +2402,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionScheduleCreateParams.Phase.Discount build() { + return new SubscriptionScheduleCreateParams.Phase.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2411,8 +2483,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public SubscriptionScheduleCreateParams.Phase.InvoiceSettings build() { + return new SubscriptionScheduleCreateParams.Phase.InvoiceSettings( + this.daysUntilDue, this.extraParams); } /** @@ -2577,8 +2650,8 @@ public static class Builder { private Trial trial; /** Finalize and obtain parameter instance from this builder. */ - public Item build() { - return new Item( + public SubscriptionScheduleCreateParams.Phase.Item build() { + return new SubscriptionScheduleCreateParams.Phase.Item( this.billingThresholds, this.discounts, this.extraParams, @@ -2596,7 +2669,8 @@ public Item build() { * new billing period. When updating, pass an empty string to remove previously-defined * thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleCreateParams.Phase.Item.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -2617,7 +2691,7 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * SubscriptionScheduleCreateParams.Phase.Item#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionScheduleCreateParams.Phase.Item.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2632,7 +2706,8 @@ public Builder addDiscount(Discount element) { * SubscriptionScheduleCreateParams.Phase.Item#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount( + List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2648,7 +2723,8 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The coupons to redeem into discounts for the subscription item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts( + List discounts) { this.discounts = discounts; return this; } @@ -2727,7 +2803,8 @@ public Builder setPrice(String price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData( + SubscriptionScheduleCreateParams.Phase.Item.PriceData priceData) { this.priceData = priceData; return this; } @@ -2794,7 +2871,7 @@ public Builder setTaxRates(List taxRates) { } /** Options that configure the trial on the subscription item. */ - public Builder setTrial(Trial trial) { + public Builder setTrial(SubscriptionScheduleCreateParams.Phase.Item.Trial trial) { this.trial = trial; return this; } @@ -2831,8 +2908,9 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public SubscriptionScheduleCreateParams.Phase.Item.BillingThresholds build() { + return new SubscriptionScheduleCreateParams.Phase.Item.BillingThresholds( + this.extraParams, this.usageGte); } /** @@ -2911,8 +2989,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionScheduleCreateParams.Phase.Item.Discount build() { + return new SubscriptionScheduleCreateParams.Phase.Item.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -3047,8 +3126,8 @@ public static class Builder { private BigDecimal unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionScheduleCreateParams.Phase.Item.PriceData build() { + return new SubscriptionScheduleCreateParams.Phase.Item.PriceData( this.currency, this.extraParams, this.product, @@ -3106,7 +3185,8 @@ public Builder setProduct(String product) { * The recurring components of a price such as {@code interval} and {@code * interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring( + SubscriptionScheduleCreateParams.Phase.Item.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -3116,7 +3196,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as * either {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionScheduleCreateParams.Phase.Item.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -3187,8 +3268,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public SubscriptionScheduleCreateParams.Phase.Item.PriceData.Recurring build() { + return new SubscriptionScheduleCreateParams.Phase.Item.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -3225,7 +3307,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or * {@code year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionScheduleCreateParams.Phase.Item.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -3313,8 +3396,9 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Trial build() { - return new Trial(this.extraParams, this.type); + public SubscriptionScheduleCreateParams.Phase.Item.Trial build() { + return new SubscriptionScheduleCreateParams.Phase.Item.Trial( + this.extraParams, this.type); } /** @@ -3346,7 +3430,7 @@ public Builder putAllExtraParam(Map map) { } /** Determines the type of trial for this item. */ - public Builder setType(Type type) { + public Builder setType(SubscriptionScheduleCreateParams.Phase.Item.Trial.Type type) { this.type = type; return this; } @@ -3411,8 +3495,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionScheduleCreateParams.Phase.TransferData build() { + return new SubscriptionScheduleCreateParams.Phase.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** @@ -3556,8 +3641,8 @@ public static class Builder { private Long iterations; /** Finalize and obtain parameter instance from this builder. */ - public Prebilling build() { - return new Prebilling(this.extraParams, this.iterations); + public SubscriptionScheduleCreateParams.Prebilling build() { + return new SubscriptionScheduleCreateParams.Prebilling(this.extraParams, this.iterations); } /** diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java index d01f38a93c2..f335f0bed25 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java @@ -65,7 +65,7 @@ public class SubscriptionScheduleUpdateParams extends ApiRequestParams { * be omitted. */ @SerializedName("phases") - List phases; + List phases; /** If specified, the invoicing for the given billing cycle iterations will be processed now. */ @SerializedName("prebilling") @@ -85,7 +85,7 @@ private SubscriptionScheduleUpdateParams( List expand, Map extraParams, Object metadata, - List phases, + List phases, Prebilling prebilling, ProrationBehavior prorationBehavior) { this.billingBehavior = billingBehavior; @@ -116,7 +116,7 @@ public static class Builder { private Object metadata; - private List phases; + private List phases; private Prebilling prebilling; @@ -143,13 +143,15 @@ public SubscriptionScheduleUpdateParams build() { * changes and generate prorations at transition time.{@code prorate_up_front} will bill for all * phases within the current billing cycle up front. */ - public Builder setBillingBehavior(BillingBehavior billingBehavior) { + public Builder setBillingBehavior( + SubscriptionScheduleUpdateParams.BillingBehavior billingBehavior) { this.billingBehavior = billingBehavior; return this; } /** Object representing the subscription schedule's default settings. */ - public Builder setDefaultSettings(DefaultSettings defaultSettings) { + public Builder setDefaultSettings( + SubscriptionScheduleUpdateParams.DefaultSettings defaultSettings) { this.defaultSettings = defaultSettings; return this; } @@ -160,7 +162,7 @@ public Builder setDefaultSettings(DefaultSettings defaultSettings) { * the subscription schedule and keep the underlying subscription running.{@code cancel} will * end the subscription schedule and cancel the underlying subscription. */ - public Builder setEndBehavior(EndBehavior endBehavior) { + public Builder setEndBehavior(SubscriptionScheduleUpdateParams.EndBehavior endBehavior) { this.endBehavior = endBehavior; return this; } @@ -272,7 +274,7 @@ public Builder setMetadata(Map metadata) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleUpdateParams#phases} for the field documentation. */ - public Builder addPhase(Phase element) { + public Builder addPhase(SubscriptionScheduleUpdateParams.Phase element) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -285,7 +287,7 @@ public Builder addPhase(Phase element) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleUpdateParams#phases} for the field documentation. */ - public Builder addAllPhase(List elements) { + public Builder addAllPhase(List elements) { if (this.phases == null) { this.phases = new ArrayList<>(); } @@ -294,7 +296,7 @@ public Builder addAllPhase(List elements) { } /** If specified, the invoicing for the given billing cycle iterations will be processed now. */ - public Builder setPrebilling(Prebilling prebilling) { + public Builder setPrebilling(SubscriptionScheduleUpdateParams.Prebilling prebilling) { this.prebilling = prebilling; return this; } @@ -303,7 +305,8 @@ public Builder setPrebilling(Prebilling prebilling) { * If the update changes the current phase, indicates whether the changes should be prorated. * The default value is {@code create_prorations}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionScheduleUpdateParams.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -360,6 +363,13 @@ public static class DefaultSettings { @SerializedName("default_payment_method") Object defaultPaymentMethod; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + Object description; + /** * 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 @@ -387,6 +397,7 @@ private DefaultSettings( Object billingThresholds, CollectionMethod collectionMethod, Object defaultPaymentMethod, + Object description, Map extraParams, InvoiceSettings invoiceSettings, Object transferData) { @@ -396,6 +407,7 @@ private DefaultSettings( this.billingThresholds = billingThresholds; this.collectionMethod = collectionMethod; this.defaultPaymentMethod = defaultPaymentMethod; + this.description = description; this.extraParams = extraParams; this.invoiceSettings = invoiceSettings; this.transferData = transferData; @@ -418,6 +430,8 @@ public static class Builder { private Object defaultPaymentMethod; + private Object description; + private Map extraParams; private InvoiceSettings invoiceSettings; @@ -425,14 +439,15 @@ public static class Builder { private Object transferData; /** Finalize and obtain parameter instance from this builder. */ - public DefaultSettings build() { - return new DefaultSettings( + public SubscriptionScheduleUpdateParams.DefaultSettings build() { + return new SubscriptionScheduleUpdateParams.DefaultSettings( this.applicationFeePercent, this.automaticTax, this.billingCycleAnchor, this.billingThresholds, this.collectionMethod, this.defaultPaymentMethod, + this.description, this.extraParams, this.invoiceSettings, this.transferData); @@ -452,7 +467,8 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { } /** Default settings for automatic tax computation. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax( + SubscriptionScheduleUpdateParams.DefaultSettings.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -463,7 +479,8 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * this phase specifies a trial. For more information, see the billing cycle documentation. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + SubscriptionScheduleUpdateParams.DefaultSettings.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -472,7 +489,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleUpdateParams.DefaultSettings.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -493,7 +511,8 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * email your customer an invoice with payment instructions. Defaults to {@code * charge_automatically} on creation. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod( + SubscriptionScheduleUpdateParams.DefaultSettings.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -518,6 +537,24 @@ public Builder setDefaultPaymentMethod(EmptyParam defaultPaymentMethod) { return this; } + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + 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 @@ -546,7 +583,8 @@ public Builder putAllExtraParam(Map map) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings( + SubscriptionScheduleUpdateParams.DefaultSettings.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -555,7 +593,8 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * The data with which to automatically create a Transfer for each of the associated * subscription's invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + SubscriptionScheduleUpdateParams.DefaultSettings.TransferData transferData) { this.transferData = transferData; return this; } @@ -603,8 +642,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionScheduleUpdateParams.DefaultSettings.AutomaticTax build() { + return new SubscriptionScheduleUpdateParams.DefaultSettings.AutomaticTax( + this.enabled, this.extraParams); } /** @@ -690,8 +730,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionScheduleUpdateParams.DefaultSettings.BillingThresholds build() { + return new SubscriptionScheduleUpdateParams.DefaultSettings.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -777,8 +817,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public SubscriptionScheduleUpdateParams.DefaultSettings.InvoiceSettings build() { + return new SubscriptionScheduleUpdateParams.DefaultSettings.InvoiceSettings( + this.daysUntilDue, this.extraParams); } /** @@ -865,8 +906,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionScheduleUpdateParams.DefaultSettings.TransferData build() { + return new SubscriptionScheduleUpdateParams.DefaultSettings.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** @@ -962,7 +1004,7 @@ public static class Phase { * for this phase. You may pass up to 20 items. */ @SerializedName("add_invoice_items") - List addInvoiceItems; + List addInvoiceItems; /** * A non-negative decimal between 0 and 100, with at most two decimal places. This represents @@ -1036,6 +1078,13 @@ public static class Phase { @SerializedName("default_tax_rates") Object defaultTaxRates; + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + @SerializedName("description") + Object description; + /** * The coupons to redeem into discounts for the schedule phase. If not specified, inherits the * discount from the subscription's customer. Pass an empty string to avoid inheriting any @@ -1069,7 +1118,7 @@ public static class Phase { * subscription schedule. */ @SerializedName("items") - List items; + List items; /** * Integer representing the multiplier applied to the price interval. For example, {@code @@ -1133,7 +1182,7 @@ public static class Phase { Object trialEnd; private Phase( - List addInvoiceItems, + List addInvoiceItems, BigDecimal applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, @@ -1143,11 +1192,12 @@ private Phase( Object currency, Object defaultPaymentMethod, Object defaultTaxRates, + Object description, Object discounts, Object endDate, Map extraParams, InvoiceSettings invoiceSettings, - List items, + List items, Long iterations, Map metadata, ProrationBehavior prorationBehavior, @@ -1166,6 +1216,7 @@ private Phase( this.currency = currency; this.defaultPaymentMethod = defaultPaymentMethod; this.defaultTaxRates = defaultTaxRates; + this.description = description; this.discounts = discounts; this.endDate = endDate; this.extraParams = extraParams; @@ -1186,7 +1237,7 @@ public static Builder builder() { } public static class Builder { - private List addInvoiceItems; + private List addInvoiceItems; private BigDecimal applicationFeePercent; @@ -1206,6 +1257,8 @@ public static class Builder { private Object defaultTaxRates; + private Object description; + private Object discounts; private Object endDate; @@ -1214,7 +1267,7 @@ public static class Builder { private InvoiceSettings invoiceSettings; - private List items; + private List items; private Long iterations; @@ -1233,8 +1286,8 @@ public static class Builder { private Object trialEnd; /** Finalize and obtain parameter instance from this builder. */ - public Phase build() { - return new Phase( + public SubscriptionScheduleUpdateParams.Phase build() { + return new SubscriptionScheduleUpdateParams.Phase( this.addInvoiceItems, this.applicationFeePercent, this.automaticTax, @@ -1245,6 +1298,7 @@ public Phase build() { this.currency, this.defaultPaymentMethod, this.defaultTaxRates, + this.description, this.discounts, this.endDate, this.extraParams, @@ -1265,7 +1319,8 @@ public Phase build() { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleUpdateParams.Phase#addInvoiceItems} for the field documentation. */ - public Builder addAddInvoiceItem(AddInvoiceItem element) { + public Builder addAddInvoiceItem( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem element) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -1278,7 +1333,8 @@ public Builder addAddInvoiceItem(AddInvoiceItem element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link SubscriptionScheduleUpdateParams.Phase#addInvoiceItems} for the field documentation. */ - public Builder addAllAddInvoiceItem(List elements) { + public Builder addAllAddInvoiceItem( + List elements) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -1300,7 +1356,8 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { } /** Automatic tax settings for this phase. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax( + SubscriptionScheduleUpdateParams.Phase.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -1311,7 +1368,8 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * this phase specifies a trial. For more information, see the billing cycle documentation. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + SubscriptionScheduleUpdateParams.Phase.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -1320,7 +1378,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleUpdateParams.Phase.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -1341,7 +1400,8 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * email your customer an invoice with payment instructions. Defaults to {@code * charge_automatically} on creation. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod( + SubscriptionScheduleUpdateParams.Phase.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -1452,13 +1512,31 @@ public Builder setDefaultTaxRates(List defaultTaxRates) { return this; } + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * Subscription description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + /** * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleUpdateParams.Phase#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionScheduleUpdateParams.Phase.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1472,7 +1550,8 @@ public Builder addDiscount(Discount element) { * SubscriptionScheduleUpdateParams.Phase#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount( + List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -1495,7 +1574,7 @@ public Builder setDiscounts(EmptyParam discounts) { * discount from the subscription's customer. Pass an empty string to avoid inheriting any * discounts. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -1513,7 +1592,7 @@ public Builder setEndDate(Long endDate) { * The date at which this phase of the subscription schedule ends. If set, {@code iterations} * must not be set. */ - public Builder setEndDate(EndDate endDate) { + public Builder setEndDate(SubscriptionScheduleUpdateParams.Phase.EndDate endDate) { this.endDate = endDate; return this; } @@ -1545,7 +1624,8 @@ public Builder putAllExtraParam(Map map) { } /** All invoices will be billed using the specified settings. */ - public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { + public Builder setInvoiceSettings( + SubscriptionScheduleUpdateParams.Phase.InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; return this; } @@ -1555,7 +1635,7 @@ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleUpdateParams.Phase#items} for the field documentation. */ - public Builder addItem(Item element) { + public Builder addItem(SubscriptionScheduleUpdateParams.Phase.Item element) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1568,7 +1648,7 @@ public Builder addItem(Item element) { * and subsequent calls adds additional elements to the original list. See {@link * SubscriptionScheduleUpdateParams.Phase#items} for the field documentation. */ - public Builder addAllItem(List elements) { + public Builder addAllItem(List elements) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -1618,7 +1698,8 @@ public Builder putAllMetadata(Map map) { * href="https://stripe.com/docs/billing/subscriptions/prorations">prorations when * transitioning to this phase. The default value is {@code create_prorations}. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionScheduleUpdateParams.Phase.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -1636,7 +1717,7 @@ public Builder setStartDate(Long startDate) { * The date at which this phase of the subscription schedule starts or {@code now}. Must be * set on the first phase. */ - public Builder setStartDate(StartDate startDate) { + public Builder setStartDate(SubscriptionScheduleUpdateParams.Phase.StartDate startDate) { this.startDate = startDate; return this; } @@ -1645,7 +1726,8 @@ public Builder setStartDate(StartDate startDate) { * The data with which to automatically create a Transfer for each of the associated * subscription's invoices. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData( + SubscriptionScheduleUpdateParams.Phase.TransferData transferData) { this.transferData = transferData; return this; } @@ -1660,7 +1742,8 @@ public Builder setTrial(Boolean trial) { } /** Specify trial behavior when crossing phase boundaries. */ - public Builder setTrialContinuation(TrialContinuation trialContinuation) { + public Builder setTrialContinuation( + SubscriptionScheduleUpdateParams.Phase.TrialContinuation trialContinuation) { this.trialContinuation = trialContinuation; return this; } @@ -1678,7 +1761,7 @@ public Builder setTrialEnd(Long trialEnd) { * Sets the phase to trialing from the start date to this date. Must be before the phase end * date, can not be combined with {@code trial} */ - public Builder setTrialEnd(TrialEnd trialEnd) { + public Builder setTrialEnd(SubscriptionScheduleUpdateParams.Phase.TrialEnd trialEnd) { this.trialEnd = trialEnd; return this; } @@ -1688,7 +1771,7 @@ public Builder setTrialEnd(TrialEnd trialEnd) { public static class AddInvoiceItem { /** The coupons to redeem into discounts for the item. */ @SerializedName("discounts") - List discounts; + List discounts; /** * Map of extra parameters for custom features not available in this client library. The @@ -1722,7 +1805,7 @@ public static class AddInvoiceItem { Object taxRates; private AddInvoiceItem( - List discounts, + List discounts, Map extraParams, Object price, PriceData priceData, @@ -1741,7 +1824,7 @@ public static Builder builder() { } public static class Builder { - private List discounts; + private List discounts; private Map extraParams; @@ -1754,8 +1837,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public AddInvoiceItem build() { - return new AddInvoiceItem( + public SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem build() { + return new SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem( this.discounts, this.extraParams, this.price, @@ -1770,7 +1853,8 @@ public AddInvoiceItem build() { * SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem#discounts} for the field * documentation. */ - public Builder addDiscount(Discount element) { + public Builder addDiscount( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Discount element) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -1784,7 +1868,8 @@ public Builder addDiscount(Discount element) { * SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem#discounts} for the field * documentation. */ - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount( + List elements) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -1836,7 +1921,8 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1934,8 +2020,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Discount build() { + return new SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2074,8 +2161,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.PriceData build() { + return new SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.PriceData( this.currency, this.extraParams, this.product, @@ -2151,7 +2238,9 @@ public Builder setProduct(EmptyParam product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as * either {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.PriceData.TaxBehavior + taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2239,8 +2328,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionScheduleUpdateParams.Phase.AutomaticTax build() { + return new SubscriptionScheduleUpdateParams.Phase.AutomaticTax( + this.enabled, this.extraParams); } /** @@ -2324,8 +2414,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionScheduleUpdateParams.Phase.BillingThresholds build() { + return new SubscriptionScheduleUpdateParams.Phase.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -2412,8 +2502,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionScheduleUpdateParams.Phase.Discount build() { + return new SubscriptionScheduleUpdateParams.Phase.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2504,8 +2595,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue, this.extraParams); + public SubscriptionScheduleUpdateParams.Phase.InvoiceSettings build() { + return new SubscriptionScheduleUpdateParams.Phase.InvoiceSettings( + this.daysUntilDue, this.extraParams); } /** @@ -2670,8 +2762,8 @@ public static class Builder { private Trial trial; /** Finalize and obtain parameter instance from this builder. */ - public Item build() { - return new Item( + public SubscriptionScheduleUpdateParams.Phase.Item build() { + return new SubscriptionScheduleUpdateParams.Phase.Item( this.billingThresholds, this.discounts, this.extraParams, @@ -2689,7 +2781,8 @@ public Item build() { * new billing period. When updating, pass an empty string to remove previously-defined * thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionScheduleUpdateParams.Phase.Item.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -2710,7 +2803,7 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { * SubscriptionScheduleUpdateParams.Phase.Item#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionScheduleUpdateParams.Phase.Item.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2725,7 +2818,8 @@ public Builder addDiscount(Discount element) { * SubscriptionScheduleUpdateParams.Phase.Item#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount( + List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2741,7 +2835,8 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The coupons to redeem into discounts for the subscription item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts( + List discounts) { this.discounts = discounts; return this; } @@ -2835,7 +2930,8 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData( + SubscriptionScheduleUpdateParams.Phase.Item.PriceData priceData) { this.priceData = priceData; return this; } @@ -2902,7 +2998,7 @@ public Builder setTaxRates(List taxRates) { } /** Options that configure the trial on the subscription item. */ - public Builder setTrial(Trial trial) { + public Builder setTrial(SubscriptionScheduleUpdateParams.Phase.Item.Trial trial) { this.trial = trial; return this; } @@ -2939,8 +3035,9 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public SubscriptionScheduleUpdateParams.Phase.Item.BillingThresholds build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.BillingThresholds( + this.extraParams, this.usageGte); } /** @@ -3019,8 +3116,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionScheduleUpdateParams.Phase.Item.Discount build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -3167,8 +3265,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionScheduleUpdateParams.Phase.Item.PriceData build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.PriceData( this.currency, this.extraParams, this.product, @@ -3242,7 +3340,8 @@ public Builder setProduct(EmptyParam product) { * The recurring components of a price such as {@code interval} and {@code * interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring( + SubscriptionScheduleUpdateParams.Phase.Item.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -3252,7 +3351,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as * either {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionScheduleUpdateParams.Phase.Item.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -3333,8 +3433,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public SubscriptionScheduleUpdateParams.Phase.Item.PriceData.Recurring build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -3371,7 +3472,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or * {@code year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionScheduleUpdateParams.Phase.Item.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -3459,8 +3561,9 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Trial build() { - return new Trial(this.extraParams, this.type); + public SubscriptionScheduleUpdateParams.Phase.Item.Trial build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.Trial( + this.extraParams, this.type); } /** @@ -3492,7 +3595,7 @@ public Builder putAllExtraParam(Map map) { } /** Determines the type of trial for this item. */ - public Builder setType(Type type) { + public Builder setType(SubscriptionScheduleUpdateParams.Phase.Item.Trial.Type type) { this.type = type; return this; } @@ -3557,8 +3660,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionScheduleUpdateParams.Phase.TransferData build() { + return new SubscriptionScheduleUpdateParams.Phase.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** @@ -3744,8 +3848,8 @@ public static class Builder { private Long iterations; /** Finalize and obtain parameter instance from this builder. */ - public Prebilling build() { - return new Prebilling(this.extraParams, this.iterations); + public SubscriptionScheduleUpdateParams.Prebilling build() { + return new SubscriptionScheduleUpdateParams.Prebilling(this.extraParams, this.iterations); } /** diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index bbd9c5de31a..d34103b9f8c 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -18,7 +18,7 @@ public class SubscriptionUpdateParams extends ApiRequestParams { * for this subscription. You may pass up to 20 items. */ @SerializedName("add_invoice_items") - List addInvoiceItems; + List addInvoiceItems; /** * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the @@ -152,7 +152,7 @@ public class SubscriptionUpdateParams extends ApiRequestParams { /** A list of up to 20 subscription items, each with an attached price. */ @SerializedName("items") - List items; + List items; /** * Set of key-value pairs that you can attach @@ -273,7 +273,7 @@ public class SubscriptionUpdateParams extends ApiRequestParams { Boolean trialFromPlan; private SubscriptionUpdateParams( - List addInvoiceItems, + List addInvoiceItems, BigDecimal applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, @@ -290,7 +290,7 @@ private SubscriptionUpdateParams( Object discounts, List expand, Map extraParams, - List items, + List items, Object metadata, Boolean offSession, Object pauseCollection, @@ -342,7 +342,7 @@ public static Builder builder() { } public static class Builder { - private List addInvoiceItems; + private List addInvoiceItems; private BigDecimal applicationFeePercent; @@ -376,7 +376,7 @@ public static class Builder { private Map extraParams; - private List items; + private List items; private Object metadata; @@ -445,7 +445,7 @@ public SubscriptionUpdateParams build() { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionUpdateParams#addInvoiceItems} for the field documentation. */ - public Builder addAddInvoiceItem(AddInvoiceItem element) { + public Builder addAddInvoiceItem(SubscriptionUpdateParams.AddInvoiceItem element) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -458,7 +458,7 @@ public Builder addAddInvoiceItem(AddInvoiceItem element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionUpdateParams#addInvoiceItems} for the field documentation. */ - public Builder addAllAddInvoiceItem(List elements) { + public Builder addAllAddInvoiceItem(List elements) { if (this.addInvoiceItems == null) { this.addInvoiceItems = new ArrayList<>(); } @@ -483,7 +483,7 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { * Automatic tax settings for this subscription. We recommend you only include this parameter * when the existing value is being changed. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(SubscriptionUpdateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } @@ -494,7 +494,8 @@ public Builder setAutomaticTax(AutomaticTax automaticTax) { * the billing cycle documentation. */ - public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { + public Builder setBillingCycleAnchor( + SubscriptionUpdateParams.BillingCycleAnchor billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; } @@ -503,7 +504,8 @@ public Builder setBillingCycleAnchor(BillingCycleAnchor billingCycleAnchor) { * Define thresholds at which an invoice will be sent, and the subscription advanced to a new * billing period. Pass an empty string to remove previously-defined thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionUpdateParams.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -553,7 +555,7 @@ public Builder setCancelAtPeriodEnd(Boolean cancelAtPeriodEnd) { * attached to the customer. When sending an invoice, Stripe will email your customer an invoice * with payment instructions. Defaults to {@code charge_automatically}. */ - public Builder setCollectionMethod(CollectionMethod collectionMethod) { + public Builder setCollectionMethod(SubscriptionUpdateParams.CollectionMethod collectionMethod) { this.collectionMethod = collectionMethod; return this; } @@ -711,7 +713,7 @@ public Builder setDescription(EmptyParam description) { * SubscriptionUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionUpdateParams.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -725,7 +727,7 @@ public Builder addDiscount(Discount element) { * SubscriptionUpdateParams#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -746,7 +748,7 @@ public Builder setDiscounts(EmptyParam discounts) { * The coupons to redeem into discounts for the subscription. If not specified or empty, * inherits the discount from the subscription's customer. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -808,7 +810,7 @@ public Builder putAllExtraParam(Map map) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionUpdateParams#items} for the field documentation. */ - public Builder addItem(Item element) { + public Builder addItem(SubscriptionUpdateParams.Item element) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -821,7 +823,7 @@ public Builder addItem(Item element) { * subsequent calls adds additional elements to the original list. See {@link * SubscriptionUpdateParams#items} for the field documentation. */ - public Builder addAllItem(List elements) { + public Builder addAllItem(List elements) { if (this.items == null) { this.items = new ArrayList<>(); } @@ -886,7 +888,7 @@ public Builder setOffSession(Boolean offSession) { } /** If specified, payment collection for this subscription will be paused. */ - public Builder setPauseCollection(PauseCollection pauseCollection) { + public Builder setPauseCollection(SubscriptionUpdateParams.PauseCollection pauseCollection) { this.pauseCollection = pauseCollection; return this; } @@ -925,13 +927,13 @@ public Builder setPauseCollection(EmptyParam pauseCollection) { * API versions prior to 2019-03-14. See the changelog to learn more. */ - public Builder setPaymentBehavior(PaymentBehavior paymentBehavior) { + public Builder setPaymentBehavior(SubscriptionUpdateParams.PaymentBehavior paymentBehavior) { this.paymentBehavior = paymentBehavior; return this; } /** Payment settings to pass to invoices created by the subscription. */ - public Builder setPaymentSettings(PaymentSettings paymentSettings) { + public Builder setPaymentSettings(SubscriptionUpdateParams.PaymentSettings paymentSettings) { this.paymentSettings = paymentSettings; return this; } @@ -942,7 +944,7 @@ public Builder setPaymentSettings(PaymentSettings paymentSettings) { * given subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval( - PendingInvoiceItemInterval pendingInvoiceItemInterval) { + SubscriptionUpdateParams.PendingInvoiceItemInterval pendingInvoiceItemInterval) { this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; return this; } @@ -958,7 +960,7 @@ public Builder setPendingInvoiceItemInterval(EmptyParam pendingInvoiceItemInterv } /** If specified, the invoicing for the given billing cycle iterations will be processed now. */ - public Builder setPrebilling(Prebilling prebilling) { + public Builder setPrebilling(SubscriptionUpdateParams.Prebilling prebilling) { this.prebilling = prebilling; return this; } @@ -987,7 +989,8 @@ public Builder setPromotionCode(EmptyParam promotionCode) { * billing cycle changes (e.g., when switching plans, resetting {@code * billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes. */ - public Builder setProrationBehavior(ProrationBehavior prorationBehavior) { + public Builder setProrationBehavior( + SubscriptionUpdateParams.ProrationBehavior prorationBehavior) { this.prorationBehavior = prorationBehavior; return this; } @@ -1009,7 +1012,7 @@ public Builder setProrationDate(Long prorationDate) { * destination and the ID of the resulting transfers will be found on the resulting charges. * This will be unset if you POST an empty value. */ - public Builder setTransferData(TransferData transferData) { + public Builder setTransferData(SubscriptionUpdateParams.TransferData transferData) { this.transferData = transferData; return this; } @@ -1031,7 +1034,7 @@ public Builder setTransferData(EmptyParam transferData) { * customer is being subscribed to. The special value {@code now} can be provided to end the * customer's trial immediately. Can be at most two years from {@code billing_cycle_anchor}. */ - public Builder setTrialEnd(TrialEnd trialEnd) { + public Builder setTrialEnd(SubscriptionUpdateParams.TrialEnd trialEnd) { this.trialEnd = trialEnd; return this; } @@ -1065,7 +1068,7 @@ public Builder setTrialFromPlan(Boolean trialFromPlan) { public static class AddInvoiceItem { /** The coupons to redeem into discounts for the item. */ @SerializedName("discounts") - List discounts; + List discounts; /** * Map of extra parameters for custom features not available in this client library. The content @@ -1099,7 +1102,7 @@ public static class AddInvoiceItem { Object taxRates; private AddInvoiceItem( - List discounts, + List discounts, Map extraParams, Object price, PriceData priceData, @@ -1118,7 +1121,7 @@ public static Builder builder() { } public static class Builder { - private List discounts; + private List discounts; private Map extraParams; @@ -1131,8 +1134,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public AddInvoiceItem build() { - return new AddInvoiceItem( + public SubscriptionUpdateParams.AddInvoiceItem build() { + return new SubscriptionUpdateParams.AddInvoiceItem( this.discounts, this.extraParams, this.price, @@ -1146,7 +1149,7 @@ public AddInvoiceItem build() { * and subsequent calls adds additional elements to the original list. See {@link * SubscriptionUpdateParams.AddInvoiceItem#discounts} for the field documentation. */ - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionUpdateParams.AddInvoiceItem.Discount element) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -1159,7 +1162,8 @@ public Builder addDiscount(Discount element) { * call, and subsequent calls adds additional elements to the original list. See {@link * SubscriptionUpdateParams.AddInvoiceItem#discounts} for the field documentation. */ - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount( + List elements) { if (this.discounts == null) { this.discounts = new ArrayList<>(); } @@ -1210,7 +1214,7 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(SubscriptionUpdateParams.AddInvoiceItem.PriceData priceData) { this.priceData = priceData; return this; } @@ -1305,8 +1309,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionUpdateParams.AddInvoiceItem.Discount build() { + return new SubscriptionUpdateParams.AddInvoiceItem.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1442,8 +1447,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionUpdateParams.AddInvoiceItem.PriceData build() { + return new SubscriptionUpdateParams.AddInvoiceItem.PriceData( this.currency, this.extraParams, this.product, @@ -1517,7 +1522,8 @@ public Builder setProduct(EmptyParam product) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionUpdateParams.AddInvoiceItem.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -1605,8 +1611,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public AutomaticTax build() { - return new AutomaticTax(this.enabled, this.extraParams); + public SubscriptionUpdateParams.AutomaticTax build() { + return new SubscriptionUpdateParams.AutomaticTax(this.enabled, this.extraParams); } /** @@ -1688,8 +1694,8 @@ public static class Builder { private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds( + public SubscriptionUpdateParams.BillingThresholds build() { + return new SubscriptionUpdateParams.BillingThresholds( this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } @@ -1775,8 +1781,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionUpdateParams.Discount build() { + return new SubscriptionUpdateParams.Discount(this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -1966,8 +1972,8 @@ public static class Builder { private Object taxRates; /** Finalize and obtain parameter instance from this builder. */ - public Item build() { - return new Item( + public SubscriptionUpdateParams.Item build() { + return new SubscriptionUpdateParams.Item( this.billingThresholds, this.clearUsage, this.deleted, @@ -1987,7 +1993,8 @@ public Item build() { * billing period. When updating, pass an empty string to remove previously-defined * thresholds. */ - public Builder setBillingThresholds(BillingThresholds billingThresholds) { + public Builder setBillingThresholds( + SubscriptionUpdateParams.Item.BillingThresholds billingThresholds) { this.billingThresholds = billingThresholds; return this; } @@ -2023,7 +2030,7 @@ public Builder setDeleted(Boolean deleted) { * SubscriptionUpdateParams.Item#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addDiscount(Discount element) { + public Builder addDiscount(SubscriptionUpdateParams.Item.Discount element) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2037,7 +2044,7 @@ public Builder addDiscount(Discount element) { * SubscriptionUpdateParams.Item#discounts} for the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllDiscount(List elements) { + public Builder addAllDiscount(List elements) { if (this.discounts == null || this.discounts instanceof EmptyParam) { this.discounts = new ArrayList(); } @@ -2052,7 +2059,7 @@ public Builder setDiscounts(EmptyParam discounts) { } /** The coupons to redeem into discounts for the subscription item. */ - public Builder setDiscounts(List discounts) { + public Builder setDiscounts(List discounts) { this.discounts = discounts; return this; } @@ -2179,7 +2186,7 @@ public Builder setPrice(EmptyParam price) { * Data used to generate a new Price object * inline. */ - public Builder setPriceData(PriceData priceData) { + public Builder setPriceData(SubscriptionUpdateParams.Item.PriceData priceData) { this.priceData = priceData; return this; } @@ -2273,8 +2280,9 @@ public static class Builder { private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ - public BillingThresholds build() { - return new BillingThresholds(this.extraParams, this.usageGte); + public SubscriptionUpdateParams.Item.BillingThresholds build() { + return new SubscriptionUpdateParams.Item.BillingThresholds( + this.extraParams, this.usageGte); } /** @@ -2350,8 +2358,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Discount build() { - return new Discount(this.coupon, this.discount, this.extraParams); + public SubscriptionUpdateParams.Item.Discount build() { + return new SubscriptionUpdateParams.Item.Discount( + this.coupon, this.discount, this.extraParams); } /** ID of the coupon to create a new discount for. */ @@ -2497,8 +2506,8 @@ public static class Builder { private Object unitAmountDecimal; /** Finalize and obtain parameter instance from this builder. */ - public PriceData build() { - return new PriceData( + public SubscriptionUpdateParams.Item.PriceData build() { + return new SubscriptionUpdateParams.Item.PriceData( this.currency, this.extraParams, this.product, @@ -2571,7 +2580,7 @@ public Builder setProduct(EmptyParam product) { /** * The recurring components of a price such as {@code interval} and {@code interval_count}. */ - public Builder setRecurring(Recurring recurring) { + public Builder setRecurring(SubscriptionUpdateParams.Item.PriceData.Recurring recurring) { this.recurring = recurring; return this; } @@ -2581,7 +2590,8 @@ public Builder setRecurring(Recurring recurring) { * of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either * {@code inclusive} or {@code exclusive}, it cannot be changed. */ - public Builder setTaxBehavior(TaxBehavior taxBehavior) { + public Builder setTaxBehavior( + SubscriptionUpdateParams.Item.PriceData.TaxBehavior taxBehavior) { this.taxBehavior = taxBehavior; return this; } @@ -2661,8 +2671,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public Recurring build() { - return new Recurring(this.extraParams, this.interval, this.intervalCount); + public SubscriptionUpdateParams.Item.PriceData.Recurring build() { + return new SubscriptionUpdateParams.Item.PriceData.Recurring( + this.extraParams, this.interval, this.intervalCount); } /** @@ -2697,7 +2708,8 @@ public Builder putAllExtraParam(Map map) { * Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionUpdateParams.Item.PriceData.Recurring.Interval interval) { this.interval = interval; return this; } @@ -2795,15 +2807,16 @@ public static class Builder { private Long resumesAt; /** Finalize and obtain parameter instance from this builder. */ - public PauseCollection build() { - return new PauseCollection(this.behavior, this.extraParams, this.resumesAt); + public SubscriptionUpdateParams.PauseCollection build() { + return new SubscriptionUpdateParams.PauseCollection( + this.behavior, this.extraParams, this.resumesAt); } /** * The payment collection behavior for this subscription while paused. One of {@code * keep_as_draft}, {@code mark_uncollectible}, or {@code void}. */ - public Builder setBehavior(Behavior behavior) { + public Builder setBehavior(SubscriptionUpdateParams.PauseCollection.Behavior behavior) { this.behavior = behavior; return this; } @@ -2918,8 +2931,8 @@ public static class Builder { private SaveDefaultPaymentMethod saveDefaultPaymentMethod; /** Finalize and obtain parameter instance from this builder. */ - public PaymentSettings build() { - return new PaymentSettings( + public SubscriptionUpdateParams.PaymentSettings build() { + return new SubscriptionUpdateParams.PaymentSettings( this.extraParams, this.paymentMethodOptions, this.paymentMethodTypes, @@ -2956,7 +2969,8 @@ public Builder putAllExtraParam(Map map) { /** * Payment-method-specific configuration to provide to invoices created by the subscription. */ - public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions) { + public Builder setPaymentMethodOptions( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions paymentMethodOptions) { this.paymentMethodOptions = paymentMethodOptions; return this; } @@ -2968,7 +2982,8 @@ public Builder setPaymentMethodOptions(PaymentMethodOptions paymentMethodOptions * documentation. */ @SuppressWarnings("unchecked") - public Builder addPaymentMethodType(PaymentMethodType element) { + public Builder addPaymentMethodType( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodType element) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -2985,7 +3000,8 @@ public Builder addPaymentMethodType(PaymentMethodType element) { * documentation. */ @SuppressWarnings("unchecked") - public Builder addAllPaymentMethodType(List elements) { + public Builder addAllPaymentMethodType( + List elements) { if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) { this.paymentMethodTypes = new ArrayList(); @@ -3014,7 +3030,8 @@ public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) { * default payment method, and your invoice template settings. */ - public Builder setPaymentMethodTypes(List paymentMethodTypes) { + public Builder setPaymentMethodTypes( + List paymentMethodTypes) { this.paymentMethodTypes = paymentMethodTypes; return this; } @@ -3024,7 +3041,8 @@ public Builder setPaymentMethodTypes(List paymentMethodTypes) * {@code subscription.default_payment_method} when a subscription payment succeeds. */ public Builder setSaveDefaultPaymentMethod( - SaveDefaultPaymentMethod saveDefaultPaymentMethod) { + SubscriptionUpdateParams.PaymentSettings.SaveDefaultPaymentMethod + saveDefaultPaymentMethod) { this.saveDefaultPaymentMethod = saveDefaultPaymentMethod; return this; } @@ -3120,8 +3138,8 @@ public static class Builder { private Object usBankAccount; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodOptions build() { - return new PaymentMethodOptions( + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions( this.acssDebit, this.bancontact, this.card, @@ -3135,7 +3153,8 @@ public PaymentMethodOptions build() { * This sub-hash contains details about the Canadian pre-authorized debit payment method * options to pass to the invoice’s PaymentIntent. */ - public Builder setAcssDebit(AcssDebit acssDebit) { + public Builder setAcssDebit( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; } @@ -3153,7 +3172,8 @@ public Builder setAcssDebit(EmptyParam acssDebit) { * This sub-hash contains details about the Bancontact payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setBancontact(Bancontact bancontact) { + public Builder setBancontact( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact bancontact) { this.bancontact = bancontact; return this; } @@ -3171,7 +3191,8 @@ public Builder setBancontact(EmptyParam bancontact) { * This sub-hash contains details about the Card payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setCard(Card card) { + public Builder setCard( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card card) { this.card = card; return this; } @@ -3189,7 +3210,9 @@ public Builder setCard(EmptyParam card) { * This sub-hash contains details about the Bank transfer payment method options to pass to * the invoice’s PaymentIntent. */ - public Builder setCustomerBalance(CustomerBalance customerBalance) { + public Builder setCustomerBalance( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + customerBalance) { this.customerBalance = customerBalance; return this; } @@ -3237,7 +3260,8 @@ public Builder putAllExtraParam(Map map) { * This sub-hash contains details about the Konbini payment method options to pass to the * invoice’s PaymentIntent. */ - public Builder setKonbini(Konbini konbini) { + public Builder setKonbini( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini konbini) { this.konbini = konbini; return this; } @@ -3255,7 +3279,9 @@ public Builder setKonbini(EmptyParam konbini) { * This sub-hash contains details about the ACH direct debit payment method options to pass * to the invoice’s PaymentIntent. */ - public Builder setUsBankAccount(UsBankAccount usBankAccount) { + public Builder setUsBankAccount( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + usBankAccount) { this.usBankAccount = usBankAccount; return this; } @@ -3311,8 +3337,9 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public AcssDebit build() { - return new AcssDebit(this.extraParams, this.mandateOptions, this.verificationMethod); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit( + this.extraParams, this.mandateOptions, this.verificationMethod); } /** @@ -3346,13 +3373,18 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Mandate creation. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -3389,8 +3421,11 @@ public static class Builder { private TransactionType transactionType; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions(this.extraParams, this.transactionType); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions(this.extraParams, this.transactionType); } /** @@ -3424,7 +3459,10 @@ public Builder putAllExtraParam(Map map) { } /** Transaction type of the mandate. */ - public Builder setTransactionType(TransactionType transactionType) { + public Builder setTransactionType( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit + .MandateOptions.TransactionType + transactionType) { this.transactionType = transactionType; return this; } @@ -3499,8 +3537,9 @@ public static class Builder { private PreferredLanguage preferredLanguage; /** Finalize and obtain parameter instance from this builder. */ - public Bancontact build() { - return new Bancontact(this.extraParams, this.preferredLanguage); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact( + this.extraParams, this.preferredLanguage); } /** @@ -3537,7 +3576,10 @@ public Builder putAllExtraParam(Map map) { * Preferred language of the Bancontact authorization page that the customer is redirected * to. */ - public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + public Builder setPreferredLanguage( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact + .PreferredLanguage + preferredLanguage) { this.preferredLanguage = preferredLanguage; return this; } @@ -3626,8 +3668,8 @@ public static class Builder { private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ - public Card build() { - return new Card( + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card( this.extraParams, this.mandateOptions, this.network, this.requestThreeDSecure); } @@ -3662,7 +3704,9 @@ public Builder putAllExtraParam(Map map) { } /** Configuration options for setting up an eMandate for cards issued in India. */ - public Builder setMandateOptions(MandateOptions mandateOptions) { + public Builder setMandateOptions( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + mandateOptions) { this.mandateOptions = mandateOptions; return this; } @@ -3671,7 +3715,8 @@ public Builder setMandateOptions(MandateOptions mandateOptions) { * Selected network to process this Subscription on. Depends on the available networks of * the card attached to the Subscription. Can be only set confirm-time. */ - public Builder setNetwork(Network network) { + public Builder setNetwork( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Network network) { this.network = network; return this; } @@ -3686,7 +3731,9 @@ public Builder setNetwork(Network network) { * 3D Secure for more information on how this configuration interacts with Radar and * our SCA Engine. */ - public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { + public Builder setRequestThreeDSecure( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card.RequestThreeDSecure + requestThreeDSecure) { this.requestThreeDSecure = requestThreeDSecure; return this; } @@ -3748,9 +3795,10 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public MandateOptions build() { - return new MandateOptions( - this.amount, this.amountType, this.description, this.extraParams); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card + .MandateOptions(this.amount, this.amountType, this.description, this.extraParams); } /** Amount to be charged for future payments. */ @@ -3764,7 +3812,10 @@ public Builder setAmount(Long amount) { * 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(AmountType amountType) { + public Builder setAmountType( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Card.MandateOptions + .AmountType + amountType) { this.amountType = amountType; return this; } @@ -3934,15 +3985,20 @@ public static class Builder { private Object fundingType; /** Finalize and obtain parameter instance from this builder. */ - public CustomerBalance build() { - return new CustomerBalance(this.bankTransfer, this.extraParams, this.fundingType); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance(this.bankTransfer, this.extraParams, this.fundingType); } /** * Configuration for the bank transfer funding type, if the {@code funding_type} is set to * {@code bank_transfer}. */ - public Builder setBankTransfer(BankTransfer bankTransfer) { + public Builder setBankTransfer( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer + bankTransfer) { this.bankTransfer = bankTransfer; return this; } @@ -4039,12 +4095,18 @@ public static class Builder { private Object type; /** Finalize and obtain parameter instance from this builder. */ - public BankTransfer build() { - return new BankTransfer(this.euBankTransfer, this.extraParams, this.type); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance.BankTransfer(this.euBankTransfer, this.extraParams, this.type); } /** Configuration for eu_bank_transfer funding type. */ - public Builder setEuBankTransfer(EuBankTransfer euBankTransfer) { + public Builder setEuBankTransfer( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + euBankTransfer) { this.euBankTransfer = euBankTransfer; return this; } @@ -4134,8 +4196,11 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public EuBankTransfer build() { - return new EuBankTransfer(this.country, this.extraParams); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance + .BankTransfer.EuBankTransfer + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions + .CustomerBalance.BankTransfer.EuBankTransfer(this.country, this.extraParams); } /** @@ -4214,8 +4279,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Konbini build() { - return new Konbini(this.extraParams); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini( + this.extraParams); } /** @@ -4291,8 +4357,9 @@ public static class Builder { private VerificationMethod verificationMethod; /** Finalize and obtain parameter instance from this builder. */ - public UsBankAccount build() { - return new UsBankAccount( + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount( this.extraParams, this.financialConnections, this.verificationMethod); } @@ -4327,13 +4394,19 @@ public Builder putAllExtraParam(Map map) { } /** Additional fields for Financial Connections Session creation. */ - public Builder setFinancialConnections(FinancialConnections financialConnections) { + public Builder setFinancialConnections( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + financialConnections) { this.financialConnections = financialConnections; return this; } /** Verification method for the intent. */ - public Builder setVerificationMethod(VerificationMethod verificationMethod) { + public Builder setVerificationMethod( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .VerificationMethod + verificationMethod) { this.verificationMethod = verificationMethod; return this; } @@ -4357,10 +4430,17 @@ public static class FinancialConnections { * balances}, {@code ownership}, {@code payment_method}, and {@code transactions}. */ @SerializedName("permissions") - List permissions; + List< + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; private FinancialConnections( - Map extraParams, List permissions) { + Map extraParams, + List< + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions) { this.extraParams = extraParams; this.permissions = permissions; } @@ -4372,11 +4452,17 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private List permissions; + private List< + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + permissions; /** Finalize and obtain parameter instance from this builder. */ - public FinancialConnections build() { - return new FinancialConnections(this.extraParams, this.permissions); + public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections + build() { + return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections(this.extraParams, this.permissions); } /** @@ -4416,7 +4502,10 @@ public Builder putAllExtraParam(Map map) { * SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addPermission(Permission element) { + public Builder addPermission( + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission + element) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -4431,7 +4520,11 @@ public Builder addPermission(Permission element) { * SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions} * for the field documentation. */ - public Builder addAllPermission(List elements) { + public Builder addAllPermission( + List< + SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount + .FinancialConnections.Permission> + elements) { if (this.permissions == null) { this.permissions = new ArrayList<>(); } @@ -4618,8 +4711,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public PendingInvoiceItemInterval build() { - return new PendingInvoiceItemInterval(this.extraParams, this.interval, this.intervalCount); + public SubscriptionUpdateParams.PendingInvoiceItemInterval build() { + return new SubscriptionUpdateParams.PendingInvoiceItemInterval( + this.extraParams, this.interval, this.intervalCount); } /** @@ -4654,7 +4748,8 @@ public Builder putAllExtraParam(Map map) { * Specifies invoicing frequency. Either {@code day}, {@code week}, {@code month} or {@code * year}. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + SubscriptionUpdateParams.PendingInvoiceItemInterval.Interval interval) { this.interval = interval; return this; } @@ -4722,8 +4817,8 @@ public static class Builder { private Long iterations; /** Finalize and obtain parameter instance from this builder. */ - public Prebilling build() { - return new Prebilling(this.extraParams, this.iterations); + public SubscriptionUpdateParams.Prebilling build() { + return new SubscriptionUpdateParams.Prebilling(this.extraParams, this.iterations); } /** @@ -4802,8 +4897,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public TransferData build() { - return new TransferData(this.amountPercent, this.destination, this.extraParams); + public SubscriptionUpdateParams.TransferData build() { + return new SubscriptionUpdateParams.TransferData( + this.amountPercent, this.destination, this.extraParams); } /** diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index 4ac63f41ded..ec695b482bc 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -621,6 +621,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("capability.updated") CAPABILITY__UPDATED("capability.updated"), + @SerializedName("capital.financing_transaction.created") + CAPITAL__FINANCING_TRANSACTION__CREATED("capital.financing_transaction.created"), + @SerializedName("cash_balance.funds_available") CASH_BALANCE__FUNDS_AVAILABLE("cash_balance.funds_available"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index 7bef45fff49..953a11d0fc8 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -306,6 +306,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("capability.updated") CAPABILITY__UPDATED("capability.updated"), + @SerializedName("capital.financing_transaction.created") + CAPITAL__FINANCING_TRANSACTION__CREATED("capital.financing_transaction.created"), + @SerializedName("cash_balance.funds_available") CASH_BALANCE__FUNDS_AVAILABLE("cash_balance.funds_available"), diff --git a/src/main/java/com/stripe/param/capital/FinancingOfferListParams.java b/src/main/java/com/stripe/param/capital/FinancingOfferListParams.java new file mode 100644 index 00000000000..5807d97d9a3 --- /dev/null +++ b/src/main/java/com/stripe/param/capital/FinancingOfferListParams.java @@ -0,0 +1,365 @@ +// File generated from our OpenAPI spec +package com.stripe.param.capital; + +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.Getter; + +@Getter +public class FinancingOfferListParams extends ApiRequestParams { + /** limit list to offers belonging to given connected account. */ + @SerializedName("connected_account") + String connectedAccount; + + @SerializedName("created") + Object created; + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + @SerializedName("ending_before") + String endingBefore; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + @SerializedName("limit") + Long limit; + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, ending with + * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to + * fetch the next page of the list. + */ + @SerializedName("starting_after") + String startingAfter; + + /** limit list to offers with given status. */ + @SerializedName("status") + Status status; + + private FinancingOfferListParams( + String connectedAccount, + Object created, + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter, + Status status) { + this.connectedAccount = connectedAccount; + this.created = created; + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.startingAfter = startingAfter; + this.status = status; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String connectedAccount; + + private Object created; + + private String endingBefore; + + private List expand; + + private Map extraParams; + + private Long limit; + + private String startingAfter; + + private Status status; + + /** Finalize and obtain parameter instance from this builder. */ + public FinancingOfferListParams build() { + return new FinancingOfferListParams( + this.connectedAccount, + this.created, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter, + this.status); + } + + /** limit list to offers belonging to given connected account. */ + public Builder setConnectedAccount(String connectedAccount) { + this.connectedAccount = connectedAccount; + return this; + } + + public Builder setCreated(FinancingOfferListParams.Created created) { + this.created = created; + return this; + } + + public Builder setCreated(Long created) { + this.created = created; + return this; + } + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + public Builder setEndingBefore(String endingBefore) { + this.endingBefore = endingBefore; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingOfferListParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingOfferListParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * FinancingOfferListParams#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 FinancingOfferListParams#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 limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your + * place in the list. For instance, if you make a list request and receive 100 objects, ending + * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in + * order to fetch the next page of the list. + */ + public Builder setStartingAfter(String startingAfter) { + this.startingAfter = startingAfter; + return this; + } + + /** limit list to offers with given status. */ + public Builder setStatus(FinancingOfferListParams.Status status) { + this.status = status; + return this; + } + } + + @Getter + public static class Created { + /** + * 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; + + /** Minimum value to filter by (exclusive). */ + @SerializedName("gt") + Long gt; + + /** Minimum value to filter by (inclusive). */ + @SerializedName("gte") + Long gte; + + /** Maximum value to filter by (exclusive). */ + @SerializedName("lt") + Long lt; + + /** Maximum value to filter by (inclusive). */ + @SerializedName("lte") + Long lte; + + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; + this.gt = gt; + this.gte = gte; + this.lt = lt; + this.lte = lte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long gt; + + private Long gte; + + private Long lt; + + private Long lte; + + /** Finalize and obtain parameter instance from this builder. */ + public FinancingOfferListParams.Created build() { + return new FinancingOfferListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * FinancingOfferListParams.Created#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 FinancingOfferListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Minimum value to filter by (exclusive). */ + public Builder setGt(Long gt) { + this.gt = gt; + return this; + } + + /** Minimum value to filter by (inclusive). */ + public Builder setGte(Long gte) { + this.gte = gte; + return this; + } + + /** Maximum value to filter by (exclusive). */ + public Builder setLt(Long lt) { + this.lt = lt; + return this; + } + + /** Maximum value to filter by (inclusive). */ + public Builder setLte(Long lte) { + this.lte = lte; + return this; + } + } + } + + public enum Status implements ApiRequestParams.EnumParam { + @SerializedName("accepted") + ACCEPTED("accepted"), + + @SerializedName("canceled") + CANCELED("canceled"), + + @SerializedName("completed") + COMPLETED("completed"), + + @SerializedName("delivered") + DELIVERED("delivered"), + + @SerializedName("expired") + EXPIRED("expired"), + + @SerializedName("fully_repaid") + FULLY_REPAID("fully_repaid"), + + @SerializedName("paid_out") + PAID_OUT("paid_out"), + + @SerializedName("rejected") + REJECTED("rejected"), + + @SerializedName("undelivered") + UNDELIVERED("undelivered"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Status(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/capital/FinancingOfferMarkDeliveredParams.java b/src/main/java/com/stripe/param/capital/FinancingOfferMarkDeliveredParams.java new file mode 100644 index 00000000000..697a4df41ee --- /dev/null +++ b/src/main/java/com/stripe/param/capital/FinancingOfferMarkDeliveredParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.capital; + +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.Getter; + +@Getter +public class FinancingOfferMarkDeliveredParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 FinancingOfferMarkDeliveredParams(List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public FinancingOfferMarkDeliveredParams build() { + return new FinancingOfferMarkDeliveredParams(this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingOfferMarkDeliveredParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingOfferMarkDeliveredParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * FinancingOfferMarkDeliveredParams#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 FinancingOfferMarkDeliveredParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/capital/FinancingOfferRetrieveParams.java b/src/main/java/com/stripe/param/capital/FinancingOfferRetrieveParams.java new file mode 100644 index 00000000000..b0e5ba632d1 --- /dev/null +++ b/src/main/java/com/stripe/param/capital/FinancingOfferRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.capital; + +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.Getter; + +@Getter +public class FinancingOfferRetrieveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 FinancingOfferRetrieveParams(List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public FinancingOfferRetrieveParams build() { + return new FinancingOfferRetrieveParams(this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingOfferRetrieveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingOfferRetrieveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * FinancingOfferRetrieveParams#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 FinancingOfferRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/capital/FinancingSummaryRetrieveParams.java b/src/main/java/com/stripe/param/capital/FinancingSummaryRetrieveParams.java new file mode 100644 index 00000000000..50a933981ab --- /dev/null +++ b/src/main/java/com/stripe/param/capital/FinancingSummaryRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.capital; + +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.Getter; + +@Getter +public class FinancingSummaryRetrieveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 FinancingSummaryRetrieveParams(List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public FinancingSummaryRetrieveParams build() { + return new FinancingSummaryRetrieveParams(this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingSummaryRetrieveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingSummaryRetrieveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * FinancingSummaryRetrieveParams#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 FinancingSummaryRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/capital/FinancingTransactionListParams.java b/src/main/java/com/stripe/param/capital/FinancingTransactionListParams.java new file mode 100644 index 00000000000..9612c2dad46 --- /dev/null +++ b/src/main/java/com/stripe/param/capital/FinancingTransactionListParams.java @@ -0,0 +1,226 @@ +// File generated from our OpenAPI spec +package com.stripe.param.capital; + +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.Getter; + +@Getter +public class FinancingTransactionListParams extends ApiRequestParams { + /** + * For transactions of type {@code paydown} and reason {@code automatic_withholding} only, only + * returns transactions that were created as a result of this charge. + */ + @SerializedName("charge") + String charge; + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + @SerializedName("ending_before") + String endingBefore; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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; + + /** Returns transactions that were created that apply to this financing offer ID. */ + @SerializedName("financing_offer") + String financingOffer; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + @SerializedName("limit") + Long limit; + + /** Only returns transactions that are responsible for reversing this financing transaction ID. */ + @SerializedName("reversed_transaction") + String reversedTransaction; + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, ending with + * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to + * fetch the next page of the list. + */ + @SerializedName("starting_after") + String startingAfter; + + private FinancingTransactionListParams( + String charge, + String endingBefore, + List expand, + Map extraParams, + String financingOffer, + Long limit, + String reversedTransaction, + String startingAfter) { + this.charge = charge; + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.financingOffer = financingOffer; + this.limit = limit; + this.reversedTransaction = reversedTransaction; + this.startingAfter = startingAfter; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String charge; + + private String endingBefore; + + private List expand; + + private Map extraParams; + + private String financingOffer; + + private Long limit; + + private String reversedTransaction; + + private String startingAfter; + + /** Finalize and obtain parameter instance from this builder. */ + public FinancingTransactionListParams build() { + return new FinancingTransactionListParams( + this.charge, + this.endingBefore, + this.expand, + this.extraParams, + this.financingOffer, + this.limit, + this.reversedTransaction, + this.startingAfter); + } + + /** + * For transactions of type {@code paydown} and reason {@code automatic_withholding} only, only + * returns transactions that were created as a result of this charge. + */ + public Builder setCharge(String charge) { + this.charge = charge; + return this; + } + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + public Builder setEndingBefore(String endingBefore) { + this.endingBefore = endingBefore; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingTransactionListParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingTransactionListParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * FinancingTransactionListParams#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 FinancingTransactionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Returns transactions that were created that apply to this financing offer ID. */ + public Builder setFinancingOffer(String financingOffer) { + this.financingOffer = financingOffer; + return this; + } + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Only returns transactions that are responsible for reversing this financing transaction ID. + */ + public Builder setReversedTransaction(String reversedTransaction) { + this.reversedTransaction = reversedTransaction; + return this; + } + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your + * place in the list. For instance, if you make a list request and receive 100 objects, ending + * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in + * order to fetch the next page of the list. + */ + public Builder setStartingAfter(String startingAfter) { + this.startingAfter = startingAfter; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/capital/FinancingTransactionRetrieveParams.java b/src/main/java/com/stripe/param/capital/FinancingTransactionRetrieveParams.java new file mode 100644 index 00000000000..e4dbe8fd7f8 --- /dev/null +++ b/src/main/java/com/stripe/param/capital/FinancingTransactionRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.capital; + +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.Getter; + +@Getter +public class FinancingTransactionRetrieveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 FinancingTransactionRetrieveParams(List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public FinancingTransactionRetrieveParams build() { + return new FinancingTransactionRetrieveParams(this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingTransactionRetrieveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancingTransactionRetrieveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * FinancingTransactionRetrieveParams#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 FinancingTransactionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 746312ec9ca..793a20c7723 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -3425,6 +3425,10 @@ public static class PaymentMethodOptions { @SerializedName("paynow") Paynow paynow; + /** contains details about the PayPal payment method options. */ + @SerializedName("paypal") + Paypal paypal; + /** contains details about the Pix payment method options. */ @SerializedName("pix") Pix pix; @@ -3467,6 +3471,7 @@ private PaymentMethodOptions( Oxxo oxxo, P24 p24, Paynow paynow, + Paypal paypal, Pix pix, SepaDebit sepaDebit, Sofort sofort, @@ -3493,6 +3498,7 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; this.pix = pix; this.sepaDebit = sepaDebit; this.sofort = sofort; @@ -3547,6 +3553,8 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + private Pix pix; private SepaDebit sepaDebit; @@ -3581,6 +3589,7 @@ public SessionCreateParams.PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.paypal, this.pix, this.sepaDebit, this.sofort, @@ -3738,6 +3747,12 @@ public Builder setPaynow(SessionCreateParams.PaymentMethodOptions.Paynow paynow) return this; } + /** contains details about the PayPal payment method options. */ + public Builder setPaypal(SessionCreateParams.PaymentMethodOptions.Paypal paypal) { + this.paypal = paypal; + return this; + } + /** contains details about the Pix payment method options. */ public Builder setPix(SessionCreateParams.PaymentMethodOptions.Pix pix) { this.pix = pix; @@ -7002,6 +7017,75 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + public static class Paypal { + @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; + + private Paypal(String currency, Map extraParams) { + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.PaymentMethodOptions.Paypal build() { + return new SessionCreateParams.PaymentMethodOptions.Paypal( + this.currency, this.extraParams); + } + + 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 SessionCreateParams.PaymentMethodOptions.Paypal#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.Paypal#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 public static class Pix { /** @@ -10618,6 +10702,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + @SerializedName("pix") PIX("pix"), diff --git a/src/main/java/com/stripe/param/giftcards/CardCreateParams.java b/src/main/java/com/stripe/param/giftcards/CardCreateParams.java index ca729d4c505..32c2adb32ad 100644 --- a/src/main/java/com/stripe/param/giftcards/CardCreateParams.java +++ b/src/main/java/com/stripe/param/giftcards/CardCreateParams.java @@ -113,7 +113,7 @@ public Builder setActive(Boolean active) { } /** Related objects which created this gift card. */ - public Builder setCreatedBy(CreatedBy createdBy) { + public Builder setCreatedBy(CardCreateParams.CreatedBy createdBy) { this.createdBy = createdBy; return this; } @@ -250,8 +250,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public CreatedBy build() { - return new CreatedBy(this.extraParams, this.payment, this.type); + public CardCreateParams.CreatedBy build() { + return new CardCreateParams.CreatedBy(this.extraParams, this.payment, this.type); } /** @@ -281,13 +281,13 @@ public Builder putAllExtraParam(Map map) { } /** The details for the payment that created this object. */ - public Builder setPayment(Payment payment) { + public Builder setPayment(CardCreateParams.CreatedBy.Payment payment) { this.payment = payment; return this; } /** The type of event that created this object. */ - public Builder setType(Type type) { + public Builder setType(CardCreateParams.CreatedBy.Type type) { this.type = type; return this; } @@ -323,8 +323,8 @@ public static class Builder { private String paymentIntent; /** Finalize and obtain parameter instance from this builder. */ - public Payment build() { - return new Payment(this.extraParams, this.paymentIntent); + public CardCreateParams.CreatedBy.Payment build() { + return new CardCreateParams.CreatedBy.Payment(this.extraParams, this.paymentIntent); } /** diff --git a/src/main/java/com/stripe/param/giftcards/CardValidateParams.java b/src/main/java/com/stripe/param/giftcards/CardValidateParams.java index 138d8d25350..5cdd77e6fa5 100644 --- a/src/main/java/com/stripe/param/giftcards/CardValidateParams.java +++ b/src/main/java/com/stripe/param/giftcards/CardValidateParams.java @@ -29,15 +29,15 @@ public class CardValidateParams extends ApiRequestParams { Map extraParams; /** The pin associated with the gift card. Not all gift cards have pins. */ - @SerializedName("pin") - String pin; + @SerializedName("giftcard_pin") + String giftcardPin; private CardValidateParams( - String code, List expand, Map extraParams, String pin) { + String code, List expand, Map extraParams, String giftcardPin) { this.code = code; this.expand = expand; this.extraParams = extraParams; - this.pin = pin; + this.giftcardPin = giftcardPin; } public static Builder builder() { @@ -51,11 +51,11 @@ public static class Builder { private Map extraParams; - private String pin; + private String giftcardPin; /** Finalize and obtain parameter instance from this builder. */ public CardValidateParams build() { - return new CardValidateParams(this.code, this.expand, this.extraParams, this.pin); + return new CardValidateParams(this.code, this.expand, this.extraParams, this.giftcardPin); } /** The gift card code to be validated. */ @@ -117,8 +117,8 @@ public Builder putAllExtraParam(Map map) { } /** The pin associated with the gift card. Not all gift cards have pins. */ - public Builder setPin(String pin) { - this.pin = pin; + public Builder setGiftcardPin(String giftcardPin) { + this.giftcardPin = giftcardPin; return this; } } diff --git a/src/main/java/com/stripe/param/giftcards/TransactionCreateParams.java b/src/main/java/com/stripe/param/giftcards/TransactionCreateParams.java index 06d9675acfc..41f653cb004 100644 --- a/src/main/java/com/stripe/param/giftcards/TransactionCreateParams.java +++ b/src/main/java/com/stripe/param/giftcards/TransactionCreateParams.java @@ -154,7 +154,7 @@ public Builder setConfirm(Boolean confirm) { } /** Related objects which created this transaction. */ - public Builder setCreatedBy(CreatedBy createdBy) { + public Builder setCreatedBy(TransactionCreateParams.CreatedBy createdBy) { this.createdBy = createdBy; return this; } @@ -303,8 +303,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public CreatedBy build() { - return new CreatedBy(this.extraParams, this.payment, this.type); + public TransactionCreateParams.CreatedBy build() { + return new TransactionCreateParams.CreatedBy(this.extraParams, this.payment, this.type); } /** @@ -334,13 +334,13 @@ public Builder putAllExtraParam(Map map) { } /** The details for the payment that created this object. */ - public Builder setPayment(Payment payment) { + public Builder setPayment(TransactionCreateParams.CreatedBy.Payment payment) { this.payment = payment; return this; } /** The type of event that created this object. */ - public Builder setType(Type type) { + public Builder setType(TransactionCreateParams.CreatedBy.Type type) { this.type = type; return this; } @@ -376,8 +376,9 @@ public static class Builder { private String paymentIntent; /** Finalize and obtain parameter instance from this builder. */ - public Payment build() { - return new Payment(this.extraParams, this.paymentIntent); + public TransactionCreateParams.CreatedBy.Payment build() { + return new TransactionCreateParams.CreatedBy.Payment( + this.extraParams, this.paymentIntent); } /** diff --git a/src/main/java/com/stripe/param/issuing/CardCreateParams.java b/src/main/java/com/stripe/param/issuing/CardCreateParams.java index ff7f5e40a2f..af2beb07f89 100644 --- a/src/main/java/com/stripe/param/issuing/CardCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardCreateParams.java @@ -258,13 +258,13 @@ public Builder setReplacementFor(String replacementFor) { * If {@code replacement_for} is specified, this should indicate why that card is being * replaced. */ - public Builder setReplacementReason(ReplacementReason replacementReason) { + public Builder setReplacementReason(CardCreateParams.ReplacementReason replacementReason) { this.replacementReason = replacementReason; return this; } /** The address where the card will be shipped. */ - public Builder setShipping(Shipping shipping) { + public Builder setShipping(CardCreateParams.Shipping shipping) { this.shipping = shipping; return this; } @@ -274,19 +274,19 @@ public Builder setShipping(Shipping shipping) { * href="https://stripe.com/docs/issuing/controls/spending-controls">documentation for more * details. */ - public Builder setSpendingControls(SpendingControls spendingControls) { + public Builder setSpendingControls(CardCreateParams.SpendingControls spendingControls) { this.spendingControls = spendingControls; return this; } /** Whether authorizations can be approved on this card. Defaults to {@code inactive}. */ - public Builder setStatus(Status status) { + public Builder setStatus(CardCreateParams.Status status) { this.status = status; return this; } /** The type of card to issue. Possible values are {@code physical} or {@code virtual}. */ - public Builder setType(Type type) { + public Builder setType(CardCreateParams.Type type) { this.type = type; return this; } @@ -319,6 +319,10 @@ public static class Shipping { @SerializedName("phone_number") String phoneNumber; + /** Whether a signature is required for card delivery. */ + @SerializedName("require_signature") + Boolean requireSignature; + /** Shipment service. */ @SerializedName("service") Service service; @@ -333,6 +337,7 @@ private Shipping( Map extraParams, String name, String phoneNumber, + Boolean requireSignature, Service service, Type type) { this.address = address; @@ -340,6 +345,7 @@ private Shipping( this.extraParams = extraParams; this.name = name; this.phoneNumber = phoneNumber; + this.requireSignature = requireSignature; this.service = service; this.type = type; } @@ -359,30 +365,33 @@ public static class Builder { private String phoneNumber; + private Boolean requireSignature; + private Service service; private Type type; /** Finalize and obtain parameter instance from this builder. */ - public Shipping build() { - return new Shipping( + public CardCreateParams.Shipping build() { + return new CardCreateParams.Shipping( this.address, this.customs, this.extraParams, this.name, this.phoneNumber, + this.requireSignature, this.service, this.type); } /** The address that the card is shipped to. */ - public Builder setAddress(Address address) { + public Builder setAddress(CardCreateParams.Shipping.Address address) { this.address = address; return this; } /** Customs information for the shipment. */ - public Builder setCustoms(Customs customs) { + public Builder setCustoms(CardCreateParams.Shipping.Customs customs) { this.customs = customs; return this; } @@ -425,14 +434,20 @@ public Builder setPhoneNumber(String phoneNumber) { return this; } + /** Whether a signature is required for card delivery. */ + public Builder setRequireSignature(Boolean requireSignature) { + this.requireSignature = requireSignature; + return this; + } + /** Shipment service. */ - public Builder setService(Service service) { + public Builder setService(CardCreateParams.Shipping.Service service) { this.service = service; return this; } /** Packaging options. */ - public Builder setType(Type type) { + public Builder setType(CardCreateParams.Shipping.Type type) { this.type = type; return this; } @@ -513,8 +528,8 @@ public static class Builder { private String state; /** Finalize and obtain parameter instance from this builder. */ - public Address build() { - return new Address( + public CardCreateParams.Shipping.Address build() { + return new CardCreateParams.Shipping.Address( this.city, this.country, this.extraParams, @@ -626,8 +641,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Customs build() { - return new Customs(this.eoriNumber, this.extraParams); + public CardCreateParams.Shipping.Customs build() { + return new CardCreateParams.Shipping.Customs(this.eoriNumber, this.extraParams); } /** @@ -712,7 +727,7 @@ public static class SpendingControls { * blocked_categories}. */ @SerializedName("allowed_categories") - List allowedCategories; + List allowedCategories; /** * Array of strings containing blockedCategories; + List blockedCategories; /** * Map of extra parameters for custom features not available in this client library. The content @@ -738,13 +753,13 @@ public static class SpendingControls { * the chain). */ @SerializedName("spending_limits") - List spendingLimits; + List spendingLimits; private SpendingControls( - List allowedCategories, - List blockedCategories, + List allowedCategories, + List blockedCategories, Map extraParams, - List spendingLimits) { + List spendingLimits) { this.allowedCategories = allowedCategories; this.blockedCategories = blockedCategories; this.extraParams = extraParams; @@ -756,17 +771,17 @@ public static Builder builder() { } public static class Builder { - private List allowedCategories; + private List allowedCategories; - private List blockedCategories; + private List blockedCategories; private Map extraParams; - private List spendingLimits; + private List spendingLimits; /** Finalize and obtain parameter instance from this builder. */ - public SpendingControls build() { - return new SpendingControls( + public CardCreateParams.SpendingControls build() { + return new CardCreateParams.SpendingControls( this.allowedCategories, this.blockedCategories, this.extraParams, this.spendingLimits); } @@ -775,7 +790,7 @@ public SpendingControls build() { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardCreateParams.SpendingControls#allowedCategories} for the field documentation. */ - public Builder addAllowedCategory(AllowedCategory element) { + public Builder addAllowedCategory(CardCreateParams.SpendingControls.AllowedCategory element) { if (this.allowedCategories == null) { this.allowedCategories = new ArrayList<>(); } @@ -788,7 +803,8 @@ public Builder addAllowedCategory(AllowedCategory element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardCreateParams.SpendingControls#allowedCategories} for the field documentation. */ - public Builder addAllAllowedCategory(List elements) { + public Builder addAllAllowedCategory( + List elements) { if (this.allowedCategories == null) { this.allowedCategories = new ArrayList<>(); } @@ -801,7 +817,7 @@ public Builder addAllAllowedCategory(List elements) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardCreateParams.SpendingControls#blockedCategories} for the field documentation. */ - public Builder addBlockedCategory(BlockedCategory element) { + public Builder addBlockedCategory(CardCreateParams.SpendingControls.BlockedCategory element) { if (this.blockedCategories == null) { this.blockedCategories = new ArrayList<>(); } @@ -814,7 +830,8 @@ public Builder addBlockedCategory(BlockedCategory element) { * `add/addAll` call, and subsequent calls adds additional elements to the original list. See * {@link CardCreateParams.SpendingControls#blockedCategories} for the field documentation. */ - public Builder addAllBlockedCategory(List elements) { + public Builder addAllBlockedCategory( + List elements) { if (this.blockedCategories == null) { this.blockedCategories = new ArrayList<>(); } @@ -853,7 +870,7 @@ public Builder putAllExtraParam(Map map) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardCreateParams.SpendingControls#spendingLimits} for the field documentation. */ - public Builder addSpendingLimit(SpendingLimit element) { + public Builder addSpendingLimit(CardCreateParams.SpendingControls.SpendingLimit element) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } @@ -866,7 +883,8 @@ public Builder addSpendingLimit(SpendingLimit element) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardCreateParams.SpendingControls#spendingLimits} for the field documentation. */ - public Builder addAllSpendingLimit(List elements) { + public Builder addAllSpendingLimit( + List elements) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } @@ -887,7 +905,7 @@ public static class SpendingLimit { * this limit applies to. Omitting this field will apply the limit to all categories. */ @SerializedName("categories") - List categories; + List categories; /** * Map of extra parameters for custom features not available in this client library. The @@ -904,7 +922,7 @@ public static class SpendingLimit { private SpendingLimit( Long amount, - List categories, + List categories, Map extraParams, Interval interval) { this.amount = amount; @@ -920,15 +938,16 @@ public static Builder builder() { public static class Builder { private Long amount; - private List categories; + private List categories; private Map extraParams; private Interval interval; /** Finalize and obtain parameter instance from this builder. */ - public SpendingLimit build() { - return new SpendingLimit(this.amount, this.categories, this.extraParams, this.interval); + public CardCreateParams.SpendingControls.SpendingLimit build() { + return new CardCreateParams.SpendingControls.SpendingLimit( + this.amount, this.categories, this.extraParams, this.interval); } /** Maximum amount allowed to spend per interval. */ @@ -942,7 +961,8 @@ public Builder setAmount(Long amount) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardCreateParams.SpendingControls.SpendingLimit#categories} for the field documentation. */ - public Builder addCategory(Category element) { + public Builder addCategory( + CardCreateParams.SpendingControls.SpendingLimit.Category element) { if (this.categories == null) { this.categories = new ArrayList<>(); } @@ -955,7 +975,8 @@ public Builder addCategory(Category element) { * call, and subsequent calls adds additional elements to the original list. See {@link * CardCreateParams.SpendingControls.SpendingLimit#categories} for the field documentation. */ - public Builder addAllCategory(List elements) { + public Builder addAllCategory( + List elements) { if (this.categories == null) { this.categories = new ArrayList<>(); } @@ -992,7 +1013,8 @@ public Builder putAllExtraParam(Map map) { } /** Interval (or event) to which the amount applies. */ - public Builder setInterval(Interval interval) { + public Builder setInterval( + CardCreateParams.SpendingControls.SpendingLimit.Interval interval) { this.interval = interval; return this; } diff --git a/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java b/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java index 0a17ab432c4..f1376896b49 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java @@ -129,7 +129,8 @@ public Builder putAllExtraParam(Map map) { } /** Simulated data for the interac_present payment method. */ - public Builder setInteracPresent(InteracPresent interacPresent) { + public Builder setInteracPresent( + ReaderPresentPaymentMethodParams.InteracPresent interacPresent) { this.interacPresent = interacPresent; return this; } @@ -240,8 +241,8 @@ public static class Builder { private String number; /** Finalize and obtain parameter instance from this builder. */ - public InteracPresent build() { - return new InteracPresent(this.extraParams, this.number); + public ReaderPresentPaymentMethodParams.InteracPresent build() { + return new ReaderPresentPaymentMethodParams.InteracPresent(this.extraParams, this.number); } /** diff --git a/src/main/java/com/stripe/param/treasury/OutboundTransferCreateParams.java b/src/main/java/com/stripe/param/treasury/OutboundTransferCreateParams.java index 7e16ffca595..07b248e85ef 100644 --- a/src/main/java/com/stripe/param/treasury/OutboundTransferCreateParams.java +++ b/src/main/java/com/stripe/param/treasury/OutboundTransferCreateParams.java @@ -262,7 +262,7 @@ public Builder putAllMetadata(Map map) { } /** Details about the network used for the OutboundTransfer. */ - public Builder setNetworkDetails(NetworkDetails networkDetails) { + public Builder setNetworkDetails(OutboundTransferCreateParams.NetworkDetails networkDetails) { this.networkDetails = networkDetails; return this; } @@ -484,12 +484,13 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public NetworkDetails build() { - return new NetworkDetails(this.ach, this.extraParams, this.type); + public OutboundTransferCreateParams.NetworkDetails build() { + return new OutboundTransferCreateParams.NetworkDetails( + this.ach, this.extraParams, this.type); } /** Optional fields for {@code ach}. */ - public Builder setAch(Ach ach) { + public Builder setAch(OutboundTransferCreateParams.NetworkDetails.Ach ach) { this.ach = ach; return this; } @@ -522,7 +523,7 @@ public Builder putAllExtraParam(Map map) { } /** The type of flow that originated the OutboundTransfer. */ - public Builder setType(Type type) { + public Builder setType(OutboundTransferCreateParams.NetworkDetails.Type type) { this.type = type; return this; } @@ -558,8 +559,9 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.addenda, this.extraParams); + public OutboundTransferCreateParams.NetworkDetails.Ach build() { + return new OutboundTransferCreateParams.NetworkDetails.Ach( + this.addenda, this.extraParams); } /** Addenda record data associated with this OutboundTransfer. */ diff --git a/src/main/java/com/stripe/param/treasury/ReceivedCreditCreateParams.java b/src/main/java/com/stripe/param/treasury/ReceivedCreditCreateParams.java index 9a9cefaeb08..ab893825d18 100644 --- a/src/main/java/com/stripe/param/treasury/ReceivedCreditCreateParams.java +++ b/src/main/java/com/stripe/param/treasury/ReceivedCreditCreateParams.java @@ -207,7 +207,7 @@ public Builder setNetwork(ReceivedCreditCreateParams.Network network) { } /** Details about the network used for the ReceivedCredit. */ - public Builder setNetworkDetails(NetworkDetails networkDetails) { + public Builder setNetworkDetails(ReceivedCreditCreateParams.NetworkDetails networkDetails) { this.networkDetails = networkDetails; return this; } @@ -451,12 +451,12 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public NetworkDetails build() { - return new NetworkDetails(this.ach, this.extraParams, this.type); + public ReceivedCreditCreateParams.NetworkDetails build() { + return new ReceivedCreditCreateParams.NetworkDetails(this.ach, this.extraParams, this.type); } /** Optional fields for {@code ach}. */ - public Builder setAch(Ach ach) { + public Builder setAch(ReceivedCreditCreateParams.NetworkDetails.Ach ach) { this.ach = ach; return this; } @@ -489,7 +489,7 @@ public Builder putAllExtraParam(Map map) { } /** The type of flow that originated the ReceivedCredit. */ - public Builder setType(Type type) { + public Builder setType(ReceivedCreditCreateParams.NetworkDetails.Type type) { this.type = type; return this; } @@ -525,8 +525,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.addenda, this.extraParams); + public ReceivedCreditCreateParams.NetworkDetails.Ach build() { + return new ReceivedCreditCreateParams.NetworkDetails.Ach(this.addenda, this.extraParams); } /** ACH Addenda record. */ diff --git a/src/main/java/com/stripe/param/treasury/ReceivedDebitCreateParams.java b/src/main/java/com/stripe/param/treasury/ReceivedDebitCreateParams.java index c6754840794..4ec14d0a37d 100644 --- a/src/main/java/com/stripe/param/treasury/ReceivedDebitCreateParams.java +++ b/src/main/java/com/stripe/param/treasury/ReceivedDebitCreateParams.java @@ -207,7 +207,7 @@ public Builder setNetwork(ReceivedDebitCreateParams.Network network) { } /** Details about the network used for the ReceivedDebit. */ - public Builder setNetworkDetails(NetworkDetails networkDetails) { + public Builder setNetworkDetails(ReceivedDebitCreateParams.NetworkDetails networkDetails) { this.networkDetails = networkDetails; return this; } @@ -451,12 +451,12 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public NetworkDetails build() { - return new NetworkDetails(this.ach, this.extraParams, this.type); + public ReceivedDebitCreateParams.NetworkDetails build() { + return new ReceivedDebitCreateParams.NetworkDetails(this.ach, this.extraParams, this.type); } /** Optional fields for {@code ach}. */ - public Builder setAch(Ach ach) { + public Builder setAch(ReceivedDebitCreateParams.NetworkDetails.Ach ach) { this.ach = ach; return this; } @@ -489,7 +489,7 @@ public Builder putAllExtraParam(Map map) { } /** The type of flow that originated the ReceivedDebit. */ - public Builder setType(Type type) { + public Builder setType(ReceivedDebitCreateParams.NetworkDetails.Type type) { this.type = type; return this; } @@ -525,8 +525,8 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public Ach build() { - return new Ach(this.addenda, this.extraParams); + public ReceivedDebitCreateParams.NetworkDetails.Ach build() { + return new ReceivedDebitCreateParams.NetworkDetails.Ach(this.addenda, this.extraParams); } /** Addenda record data associated with this ReceivedDebit. */