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 }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 57a9d18ad6d..c284d6e4860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,51 @@ # 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` + * 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` + +## 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` + * 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` + * 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.4.0-beta.1 - 2022-08-26 * [#1429](https://github.com/stripe/stripe-java/pull/1429) API Updates for beta branch * Updated stable APIs to the latest version 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/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/README.md b/README.md index 44992a94361..0c080ec7207 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-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) 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/Charge.java b/src/main/java/com/stripe/model/Charge.java index 26bbc83cb1d..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; @@ -1998,13 +2001,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; @@ -2350,7 +2354,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; @@ -2433,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/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index 74ae4947c36..2c022971d74 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); @@ -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( @@ -148,8 +153,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); } 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/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/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/PaymentLink.java b/src/main/java/com/stripe/model/PaymentLink.java index 50d86c74f38..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 @@ -540,6 +550,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/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 9d9b727a7bb..07423a05442 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -147,6 +147,12 @@ 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/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/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/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index 8cd2af9b25d..151ca6c4cc5 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -313,6 +313,7 @@ public class Session extends ApiResource implements HasId { * The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If * you’re using 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; @@ -690,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 @@ -706,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 @@ -840,6 +859,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("paynow") Paynow paynow; + @SerializedName("pix") + Pix pix; + @SerializedName("sepa_debit") SepaDebit sepaDebit; @@ -1519,6 +1541,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/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/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/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/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/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 57fc92376a7..d6a72c29415 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; } @@ -256,6 +256,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/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/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/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 bd6cf0f05b5..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; @@ -128,6 +127,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 +217,7 @@ private InvoiceCreateParams( List expand, Map extraParams, String footer, + FromInvoice fromInvoice, Object metadata, String onBehalfOf, PaymentSettings paymentSettings, @@ -236,6 +244,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 +296,8 @@ public static class Builder { private String footer; + private FromInvoice fromInvoice; + private Object metadata; private String onBehalfOf; @@ -324,6 +335,7 @@ public InvoiceCreateParams build() { this.expand, this.extraParams, this.footer, + this.fromInvoice, this.metadata, this.onBehalfOf, this.paymentSettings, @@ -402,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; } @@ -413,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; } @@ -433,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(); } @@ -447,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(); } @@ -462,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; } @@ -543,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(); } @@ -557,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(); } @@ -578,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; } @@ -650,6 +662,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(InvoiceCreateParams.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 @@ -714,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; } @@ -727,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; } @@ -770,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; } @@ -811,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); } /** @@ -891,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); } /** @@ -972,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. */ @@ -1016,6 +1038,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 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(InvoiceCreateParams.FromInvoice.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 { /** @@ -1073,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, @@ -1118,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; } @@ -1129,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(); @@ -1145,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(); @@ -1174,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; } @@ -1270,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, @@ -1285,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; } @@ -1303,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; } @@ -1321,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; } @@ -1339,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; } @@ -1385,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; } @@ -1403,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; } @@ -1459,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); } /** @@ -1494,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; } @@ -1537,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); } /** @@ -1572,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; } @@ -1647,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); } /** @@ -1685,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; } @@ -1768,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); } /** @@ -1809,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; } @@ -1824,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; } @@ -1871,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); } /** @@ -1915,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; } @@ -1979,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); } /** @@ -2026,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; } @@ -2125,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; } @@ -2221,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; } @@ -2306,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); } /** @@ -2377,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); } /** @@ -2454,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); } @@ -2490,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; } @@ -2520,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; } @@ -2535,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); } /** @@ -2579,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<>(); } @@ -2594,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<>(); } @@ -2730,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 @@ -2741,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; } @@ -2751,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); } /** @@ -2766,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; } @@ -2865,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..1aaccd22168 --- /dev/null +++ b/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java @@ -0,0 +1,3661 @@ +// 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; + + /** The pre-billing to apply to the subscription as a preview. */ + @SerializedName("subscription_prebilling") + SubscriptionPrebilling subscriptionPrebilling; + + /** + * 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, + SubscriptionPrebilling subscriptionPrebilling, + 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.subscriptionPrebilling = subscriptionPrebilling; + 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 SubscriptionPrebilling subscriptionPrebilling; + + 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.subscriptionPrebilling, + 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; + } + + /** 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 + * 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; + + /** 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 + * 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, + Object discounts, + 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.discounts = discounts; + 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 Object discounts; + + 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.discounts, + 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 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 + * 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 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 { + /** + * 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; + } + } + } + } + + @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"), + + @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 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/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/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/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 d2e52eadbbf..a945caff4ed 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; @@ -130,7 +129,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") @@ -158,7 +157,7 @@ private PaymentIntentConfirmParams( RadarOptions radarOptions, Object receiptEmail, String returnUrl, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, Object shipping, Boolean useStripeSdk) { this.applicationFeeAmount = applicationFeeAmount; @@ -213,7 +212,7 @@ public static class Builder { private String returnUrl; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private Object shipping; @@ -266,7 +265,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(PaymentIntentConfirmParams.CaptureMethod captureMethod) { this.captureMethod = captureMethod; return this; } @@ -342,7 +341,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; } @@ -364,7 +363,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; } @@ -385,13 +384,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; } @@ -400,7 +401,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; } @@ -454,7 +455,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; } @@ -483,7 +485,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; } @@ -534,12 +536,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; } @@ -636,8 +640,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); } @@ -679,7 +683,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; } @@ -688,7 +693,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; } @@ -697,7 +703,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; } @@ -727,8 +734,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); } /** @@ -801,8 +809,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); } /** @@ -1047,6 +1056,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. @@ -1123,6 +1146,8 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Paypal paypal, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -1155,6 +1180,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; @@ -1219,6 +1246,10 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -1234,8 +1265,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, @@ -1261,6 +1292,8 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.paypal, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -1274,7 +1307,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; } @@ -1283,7 +1317,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; } @@ -1292,7 +1326,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; } @@ -1301,7 +1336,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; } @@ -1310,7 +1345,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; } @@ -1319,7 +1355,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; } @@ -1328,7 +1365,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; } @@ -1337,7 +1375,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; } @@ -1346,7 +1385,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; } @@ -1355,7 +1394,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; } @@ -1364,7 +1403,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; } @@ -1373,7 +1413,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; } @@ -1409,7 +1449,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; } @@ -1418,7 +1458,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; } @@ -1427,7 +1467,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; } @@ -1436,7 +1476,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; } @@ -1445,7 +1485,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; } @@ -1454,7 +1495,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; } @@ -1463,7 +1504,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; } @@ -1472,7 +1513,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; } @@ -1508,7 +1549,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; } @@ -1517,7 +1558,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; } @@ -1526,16 +1567,35 @@ 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; } + /** + * 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. + */ + public Builder setPix(PaymentIntentConfirmParams.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( + PaymentIntentConfirmParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1544,7 +1604,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; } @@ -1553,7 +1614,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; } @@ -1562,7 +1624,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; } @@ -1572,7 +1634,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; } @@ -1581,7 +1643,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; } @@ -1590,7 +1653,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; } @@ -1644,8 +1708,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); } @@ -1720,8 +1784,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); } /** @@ -1777,8 +1841,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); } /** @@ -1836,8 +1901,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); } /** @@ -1907,8 +1972,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. */ @@ -1990,8 +2056,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. */ @@ -2059,8 +2126,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); } /** @@ -2149,13 +2216,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; } @@ -2295,8 +2363,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, @@ -2401,8 +2469,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); } /** @@ -2467,8 +2535,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); } /** @@ -2533,8 +2602,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); } /** @@ -2597,12 +2666,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; } @@ -2667,6 +2736,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"), @@ -2764,18 +2836,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; } @@ -2920,8 +2994,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); } /** @@ -2977,8 +3051,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); } /** @@ -3041,12 +3115,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; } @@ -3152,8 +3227,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); } /** @@ -3216,12 +3291,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; } @@ -3300,8 +3376,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. */ @@ -3376,8 +3453,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); } /** @@ -3433,8 +3510,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); } /** @@ -3490,8 +3567,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); } /** @@ -3554,12 +3631,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; } @@ -3701,8 +3778,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); } /** @@ -3735,6 +3812,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 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 { + /** + * 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 PaymentIntentConfirmParams.PaymentMethodData.Pix build() { + return new PaymentIntentConfirmParams.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 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 { /** @@ -3758,8 +3949,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); } /** @@ -3826,8 +4017,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); } /** @@ -3900,8 +4092,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); } /** @@ -3970,12 +4163,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; } @@ -4101,8 +4296,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, @@ -4112,7 +4307,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; } @@ -4124,7 +4321,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; } @@ -4224,8 +4422,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); } /** @@ -4322,6 +4520,12 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), @@ -4522,6 +4726,20 @@ 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. + */ + @SerializedName("pix") + Object pix; + /** * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. @@ -4583,6 +4801,8 @@ private PaymentMethodOptions( Object oxxo, Object p24, Object paynow, + Object paypal, + Object pix, Object promptpay, Object sepaDebit, Object sofort, @@ -4613,6 +4833,8 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; + this.pix = pix; this.promptpay = promptpay; this.sepaDebit = sepaDebit; this.sofort = sofort; @@ -4675,6 +4897,10 @@ public static class Builder { private Object paynow; + private Object paypal; + + private Object pix; + private Object promptpay; private Object sepaDebit; @@ -4686,8 +4912,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, @@ -4713,6 +4939,8 @@ public PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.paypal, + this.pix, this.promptpay, this.sepaDebit, this.sofort, @@ -4724,7 +4952,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; } @@ -4742,7 +4971,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; } @@ -4760,7 +4989,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; } @@ -4778,7 +5008,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; } @@ -4796,7 +5026,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; } @@ -4814,7 +5045,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; } @@ -4832,7 +5064,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; } @@ -4850,7 +5083,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; } @@ -4868,7 +5101,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; } @@ -4883,7 +5116,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; } @@ -4898,7 +5131,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; } @@ -4916,7 +5150,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; } @@ -4934,7 +5169,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; } @@ -4979,7 +5214,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; } @@ -4997,7 +5232,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; } @@ -5015,7 +5250,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; } @@ -5033,7 +5268,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; } @@ -5051,7 +5286,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; } @@ -5069,7 +5305,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; } @@ -5087,7 +5323,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; } @@ -5105,7 +5341,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; } @@ -5123,7 +5359,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; } @@ -5141,7 +5377,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; } @@ -5159,7 +5395,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; } @@ -5173,11 +5409,48 @@ 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. + */ + public Builder setPix(PaymentIntentConfirmParams.PaymentMethodOptions.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. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay( + PaymentIntentConfirmParams.PaymentMethodOptions.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -5195,7 +5468,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; } @@ -5213,7 +5487,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; } @@ -5231,7 +5505,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; } @@ -5249,7 +5524,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; } @@ -5299,7 +5575,7 @@ public static class AcssDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -5308,7 +5584,7 @@ public static class AcssDebit { private AcssDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; @@ -5325,13 +5601,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, @@ -5367,7 +5643,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; } @@ -5392,7 +5670,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; } @@ -5423,7 +5703,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; } @@ -5494,8 +5776,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, @@ -5565,13 +5847,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; } @@ -5660,7 +5948,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 @@ -5694,7 +5982,7 @@ public static class Affirm { SetupFutureUsage setupFutureUsage; private Affirm( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, SetupFutureUsage setupFutureUsage) { this.captureMethod = captureMethod; @@ -5707,15 +5995,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); } /** @@ -5727,7 +6016,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; } @@ -5794,7 +6084,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; } @@ -5837,7 +6129,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 @@ -5880,7 +6172,7 @@ public static class AfterpayClearpay { SetupFutureUsage setupFutureUsage; private AfterpayClearpay( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, String reference, SetupFutureUsage setupFutureUsage) { @@ -5895,7 +6187,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -5904,8 +6196,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); } @@ -5918,7 +6210,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; } @@ -5998,7 +6292,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; } @@ -6060,9 +6356,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; } @@ -6074,11 +6370,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); } /** @@ -6129,7 +6426,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; } @@ -6207,9 +6506,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; } @@ -6221,11 +6521,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); } /** @@ -6276,7 +6577,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; } @@ -6357,9 +6660,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; } @@ -6371,11 +6675,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); } /** @@ -6426,7 +6731,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; } @@ -6513,12 +6820,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; @@ -6533,11 +6840,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); } /** @@ -6572,7 +6880,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; } @@ -6597,7 +6907,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; } @@ -6698,8 +7010,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); } /** @@ -6780,10 +7093,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; @@ -6798,11 +7113,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); } /** @@ -6863,7 +7179,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; } @@ -6925,7 +7243,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 @@ -7006,7 +7324,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. @@ -7029,7 +7347,7 @@ public static class Card { Object statementDescriptorSuffixKanji; private Card( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, String cvcToken, Map extraParams, Installments installments, @@ -7037,7 +7355,7 @@ private Card( Boolean moto, Network network, RequestThreeDSecure requestThreeDSecure, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, Object statementDescriptorSuffixKana, Object statementDescriptorSuffixKanji) { this.captureMethod = captureMethod; @@ -7058,7 +7376,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private String cvcToken; @@ -7074,15 +7392,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, @@ -7105,7 +7423,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; } @@ -7168,13 +7487,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; } @@ -7193,7 +7514,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; } @@ -7209,7 +7531,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; } @@ -7234,7 +7558,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; } @@ -7359,8 +7685,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); } /** @@ -7407,7 +7734,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; } @@ -7473,8 +7801,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); } /** @@ -7520,13 +7849,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; } @@ -7625,7 +7957,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, @@ -7637,7 +7970,8 @@ private MandateOptions( Long intervalCount, String reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.description = description; @@ -7673,11 +8007,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, @@ -7701,7 +8037,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; } @@ -7758,7 +8096,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; } @@ -7796,7 +8136,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<>(); } @@ -7811,7 +8153,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<>(); } @@ -8008,8 +8354,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); @@ -8141,8 +8487,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); } @@ -8150,7 +8496,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; } @@ -8189,7 +8537,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; } @@ -8214,7 +8564,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; } @@ -8243,7 +8595,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 @@ -8256,7 +8611,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; @@ -8273,17 +8631,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; } @@ -8325,7 +8690,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<>(); } @@ -8340,7 +8708,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<>(); } @@ -8353,7 +8725,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; } @@ -8393,8 +8767,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); } /** @@ -8557,8 +8934,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); } /** @@ -8609,7 +8987,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; } @@ -8676,8 +9055,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); } /** @@ -8728,7 +9108,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; } @@ -8795,8 +9176,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); } /** @@ -8847,7 +9229,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; } @@ -8914,8 +9298,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); } /** @@ -8966,7 +9351,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; } @@ -9016,9 +9403,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; } @@ -9030,11 +9417,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); } /** @@ -9085,7 +9473,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; } @@ -9155,8 +9545,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); } /** @@ -9203,7 +9594,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 @@ -9241,7 +9632,7 @@ public static class Klarna { SetupFutureUsage setupFutureUsage; private Klarna( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, PreferredLocale preferredLocale, SetupFutureUsage setupFutureUsage) { @@ -9256,7 +9647,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -9265,8 +9656,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); } @@ -9279,7 +9670,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; } @@ -9329,7 +9721,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; } @@ -9354,7 +9748,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; } @@ -9379,6 +9775,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"), @@ -9394,6 +9793,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"), @@ -9427,6 +9829,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"), @@ -9448,9 +9856,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"), @@ -9463,6 +9877,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"), @@ -9587,8 +10007,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, @@ -9704,7 +10124,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; } @@ -9735,7 +10157,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 @@ -9770,13 +10192,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; @@ -9788,17 +10210,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); } @@ -9811,7 +10233,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; } @@ -9884,7 +10307,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; } @@ -10005,8 +10430,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); } /** @@ -10067,7 +10493,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; } @@ -10144,8 +10572,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); } /** @@ -10196,7 +10625,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; } @@ -10269,8 +10699,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); } /** @@ -10321,7 +10752,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; } @@ -10340,6 +10773,277 @@ 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 { + /** + * 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 PaymentIntentConfirmParams.PaymentMethodOptions.Pix build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.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 { /** @@ -10388,8 +11092,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); } /** @@ -10440,7 +11145,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; } @@ -10494,12 +11201,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; @@ -10514,11 +11221,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); } /** @@ -10550,7 +11258,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; } @@ -10575,7 +11285,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; } @@ -10630,8 +11342,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); } /** @@ -10698,7 +11411,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. @@ -10720,12 +11433,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; @@ -10738,13 +11451,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); } /** @@ -10776,7 +11490,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; } @@ -10807,7 +11523,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; } @@ -10923,7 +11641,7 @@ public static class UsBankAccount { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -10933,7 +11651,7 @@ private UsBankAccount( Map extraParams, FinancialConnections financialConnections, Networks networks, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.financialConnections = financialConnections; @@ -10953,13 +11671,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, @@ -10998,13 +11716,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; } @@ -11029,7 +11750,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; } @@ -11060,7 +11783,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; } @@ -11084,7 +11809,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 @@ -11094,7 +11822,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; @@ -11107,13 +11840,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); } /** @@ -11152,7 +11890,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<>(); } @@ -11167,7 +11908,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<>(); } @@ -11221,9 +11966,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; } @@ -11235,11 +11984,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); } /** @@ -11278,7 +12030,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<>(); } @@ -11292,7 +12046,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<>(); } @@ -11420,8 +12176,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. */ @@ -11431,7 +12188,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; } @@ -11484,7 +12242,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; } @@ -11556,8 +12316,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); } /** @@ -11666,8 +12426,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, @@ -11677,7 +12437,7 @@ public Shipping build() { } /** Shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(PaymentIntentConfirmParams.Shipping.Address address) { this.address = address; return this; } @@ -11811,8 +12571,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 bf5327283a9..ec168634cab 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; @@ -483,13 +482,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; } @@ -507,7 +507,8 @@ public Builder setConfirm(Boolean confirm) { return this; } - public Builder setConfirmationMethod(ConfirmationMethod confirmationMethod) { + public Builder setConfirmationMethod( + PaymentIntentCreateParams.ConfirmationMethod confirmationMethod) { this.confirmationMethod = confirmationMethod; return this; } @@ -625,7 +626,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; } @@ -679,7 +680,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; } @@ -715,13 +716,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; } @@ -756,7 +759,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; } @@ -787,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; } @@ -806,13 +810,14 @@ public Builder setSecretKeyConfirmation(SecretKeyConfirmation secretKeyConfirmat * 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; } @@ -843,7 +848,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; } @@ -898,8 +903,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. */ @@ -967,12 +973,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; } @@ -1069,8 +1076,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); } @@ -1112,7 +1119,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; } @@ -1121,7 +1129,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; } @@ -1130,7 +1139,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; } @@ -1160,8 +1169,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); } /** @@ -1234,8 +1244,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); } /** @@ -1480,6 +1491,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. @@ -1556,6 +1581,8 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Paypal paypal, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -1588,6 +1615,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; @@ -1652,6 +1681,10 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -1667,8 +1700,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, @@ -1694,6 +1727,8 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.paypal, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -1707,7 +1742,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; } @@ -1716,7 +1751,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; } @@ -1725,7 +1760,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; } @@ -1734,7 +1770,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; } @@ -1743,7 +1779,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; } @@ -1752,7 +1789,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; } @@ -1761,7 +1798,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; } @@ -1770,7 +1808,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; } @@ -1779,7 +1818,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; } @@ -1788,7 +1827,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; } @@ -1797,7 +1836,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; } @@ -1806,7 +1846,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; } @@ -1842,7 +1882,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; } @@ -1851,7 +1891,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; } @@ -1860,7 +1900,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; } @@ -1869,7 +1909,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; } @@ -1878,7 +1918,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; } @@ -1887,7 +1928,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; } @@ -1896,7 +1937,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; } @@ -1905,7 +1946,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; } @@ -1941,7 +1982,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; } @@ -1950,7 +1991,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; } @@ -1959,16 +2000,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(PaymentIntentCreateParams.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(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. + */ + public Builder setPix(PaymentIntentCreateParams.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(PaymentIntentCreateParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1977,7 +2036,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 +2046,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 +2055,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 +2065,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 +2074,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 +2084,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 +2138,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 +2214,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 +2271,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 +2328,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 +2399,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 +2483,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 +2553,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 +2643,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 +2790,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 +2896,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 +2962,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 +3029,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 +3093,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; } @@ -3098,6 +3163,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"), @@ -3195,18 +3263,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; } @@ -3351,8 +3421,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); } /** @@ -3408,8 +3478,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); } /** @@ -3472,12 +3542,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; } @@ -3583,8 +3653,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); } /** @@ -3647,12 +3717,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; } @@ -3731,8 +3801,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. */ @@ -3807,8 +3878,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); } /** @@ -3864,8 +3935,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); } /** @@ -3921,8 +3992,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); } /** @@ -3985,12 +4056,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; } @@ -4132,8 +4203,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); } /** @@ -4166,6 +4237,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 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 { + /** + * 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 PaymentIntentCreateParams.PaymentMethodData.Pix build() { + return new PaymentIntentCreateParams.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 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 { /** @@ -4189,8 +4374,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); } /** @@ -4257,8 +4442,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); } /** @@ -4331,8 +4517,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); } /** @@ -4401,12 +4588,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; } @@ -4532,8 +4721,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, @@ -4543,7 +4732,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; } @@ -4555,7 +4746,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; } @@ -4655,8 +4847,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); } /** @@ -4753,6 +4945,12 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), @@ -4953,6 +5151,20 @@ 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. + */ + @SerializedName("pix") + Object pix; + /** * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. @@ -5014,6 +5226,8 @@ private PaymentMethodOptions( Object oxxo, Object p24, Object paynow, + Object paypal, + Object pix, Object promptpay, Object sepaDebit, Object sofort, @@ -5044,6 +5258,8 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; + this.pix = pix; this.promptpay = promptpay; this.sepaDebit = sepaDebit; this.sofort = sofort; @@ -5106,6 +5322,10 @@ public static class Builder { private Object paynow; + private Object paypal; + + private Object pix; + private Object promptpay; private Object sepaDebit; @@ -5117,8 +5337,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, @@ -5144,6 +5364,8 @@ public PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.paypal, + this.pix, this.promptpay, this.sepaDebit, this.sofort, @@ -5155,7 +5377,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; } @@ -5173,7 +5396,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; } @@ -5191,7 +5414,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; } @@ -5209,7 +5433,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; } @@ -5227,7 +5451,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; } @@ -5245,7 +5470,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; } @@ -5263,7 +5489,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; } @@ -5281,7 +5508,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; } @@ -5299,7 +5526,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; } @@ -5314,7 +5541,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; } @@ -5329,7 +5556,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; } @@ -5347,7 +5575,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; } @@ -5365,7 +5594,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; } @@ -5410,7 +5639,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; } @@ -5428,7 +5657,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; } @@ -5446,7 +5675,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; } @@ -5464,7 +5693,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; } @@ -5482,7 +5711,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; } @@ -5500,7 +5730,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; } @@ -5518,7 +5748,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; } @@ -5536,7 +5766,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; } @@ -5554,7 +5784,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; } @@ -5572,7 +5802,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; } @@ -5590,7 +5820,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; } @@ -5604,11 +5834,48 @@ 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. + */ + public Builder setPix(PaymentIntentCreateParams.PaymentMethodOptions.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. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay( + PaymentIntentCreateParams.PaymentMethodOptions.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -5626,7 +5893,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; } @@ -5644,7 +5912,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; } @@ -5662,7 +5930,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; } @@ -5680,7 +5949,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; } @@ -5730,7 +6000,7 @@ public static class AcssDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -5739,7 +6009,7 @@ public static class AcssDebit { private AcssDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; @@ -5756,13 +6026,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, @@ -5798,7 +6068,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; } @@ -5823,7 +6095,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; } @@ -5854,7 +6128,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; } @@ -5925,8 +6201,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, @@ -5996,13 +6272,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; } @@ -6091,7 +6373,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 @@ -6125,7 +6407,7 @@ public static class Affirm { SetupFutureUsage setupFutureUsage; private Affirm( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, SetupFutureUsage setupFutureUsage) { this.captureMethod = captureMethod; @@ -6138,15 +6420,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); } /** @@ -6158,7 +6441,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; } @@ -6225,7 +6509,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; } @@ -6268,7 +6554,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 @@ -6311,7 +6597,7 @@ public static class AfterpayClearpay { SetupFutureUsage setupFutureUsage; private AfterpayClearpay( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, String reference, SetupFutureUsage setupFutureUsage) { @@ -6326,7 +6612,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -6335,8 +6621,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); } @@ -6349,7 +6635,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; } @@ -6429,7 +6717,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; } @@ -6491,9 +6781,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; } @@ -6505,11 +6795,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); } /** @@ -6560,7 +6851,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; } @@ -6638,9 +6931,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; } @@ -6652,11 +6946,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); } /** @@ -6707,7 +7002,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; } @@ -6788,9 +7085,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; } @@ -6802,11 +7100,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); } /** @@ -6857,7 +7156,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; } @@ -6944,12 +7245,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; @@ -6964,11 +7265,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); } /** @@ -7003,7 +7305,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; } @@ -7028,7 +7332,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; } @@ -7129,8 +7435,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); } /** @@ -7211,10 +7518,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; @@ -7229,11 +7538,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); } /** @@ -7294,7 +7604,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; } @@ -7356,7 +7668,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 @@ -7437,7 +7749,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. @@ -7460,7 +7772,7 @@ public static class Card { Object statementDescriptorSuffixKanji; private Card( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, String cvcToken, Map extraParams, Installments installments, @@ -7468,7 +7780,7 @@ private Card( Boolean moto, Network network, RequestThreeDSecure requestThreeDSecure, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, Object statementDescriptorSuffixKana, Object statementDescriptorSuffixKanji) { this.captureMethod = captureMethod; @@ -7489,7 +7801,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private String cvcToken; @@ -7505,15 +7817,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, @@ -7536,7 +7848,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; } @@ -7599,13 +7912,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; } @@ -7624,7 +7939,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; } @@ -7640,7 +7956,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; } @@ -7665,7 +7983,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; } @@ -7790,8 +8109,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); } /** @@ -7838,7 +8158,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; } @@ -7904,8 +8225,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); } /** @@ -7951,13 +8273,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; } @@ -8056,7 +8381,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, @@ -8068,7 +8394,8 @@ private MandateOptions( Long intervalCount, String reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.description = description; @@ -8104,11 +8431,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, @@ -8132,7 +8461,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; } @@ -8189,7 +8520,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; } @@ -8227,7 +8560,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<>(); } @@ -8242,7 +8577,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<>(); } @@ -8439,8 +8776,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); @@ -8572,8 +8909,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); } @@ -8581,7 +8918,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; } @@ -8620,7 +8959,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; } @@ -8645,7 +8986,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; } @@ -8674,7 +9017,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 @@ -8687,7 +9033,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; @@ -8704,17 +9053,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; } @@ -8756,7 +9112,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<>(); } @@ -8771,7 +9130,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<>(); } @@ -8784,7 +9147,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; } @@ -8824,8 +9189,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); } /** @@ -8988,8 +9356,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); } /** @@ -9040,7 +9409,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; } @@ -9107,8 +9477,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); } /** @@ -9159,7 +9530,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; } @@ -9226,8 +9598,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); } /** @@ -9278,7 +9651,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; } @@ -9345,8 +9720,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); } /** @@ -9397,7 +9773,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; } @@ -9447,9 +9825,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; } @@ -9461,11 +9839,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); } /** @@ -9516,7 +9895,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; } @@ -9586,8 +9967,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); } /** @@ -9634,7 +10016,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 @@ -9672,7 +10054,7 @@ public static class Klarna { SetupFutureUsage setupFutureUsage; private Klarna( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, PreferredLocale preferredLocale, SetupFutureUsage setupFutureUsage) { @@ -9687,7 +10069,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -9696,8 +10078,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); } @@ -9710,7 +10092,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; } @@ -9760,7 +10143,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; } @@ -9785,7 +10169,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; } @@ -9810,6 +10196,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"), @@ -9825,6 +10214,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"), @@ -9858,6 +10250,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"), @@ -9879,9 +10277,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"), @@ -9894,6 +10298,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"), @@ -10018,8 +10428,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, @@ -10135,7 +10545,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; } @@ -10166,7 +10578,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 @@ -10201,13 +10613,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; @@ -10219,17 +10631,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); } @@ -10242,7 +10654,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; } @@ -10315,7 +10728,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; } @@ -10436,8 +10850,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); } /** @@ -10498,7 +10913,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; } @@ -10575,8 +10991,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); } /** @@ -10627,7 +11044,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; } @@ -10700,8 +11118,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); } /** @@ -10752,7 +11171,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; } @@ -10771,6 +11192,276 @@ 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 { + /** + * 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 PaymentIntentCreateParams.PaymentMethodOptions.Pix build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.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 { /** @@ -10819,8 +11510,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); } /** @@ -10871,7 +11563,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; } @@ -10925,12 +11619,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; @@ -10945,11 +11639,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); } /** @@ -10981,7 +11676,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; } @@ -11006,7 +11703,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; } @@ -11061,8 +11760,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); } /** @@ -11129,7 +11829,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. @@ -11151,12 +11851,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; @@ -11169,13 +11869,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); } /** @@ -11207,7 +11908,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; } @@ -11238,7 +11941,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; } @@ -11354,7 +12059,7 @@ public static class UsBankAccount { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -11364,7 +12069,7 @@ private UsBankAccount( Map extraParams, FinancialConnections financialConnections, Networks networks, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.financialConnections = financialConnections; @@ -11384,13 +12089,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, @@ -11427,13 +12132,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; } @@ -11458,7 +12166,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; } @@ -11489,7 +12199,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; } @@ -11513,7 +12225,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 @@ -11523,7 +12238,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; @@ -11536,13 +12256,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); } /** @@ -11581,7 +12306,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<>(); } @@ -11596,7 +12324,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<>(); } @@ -11650,9 +12382,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; } @@ -11664,11 +12400,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); } /** @@ -11707,7 +12446,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<>(); } @@ -11721,7 +12462,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<>(); } @@ -11849,8 +12592,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. */ @@ -11860,7 +12604,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; } @@ -11913,7 +12658,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; } @@ -11985,8 +12732,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); } /** @@ -12094,8 +12841,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, @@ -12105,7 +12852,7 @@ public Shipping build() { } /** Shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(PaymentIntentCreateParams.Shipping.Address address) { this.address = address; return this; } @@ -12239,8 +12986,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, @@ -12369,8 +13116,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 9f262934fca..36f87f8b77b 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; @@ -144,7 +143,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") @@ -198,7 +197,7 @@ private PaymentIntentUpdateParams( PaymentMethodOptions paymentMethodOptions, List paymentMethodTypes, Object receiptEmail, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, Object shipping, Object statementDescriptor, Object statementDescriptorSuffix, @@ -262,7 +261,7 @@ public static class Builder { private Object receiptEmail; - private EnumParam setupFutureUsage; + private ApiRequestParams.EnumParam setupFutureUsage; private Object shipping; @@ -339,7 +338,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; } @@ -459,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; } @@ -540,13 +539,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; } @@ -615,7 +616,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; } @@ -644,7 +646,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; } @@ -701,7 +703,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; } @@ -760,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; } @@ -839,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); } /** @@ -877,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; } @@ -927,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); } /** @@ -1182,6 +1192,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. @@ -1258,6 +1282,8 @@ private PaymentMethodData( Oxxo oxxo, P24 p24, Paynow paynow, + Paypal paypal, + Pix pix, Promptpay promptpay, RadarOptions radarOptions, SepaDebit sepaDebit, @@ -1290,6 +1316,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; @@ -1354,6 +1382,10 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + + private Pix pix; + private Promptpay promptpay; private RadarOptions radarOptions; @@ -1369,8 +1401,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, @@ -1396,6 +1428,8 @@ public PaymentMethodData build() { this.oxxo, this.p24, this.paynow, + this.paypal, + this.pix, this.promptpay, this.radarOptions, this.sepaDebit, @@ -1409,7 +1443,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; } @@ -1418,7 +1452,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; } @@ -1427,7 +1461,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; } @@ -1436,7 +1471,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; } @@ -1445,7 +1480,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; } @@ -1454,7 +1490,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; } @@ -1463,7 +1499,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; } @@ -1472,7 +1509,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; } @@ -1481,7 +1519,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; } @@ -1490,7 +1528,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; } @@ -1499,7 +1537,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; } @@ -1508,7 +1547,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; } @@ -1544,7 +1583,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; } @@ -1553,7 +1592,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; } @@ -1562,7 +1601,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; } @@ -1571,7 +1610,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; } @@ -1580,7 +1619,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; } @@ -1589,7 +1629,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; } @@ -1598,7 +1638,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; } @@ -1607,7 +1647,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; } @@ -1643,7 +1683,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; } @@ -1652,7 +1692,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; } @@ -1661,16 +1701,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(PaymentIntentUpdateParams.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(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. + */ + public Builder setPix(PaymentIntentUpdateParams.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(PaymentIntentUpdateParams.PaymentMethodData.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -1679,7 +1737,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; } @@ -1688,7 +1747,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; } @@ -1697,7 +1756,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; } @@ -1707,7 +1766,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; } @@ -1716,7 +1775,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; } @@ -1725,7 +1785,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; } @@ -1779,8 +1839,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); } @@ -1873,8 +1933,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); } /** @@ -1930,8 +1990,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); } /** @@ -1987,8 +2047,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); } /** @@ -2058,8 +2118,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. */ @@ -2153,8 +2214,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. */ @@ -2234,8 +2296,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); } /** @@ -2324,13 +2386,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; } @@ -2482,8 +2545,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, @@ -2627,8 +2690,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); } /** @@ -2693,8 +2756,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); } /** @@ -2768,8 +2832,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); } /** @@ -2832,12 +2896,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; } @@ -2902,6 +2966,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"), @@ -2999,18 +3066,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; } @@ -3155,8 +3224,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); } /** @@ -3212,8 +3281,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); } /** @@ -3276,12 +3345,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; } @@ -3387,8 +3456,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); } /** @@ -3451,12 +3520,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; } @@ -3535,8 +3604,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. */ @@ -3611,8 +3681,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); } /** @@ -3668,8 +3738,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); } /** @@ -3725,8 +3795,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); } /** @@ -3789,12 +3859,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; } @@ -3936,8 +4006,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); } /** @@ -3970,6 +4040,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 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 { + /** + * 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 PaymentIntentUpdateParams.PaymentMethodData.Pix build() { + return new PaymentIntentUpdateParams.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 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 { /** @@ -3993,8 +4177,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); } /** @@ -4061,8 +4245,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); } /** @@ -4145,8 +4330,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); } /** @@ -4221,12 +4407,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; } @@ -4352,8 +4540,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, @@ -4363,7 +4551,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; } @@ -4381,7 +4571,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; } @@ -4493,8 +4684,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); } /** @@ -4591,6 +4782,12 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("paynow") PAYNOW("paynow"), + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("pix") + PIX("pix"), + @SerializedName("promptpay") PROMPTPAY("promptpay"), @@ -4791,6 +4988,20 @@ 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. + */ + @SerializedName("pix") + Object pix; + /** * If this is a {@code promptpay} PaymentMethod, this sub-hash contains details about the * PromptPay payment method options. @@ -4852,6 +5063,8 @@ private PaymentMethodOptions( Object oxxo, Object p24, Object paynow, + Object paypal, + Object pix, Object promptpay, Object sepaDebit, Object sofort, @@ -4882,6 +5095,8 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; + this.pix = pix; this.promptpay = promptpay; this.sepaDebit = sepaDebit; this.sofort = sofort; @@ -4944,6 +5159,10 @@ public static class Builder { private Object paynow; + private Object paypal; + + private Object pix; + private Object promptpay; private Object sepaDebit; @@ -4955,8 +5174,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, @@ -4982,6 +5201,8 @@ public PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.paypal, + this.pix, this.promptpay, this.sepaDebit, this.sofort, @@ -4993,7 +5214,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; } @@ -5011,7 +5233,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; } @@ -5029,7 +5251,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; } @@ -5047,7 +5270,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; } @@ -5065,7 +5288,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; } @@ -5083,7 +5307,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; } @@ -5101,7 +5326,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; } @@ -5119,7 +5345,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; } @@ -5137,7 +5363,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; } @@ -5152,7 +5378,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; } @@ -5167,7 +5393,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; } @@ -5185,7 +5412,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; } @@ -5203,7 +5431,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; } @@ -5248,7 +5476,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; } @@ -5266,7 +5494,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; } @@ -5284,7 +5512,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; } @@ -5302,7 +5530,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; } @@ -5320,7 +5548,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; } @@ -5338,7 +5567,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; } @@ -5356,7 +5585,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; } @@ -5374,7 +5603,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; } @@ -5392,7 +5621,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; } @@ -5410,7 +5639,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; } @@ -5428,7 +5657,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; } @@ -5442,11 +5671,48 @@ 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. + */ + public Builder setPix(PaymentIntentUpdateParams.PaymentMethodOptions.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. */ - public Builder setPromptpay(Promptpay promptpay) { + public Builder setPromptpay( + PaymentIntentUpdateParams.PaymentMethodOptions.Promptpay promptpay) { this.promptpay = promptpay; return this; } @@ -5464,7 +5730,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; } @@ -5482,7 +5749,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; } @@ -5500,7 +5767,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; } @@ -5518,7 +5786,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; } @@ -5568,7 +5837,7 @@ public static class AcssDebit { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -5577,7 +5846,7 @@ public static class AcssDebit { private AcssDebit( Map extraParams, MandateOptions mandateOptions, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.mandateOptions = mandateOptions; @@ -5594,13 +5863,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, @@ -5636,7 +5905,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; } @@ -5661,7 +5932,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; } @@ -5692,7 +5965,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; } @@ -5763,8 +6038,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, @@ -5843,13 +6118,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; } @@ -5938,7 +6219,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 @@ -5972,7 +6253,7 @@ public static class Affirm { SetupFutureUsage setupFutureUsage; private Affirm( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, SetupFutureUsage setupFutureUsage) { this.captureMethod = captureMethod; @@ -5985,15 +6266,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); } /** @@ -6005,7 +6287,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; } @@ -6072,7 +6355,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; } @@ -6115,7 +6400,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 @@ -6158,7 +6443,7 @@ public static class AfterpayClearpay { SetupFutureUsage setupFutureUsage; private AfterpayClearpay( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, Object reference, SetupFutureUsage setupFutureUsage) { @@ -6173,7 +6458,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -6182,8 +6467,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); } @@ -6196,7 +6481,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; } @@ -6287,7 +6574,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; } @@ -6349,9 +6638,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; } @@ -6363,11 +6652,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); } /** @@ -6418,7 +6708,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; } @@ -6496,9 +6788,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; } @@ -6510,11 +6803,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); } /** @@ -6565,7 +6859,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; } @@ -6646,9 +6942,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; } @@ -6660,11 +6957,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); } /** @@ -6715,7 +7013,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; } @@ -6802,12 +7102,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; @@ -6822,11 +7122,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); } /** @@ -6861,7 +7162,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; } @@ -6886,7 +7189,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; } @@ -6987,8 +7292,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); } /** @@ -7078,10 +7384,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; @@ -7096,11 +7404,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); } /** @@ -7161,7 +7470,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; } @@ -7223,7 +7534,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 @@ -7304,7 +7615,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. @@ -7327,7 +7638,7 @@ public static class Card { Object statementDescriptorSuffixKanji; private Card( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Object cvcToken, Map extraParams, Installments installments, @@ -7335,7 +7646,7 @@ private Card( Boolean moto, Network network, RequestThreeDSecure requestThreeDSecure, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, Object statementDescriptorSuffixKana, Object statementDescriptorSuffixKanji) { this.captureMethod = captureMethod; @@ -7356,7 +7667,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Object cvcToken; @@ -7372,15 +7683,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, @@ -7403,7 +7714,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; } @@ -7476,13 +7788,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; } @@ -7501,7 +7815,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; } @@ -7517,7 +7832,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; } @@ -7542,7 +7859,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; } @@ -7667,8 +7985,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); } /** @@ -7715,7 +8034,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; } @@ -7781,8 +8101,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); } /** @@ -7828,13 +8149,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; } @@ -7933,7 +8257,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, @@ -7945,7 +8270,8 @@ private MandateOptions( Long intervalCount, Object reference, Long startDate, - List supportedTypes) { + List + supportedTypes) { this.amount = amount; this.amountType = amountType; this.description = description; @@ -7981,11 +8307,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, @@ -8009,7 +8337,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; } @@ -8075,7 +8405,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; } @@ -8119,7 +8451,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<>(); } @@ -8134,7 +8468,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<>(); } @@ -8331,8 +8667,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); @@ -8464,8 +8800,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); } @@ -8473,7 +8809,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; } @@ -8512,7 +8850,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; } @@ -8537,7 +8877,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; } @@ -8566,7 +8908,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 @@ -8579,7 +8924,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; @@ -8596,17 +8944,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; } @@ -8648,7 +9003,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<>(); } @@ -8663,7 +9021,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<>(); } @@ -8676,7 +9038,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; } @@ -8716,8 +9080,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); } /** @@ -8889,8 +9256,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); } /** @@ -8941,7 +9309,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; } @@ -9008,8 +9377,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); } /** @@ -9060,7 +9430,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; } @@ -9127,8 +9498,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); } /** @@ -9179,7 +9551,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; } @@ -9246,8 +9620,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); } /** @@ -9298,7 +9673,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; } @@ -9348,9 +9725,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; } @@ -9362,11 +9739,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); } /** @@ -9417,7 +9795,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; } @@ -9487,8 +9867,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); } /** @@ -9535,7 +9916,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 @@ -9573,7 +9954,7 @@ public static class Klarna { SetupFutureUsage setupFutureUsage; private Klarna( - EnumParam captureMethod, + ApiRequestParams.EnumParam captureMethod, Map extraParams, PreferredLocale preferredLocale, SetupFutureUsage setupFutureUsage) { @@ -9588,7 +9969,7 @@ public static Builder builder() { } public static class Builder { - private EnumParam captureMethod; + private ApiRequestParams.EnumParam captureMethod; private Map extraParams; @@ -9597,8 +9978,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); } @@ -9611,7 +9992,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; } @@ -9661,7 +10043,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; } @@ -9686,7 +10069,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; } @@ -9711,6 +10096,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"), @@ -9726,6 +10114,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"), @@ -9759,6 +10150,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"), @@ -9780,9 +10177,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"), @@ -9795,6 +10198,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"), @@ -9919,8 +10328,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, @@ -10055,7 +10464,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; } @@ -10086,7 +10497,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 @@ -10121,13 +10532,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; @@ -10139,17 +10550,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); } @@ -10162,7 +10573,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; } @@ -10241,7 +10653,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; } @@ -10362,8 +10775,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); } /** @@ -10424,7 +10838,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; } @@ -10501,8 +10916,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); } /** @@ -10553,7 +10969,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; } @@ -10626,8 +11043,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); } /** @@ -10678,7 +11096,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; } @@ -10697,6 +11117,276 @@ 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 { + /** + * 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 PaymentIntentUpdateParams.PaymentMethodOptions.Pix build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.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 { /** @@ -10745,8 +11435,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); } /** @@ -10797,7 +11488,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; } @@ -10851,12 +11544,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; @@ -10871,11 +11564,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); } /** @@ -10907,7 +11601,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; } @@ -10932,7 +11628,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; } @@ -10987,8 +11685,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); } /** @@ -11055,7 +11754,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. @@ -11077,12 +11776,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; @@ -11095,13 +11794,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); } /** @@ -11133,7 +11833,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; } @@ -11164,7 +11866,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; } @@ -11280,7 +11984,7 @@ public static class UsBankAccount { * off_session}. */ @SerializedName("setup_future_usage") - EnumParam setupFutureUsage; + ApiRequestParams.EnumParam setupFutureUsage; /** Verification method for the intent. */ @SerializedName("verification_method") @@ -11290,7 +11994,7 @@ private UsBankAccount( Map extraParams, FinancialConnections financialConnections, Networks networks, - EnumParam setupFutureUsage, + ApiRequestParams.EnumParam setupFutureUsage, VerificationMethod verificationMethod) { this.extraParams = extraParams; this.financialConnections = financialConnections; @@ -11310,13 +12014,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, @@ -11353,13 +12057,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; } @@ -11384,7 +12091,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; } @@ -11415,7 +12124,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; } @@ -11439,7 +12150,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 @@ -11449,7 +12163,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; @@ -11462,13 +12181,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); } /** @@ -11507,7 +12231,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<>(); } @@ -11522,7 +12249,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<>(); } @@ -11585,9 +12316,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; } @@ -11599,11 +12334,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); } /** @@ -11642,7 +12380,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<>(); } @@ -11656,7 +12396,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<>(); } @@ -11784,8 +12526,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. */ @@ -11801,7 +12544,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; } @@ -11854,7 +12598,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; } @@ -11959,8 +12705,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, @@ -11970,7 +12716,7 @@ public Shipping build() { } /** Shipping address. */ - public Builder setAddress(Address address) { + public Builder setAddress(PaymentIntentUpdateParams.Shipping.Address address) { this.address = address; return this; } @@ -12131,8 +12877,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, @@ -12281,8 +13027,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 5037151f82a..e3630c1d42c 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); } /** @@ -2388,6 +2447,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 +2470,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 +2482,25 @@ 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); + public PaymentLinkCreateParams.SubscriptionData build() { + return new PaymentLinkCreateParams.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; } /** @@ -2491,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. */ @@ -2571,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. */ @@ -2723,6 +2804,12 @@ public enum PaymentMethodType 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/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index 4162ad518a7..3959c479914 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<>(); } @@ -1900,6 +1914,12 @@ public enum PaymentMethodType 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/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 c5e2238bbfe..826fcd30f24 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; } @@ -271,6 +271,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/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 07b4dd977e5..5e32af67b13 100644 --- a/src/main/java/com/stripe/param/PriceUpdateParams.java +++ b/src/main/java/com/stripe/param/PriceUpdateParams.java @@ -163,7 +163,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(); } @@ -177,7 +177,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(); } @@ -200,7 +200,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; } @@ -328,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; } @@ -354,7 +355,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; } @@ -370,7 +371,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; } @@ -416,7 +417,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 @@ -437,7 +438,7 @@ private CurrencyOption( CustomUnitAmount customUnitAmount, Map extraParams, TaxBehavior taxBehavior, - List tiers, + List tiers, Long unitAmount, Object unitAmountDecimal) { this.customUnitAmount = customUnitAmount; @@ -459,15 +460,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, @@ -480,7 +481,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; } @@ -516,7 +518,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; } @@ -526,7 +528,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<>(); } @@ -539,7 +541,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<>(); } @@ -639,8 +641,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); } @@ -781,8 +783,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, @@ -878,7 +880,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; } @@ -973,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; } @@ -1078,8 +1081,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 5b8b3d33479..f45407b28a1 100644 --- a/src/main/java/com/stripe/param/ProductCreateParams.java +++ b/src/main/java/com/stripe/param/ProductCreateParams.java @@ -319,7 +319,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; } @@ -454,13 +454,13 @@ 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; } /** Provisioning configuration for this product. */ - public Builder setProvisioning(Provisioning provisioning) { + public Builder setProvisioning(ProductCreateParams.Provisioning provisioning) { this.provisioning = provisioning; return this; } @@ -498,7 +498,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; } @@ -535,7 +535,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 @@ -575,7 +575,7 @@ public static class DefaultPriceData { private DefaultPriceData( String currency, - Map currencyOptions, + Map currencyOptions, Map extraParams, Recurring recurring, TaxBehavior taxBehavior, @@ -597,7 +597,7 @@ public static Builder builder() { public static class Builder { private String currency; - private Map currencyOptions; + private Map currencyOptions; private Map extraParams; @@ -610,8 +610,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, @@ -637,7 +637,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<>(); } @@ -651,7 +652,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<>(); } @@ -688,7 +690,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; } @@ -698,7 +700,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; } @@ -754,7 +756,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 @@ -775,7 +777,7 @@ private CurrencyOption( CustomUnitAmount customUnitAmount, Map extraParams, TaxBehavior taxBehavior, - List tiers, + List tiers, Long unitAmount, BigDecimal unitAmountDecimal) { this.customUnitAmount = customUnitAmount; @@ -797,15 +799,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, @@ -818,7 +820,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; } @@ -856,7 +859,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; } @@ -866,7 +870,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<>(); } @@ -879,7 +883,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<>(); } @@ -970,8 +975,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); } @@ -1116,8 +1121,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, @@ -1193,7 +1198,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; } @@ -1284,8 +1290,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); } /** @@ -1320,7 +1327,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; } @@ -1433,8 +1441,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); } @@ -1526,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); } /** @@ -1556,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; } @@ -1606,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); } /** @@ -1638,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; } @@ -1647,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; } @@ -1690,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/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 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/QuoteListParams.java b/src/main/java/com/stripe/param/QuoteListParams.java index ff2e386255d..c1f6de59c69 100644 --- a/src/main/java/com/stripe/param/QuoteListParams.java +++ b/src/main/java/com/stripe/param/QuoteListParams.java @@ -222,7 +222,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 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/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 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/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 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/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 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 e7d1f445afa..6b3138b60a0 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java @@ -223,7 +223,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; } @@ -243,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(); } @@ -257,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(); } @@ -272,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; } @@ -383,7 +384,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; } @@ -404,7 +406,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; } @@ -415,7 +417,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; } @@ -495,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; } @@ -531,8 +534,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); } /** @@ -607,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. */ @@ -738,8 +742,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, @@ -794,7 +798,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; } @@ -804,7 +808,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; } @@ -873,8 +878,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); } /** @@ -909,7 +915,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; } @@ -996,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); } /** @@ -1027,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/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 85c31856b72..fc5a5d01711 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java @@ -217,7 +217,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; } @@ -237,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(); } @@ -251,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(); } @@ -266,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; } @@ -407,7 +408,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; } @@ -446,7 +448,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; } @@ -457,7 +459,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; } @@ -561,8 +564,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); } /** @@ -637,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. */ @@ -780,8 +784,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, @@ -852,7 +856,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; } @@ -862,7 +866,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; } @@ -941,8 +946,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); } /** @@ -977,7 +983,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/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/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 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/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..ec695b482bc 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<>(); } @@ -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 64921c0301b..953a11d0fc8 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<>(); } @@ -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/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 14620b3519f..333376f474a 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,11 +103,12 @@ public ConfigurationCreateParams build() { this.expand, this.extraParams, this.features, + this.loginPage, this.metadata); } /** 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; } @@ -175,11 +188,22 @@ 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; } + /** + * The hosted login page for this configuration. Learn more about the portal login page in our + * integration + * docs. + */ + public Builder setLoginPage(ConfigurationCreateParams.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 @@ -255,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); } @@ -379,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, @@ -391,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; } @@ -423,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; } @@ -493,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); } /** @@ -504,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(); @@ -522,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(); @@ -546,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; } @@ -641,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. */ @@ -711,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. */ @@ -815,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, @@ -828,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; } @@ -868,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; } @@ -879,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; } @@ -924,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. */ @@ -971,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< @@ -991,7 +1034,9 @@ public Builder addOption(Option element) { * the field documentation. */ @SuppressWarnings("unchecked") - public Builder addAllOption(List

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 ConfigurationUpdateParams.LoginPage build() { + return new ConfigurationUpdateParams.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/billingportal/SessionCreateParams.java b/src/main/java/com/stripe/param/billingportal/SessionCreateParams.java index 660d46ff199..30c1f043bb8 100644 --- a/src/main/java/com/stripe/param/billingportal/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/billingportal/SessionCreateParams.java @@ -184,7 +184,7 @@ public Builder putAllExtraParam(Map map) { * The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the * customer’s {@code preferred_locales} or browser’s locale is used. */ - public Builder setLocale(Locale locale) { + public Builder setLocale(SessionCreateParams.Locale locale) { this.locale = locale; return this; } 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 a102821f1d4..793a20c7723 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -121,7 +121,7 @@ public class SessionCreateParams extends ApiRequestParams { * specified. */ @SerializedName("discounts") - List discounts; + List discounts; /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") @@ -152,11 +152,11 @@ 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") - List lineItems; + List lineItems; /** * The IETF language tag of the locale Checkout is displayed in. If blank or {@code auto}, the @@ -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 @@ -221,7 +222,7 @@ public class SessionCreateParams extends ApiRequestParams { * the most relevant payment methods based on the customer's location and other characteristics. */ @SerializedName("payment_method_types") - List paymentMethodTypes; + List paymentMethodTypes; /** * Controls phone number collection settings for the session. @@ -249,7 +250,7 @@ public class SessionCreateParams extends ApiRequestParams { /** The shipping rate options to apply to this Session. */ @SerializedName("shipping_options") - List shippingOptions; + List shippingOptions; /** [Deprecated] The shipping rate to apply to this Session. Only up to one may be specified. */ @SerializedName("shipping_rates") @@ -297,22 +298,22 @@ private SessionCreateParams( CustomerCreation customerCreation, String customerEmail, CustomerUpdate customerUpdate, - List discounts, + List discounts, List expand, Long expiresAt, Map extraParams, - List lineItems, + List lineItems, Locale locale, Map metadata, Mode mode, PaymentIntentData paymentIntentData, PaymentMethodCollection paymentMethodCollection, PaymentMethodOptions paymentMethodOptions, - List paymentMethodTypes, + List paymentMethodTypes, PhoneNumberCollection phoneNumberCollection, SetupIntentData setupIntentData, ShippingAddressCollection shippingAddressCollection, - List shippingOptions, + List shippingOptions, List shippingRates, SubmitType submitType, SubscriptionData subscriptionData, @@ -382,7 +383,7 @@ public static class Builder { private CustomerUpdate customerUpdate; - private List discounts; + private List discounts; private List expand; @@ -390,7 +391,7 @@ public static class Builder { private Map extraParams; - private List lineItems; + private List lineItems; private Locale locale; @@ -404,7 +405,7 @@ public static class Builder { private PaymentMethodOptions paymentMethodOptions; - private List paymentMethodTypes; + private List paymentMethodTypes; private PhoneNumberCollection phoneNumberCollection; @@ -412,7 +413,7 @@ public static class Builder { private ShippingAddressCollection shippingAddressCollection; - private List shippingOptions; + private List shippingOptions; private List shippingRates; @@ -463,7 +464,7 @@ public SessionCreateParams build() { } /** Configure actions after a Checkout Session has expired. */ - public Builder setAfterExpiration(AfterExpiration afterExpiration) { + public Builder setAfterExpiration(SessionCreateParams.AfterExpiration afterExpiration) { this.afterExpiration = afterExpiration; return this; } @@ -478,13 +479,14 @@ public Builder setAllowPromotionCodes(Boolean allowPromotionCodes) { * Settings for automatic tax lookup for this session and resulting payments, invoices, and * subscriptions. */ - public Builder setAutomaticTax(AutomaticTax automaticTax) { + public Builder setAutomaticTax(SessionCreateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } /** Specify whether Checkout should collect the customer's billing address. */ - public Builder setBillingAddressCollection(BillingAddressCollection billingAddressCollection) { + public Builder setBillingAddressCollection( + SessionCreateParams.BillingAddressCollection billingAddressCollection) { this.billingAddressCollection = billingAddressCollection; return this; } @@ -508,7 +510,7 @@ public Builder setClientReferenceId(String clientReferenceId) { } /** Configure fields for the Checkout Session to gather active consent from customers. */ - public Builder setConsentCollection(ConsentCollection consentCollection) { + public Builder setConsentCollection(SessionCreateParams.ConsentCollection consentCollection) { this.consentCollection = consentCollection; return this; } @@ -565,7 +567,7 @@ public Builder setCustomer(String customer) { * *

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; } @@ -585,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; } @@ -595,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<>(); } @@ -608,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<>(); } @@ -683,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<>(); } @@ -696,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<>(); } @@ -708,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; } @@ -743,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; } @@ -752,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; } @@ -769,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; } @@ -785,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<>(); } @@ -798,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<>(); } @@ -814,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; } @@ -823,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; } @@ -832,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; } @@ -842,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<>(); } @@ -855,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<>(); } @@ -895,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; } @@ -904,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; } @@ -921,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; } @@ -957,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); } /** @@ -988,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; } @@ -1039,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); } /** @@ -1123,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. */ @@ -1181,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() { @@ -1195,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); } /** @@ -1232,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 { @@ -1252,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 @@ -1310,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); } /** @@ -1319,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; } @@ -1354,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; } @@ -1364,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; } @@ -1453,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. */ @@ -1644,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, @@ -1664,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; } @@ -1796,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; } @@ -1857,7 +1904,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; @@ -1891,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); } /** @@ -1934,7 +1982,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; @@ -2055,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, @@ -2118,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; } @@ -2126,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; } @@ -2136,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; } @@ -2238,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, @@ -2399,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); } /** @@ -2435,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; } @@ -2669,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, @@ -2699,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; } @@ -2804,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; } @@ -2841,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; } @@ -2924,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, @@ -2935,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; } @@ -3073,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, @@ -3196,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. */ @@ -3333,7 +3389,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; @@ -3369,6 +3425,14 @@ 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; + /** contains details about the Sepa Debit payment method options. */ @SerializedName("sepa_debit") SepaDebit sepaDebit; @@ -3407,6 +3471,8 @@ private PaymentMethodOptions( Oxxo oxxo, P24 p24, Paynow paynow, + Paypal paypal, + Pix pix, SepaDebit sepaDebit, Sofort sofort, UsBankAccount usBankAccount, @@ -3432,6 +3498,8 @@ private PaymentMethodOptions( this.oxxo = oxxo; this.p24 = p24; this.paynow = paynow; + this.paypal = paypal; + this.pix = pix; this.sepaDebit = sepaDebit; this.sofort = sofort; this.usBankAccount = usBankAccount; @@ -3485,6 +3553,10 @@ public static class Builder { private Paynow paynow; + private Paypal paypal; + + private Pix pix; + private SepaDebit sepaDebit; private Sofort sofort; @@ -3494,8 +3566,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, @@ -3517,6 +3589,8 @@ public PaymentMethodOptions build() { this.oxxo, this.p24, this.paynow, + this.paypal, + this.pix, this.sepaDebit, this.sofort, this.usBankAccount, @@ -3524,67 +3598,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; } @@ -3616,80 +3693,93 @@ public Builder putAllExtraParam(Map map) { return this; } - /** contains details about the EPS payment method options. */ - public Builder setFpx(Fpx fpx) { + /** contains details about the FPX payment method options. */ + 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 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; + 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; } @@ -3769,8 +3859,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, @@ -3783,7 +3873,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; } @@ -3817,7 +3908,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; } @@ -3838,13 +3930,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; } @@ -3866,7 +3961,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 @@ -3895,7 +3991,8 @@ public static class MandateOptions { private MandateOptions( Object customMandateUrl, - List defaultFor, + List + defaultFor, Map extraParams, String intervalDescription, PaymentSchedule paymentSchedule, @@ -3915,7 +4012,8 @@ public static Builder builder() { public static class Builder { private Object customMandateUrl; - private List defaultFor; + private List + defaultFor; private Map extraParams; @@ -3926,8 +4024,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, @@ -3964,7 +4062,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<>(); } @@ -3978,7 +4078,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<>(); } @@ -4026,13 +4128,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; } @@ -4183,8 +4289,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); } /** @@ -4231,7 +4338,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; } @@ -4294,8 +4402,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); } /** @@ -4342,7 +4451,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; } @@ -4405,8 +4516,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); } /** @@ -4453,7 +4565,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; } @@ -4516,8 +4629,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); } /** @@ -4564,7 +4678,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; } @@ -4627,8 +4743,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); } /** @@ -4675,7 +4792,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; } @@ -4744,8 +4862,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); } /** @@ -4792,7 +4911,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; } @@ -4869,8 +4989,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); } /** @@ -4927,7 +5048,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; } @@ -5034,8 +5156,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, @@ -5072,7 +5194,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; } @@ -5093,7 +5216,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; } @@ -5126,9 +5250,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; @@ -5143,17 +5266,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() { @@ -5165,17 +5280,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; @@ -5209,159 +5322,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; - } - } } } @@ -5449,8 +5409,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); } @@ -5458,7 +5418,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; } @@ -5495,7 +5456,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; } @@ -5516,7 +5478,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; } @@ -5546,7 +5510,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. @@ -5562,7 +5529,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; @@ -5579,18 +5549,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; } @@ -5632,7 +5607,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<>(); } @@ -5647,7 +5625,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<>(); } @@ -5663,7 +5645,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; } @@ -5703,8 +5686,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); } /** @@ -5863,8 +5849,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); } /** @@ -5911,7 +5898,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; } @@ -5974,8 +5962,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); } /** @@ -6022,7 +6011,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; } @@ -6085,8 +6075,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); } /** @@ -6133,7 +6124,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; } @@ -6196,8 +6188,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); } /** @@ -6244,7 +6237,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; } @@ -6307,8 +6301,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); } /** @@ -6355,7 +6350,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; } @@ -6418,8 +6414,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); } /** @@ -6466,7 +6463,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; } @@ -6544,8 +6542,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); } /** @@ -6603,7 +6602,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; } @@ -6680,8 +6680,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); } /** @@ -6738,7 +6739,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; } @@ -6811,8 +6813,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); } /** @@ -6859,7 +6862,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; } @@ -6938,8 +6942,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); } /** @@ -6986,7 +6991,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; } @@ -7011,6 +7017,152 @@ 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 { + /** + * 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 SessionCreateParams.PaymentMethodOptions.Pix build() { + return new SessionCreateParams.PaymentMethodOptions.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 { /** @@ -7055,8 +7207,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); } /** @@ -7103,7 +7256,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; } @@ -7172,8 +7326,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); } /** @@ -7220,7 +7375,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; } @@ -7301,8 +7457,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, @@ -7338,7 +7494,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; } @@ -7359,13 +7517,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; } @@ -7389,10 +7551,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; } @@ -7404,11 +7571,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); } /** @@ -7447,7 +7619,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<>(); } @@ -7462,7 +7636,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<>(); } @@ -7589,8 +7767,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. */ @@ -7600,7 +7779,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; } @@ -7649,7 +7828,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; } @@ -7717,8 +7897,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. */ @@ -7809,8 +7989,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); } @@ -7888,7 +8068,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 @@ -7900,7 +8080,8 @@ public static class ShippingAddressCollection { Map extraParams; private ShippingAddressCollection( - List allowedCountries, Map extraParams) { + List allowedCountries, + Map extraParams) { this.allowedCountries = allowedCountries; this.extraParams = extraParams; } @@ -7910,13 +8091,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); } /** @@ -7925,7 +8107,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<>(); } @@ -7939,7 +8122,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<>(); } @@ -8734,8 +8918,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); } /** @@ -8771,7 +8956,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; } @@ -8880,8 +9066,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, @@ -8896,7 +9082,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; } @@ -8942,7 +9129,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; } @@ -8979,7 +9167,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; } @@ -8997,7 +9186,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; } @@ -9045,8 +9234,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); } /** @@ -9083,13 +9273,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; } @@ -9133,8 +9327,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); } /** @@ -9168,7 +9364,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; } @@ -9243,8 +9441,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); } /** @@ -9278,7 +9478,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; } @@ -9336,7 +9538,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 @@ -9351,7 +9554,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; @@ -9368,13 +9574,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); } @@ -9401,7 +9610,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<>(); } @@ -9416,7 +9628,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<>(); } @@ -9497,8 +9714,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. */ @@ -9541,7 +9760,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; } @@ -9648,7 +9870,7 @@ public static class SubscriptionData { * using {@code line_items}. */ @SerializedName("items") - List items; + List items; /** * Set of key-value pairs that you can attach @@ -9694,7 +9916,7 @@ private SubscriptionData( List defaultTaxRates, String description, Map extraParams, - List items, + List items, Map metadata, TransferData transferData, Long trialEnd, @@ -9728,7 +9950,7 @@ public static class Builder { private Map extraParams; - private List items; + private List items; private Map metadata; @@ -9741,8 +9963,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, @@ -9845,7 +10067,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<>(); } @@ -9858,7 +10080,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<>(); } @@ -9896,7 +10118,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; } @@ -9981,8 +10204,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); } /** @@ -10098,8 +10322,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); } /** @@ -10180,8 +10405,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. */ @@ -10477,6 +10702,12 @@ public enum PaymentMethodType 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/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/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/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 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/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 c23ccd780cf..f1376896b49 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java @@ -71,7 +71,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; } @@ -129,13 +129,14 @@ 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; } /** Simulated payment type. */ - public Builder setType(Type type) { + public Builder setType(ReaderPresentPaymentMethodParams.Type type) { this.type = type; return this; } @@ -171,8 +172,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); } /** @@ -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/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 b0c943b4d85..07b248e85ef 100644 --- a/src/main/java/com/stripe/param/treasury/OutboundTransferCreateParams.java +++ b/src/main/java/com/stripe/param/treasury/OutboundTransferCreateParams.java @@ -171,7 +171,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; } @@ -261,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; } @@ -307,8 +308,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); } /** @@ -340,7 +342,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; } @@ -382,8 +386,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); } /** @@ -417,7 +422,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; } @@ -477,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; } @@ -515,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; } @@ -551,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/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 1093baf85f6..ab893825d18 100644 --- a/src/main/java/com/stripe/param/treasury/ReceivedCreditCreateParams.java +++ b/src/main/java/com/stripe/param/treasury/ReceivedCreditCreateParams.java @@ -195,19 +195,19 @@ 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; } /** Details about the network used for the ReceivedCredit. */ - public Builder setNetworkDetails(NetworkDetails networkDetails) { + public Builder setNetworkDetails(ReceivedCreditCreateParams.NetworkDetails networkDetails) { this.networkDetails = networkDetails; return this; } @@ -251,8 +251,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); } /** @@ -284,13 +285,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; } @@ -344,8 +346,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); } @@ -449,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; } @@ -487,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; } @@ -523,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/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 5f8cd16d853..4ec14d0a37d 100644 --- a/src/main/java/com/stripe/param/treasury/ReceivedDebitCreateParams.java +++ b/src/main/java/com/stripe/param/treasury/ReceivedDebitCreateParams.java @@ -195,19 +195,19 @@ 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; } /** Details about the network used for the ReceivedDebit. */ - public Builder setNetworkDetails(NetworkDetails networkDetails) { + public Builder setNetworkDetails(ReceivedDebitCreateParams.NetworkDetails networkDetails) { this.networkDetails = networkDetails; return this; } @@ -251,8 +251,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); } /** @@ -284,13 +285,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; } @@ -344,8 +346,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); } @@ -449,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; } @@ -487,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; } @@ -523,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. */ 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); } /** 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();