From 46694606c7694bd3b78a217128301c9a9b6f10dc Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 26 Sep 2022 12:25:59 -0700 Subject: [PATCH] Codegen for openapi v196 --- OPENAPI_VERSION | 2 +- .../java/com/stripe/model/AccountSession.java | 8 +- .../stripe/model/EventDataClassLookup.java | 5 + src/main/java/com/stripe/model/Invoice.java | 119 ++- src/main/java/com/stripe/model/Order.java | 4 +- .../java/com/stripe/model/PaymentIntent.java | 53 ++ .../java/com/stripe/model/PaymentMethod.java | 13 +- src/main/java/com/stripe/model/Plan.java | 21 - src/main/java/com/stripe/model/Product.java | 49 + src/main/java/com/stripe/model/Quote.java | 7 + .../java/com/stripe/model/QuotePhase.java | 24 +- .../java/com/stripe/model/Subscription.java | 40 +- .../stripe/model/SubscriptionSchedule.java | 221 ++++- .../stripe/model/capital/FinancingOffer.java | 330 +++++++ .../capital/FinancingOfferCollection.java | 6 + .../model/capital/FinancingSummary.java | 145 +++ .../model/capital/FinancingTransaction.java | 206 +++++ .../FinancingTransactionCollection.java | 6 + .../java/com/stripe/model/issuing/Card.java | 8 + .../CustomerListPaymentMethodsParams.java | 3 + .../param/InvoiceUpcomingLinesParams.java | 222 +++++ .../stripe/param/InvoiceUpcomingParams.java | 182 ++-- .../com/stripe/param/OrderCreateParams.java | 845 ++++++++++++----- .../com/stripe/param/OrderUpdateParams.java | 854 +++++++++++++----- .../param/PaymentIntentConfirmParams.java | 286 ++++++ .../param/PaymentIntentCreateParams.java | 288 +++++- .../param/PaymentIntentUpdateParams.java | 313 ++++++- .../stripe/param/PaymentLinkCreateParams.java | 3 + .../stripe/param/PaymentLinkUpdateParams.java | 3 + .../param/PaymentMethodCreateParams.java | 385 +++++--- .../stripe/param/PaymentMethodListParams.java | 3 + .../com/stripe/param/PriceUpdateParams.java | 9 +- .../com/stripe/param/ProductCreateParams.java | 25 +- .../com/stripe/param/QuoteCreateParams.java | 219 +++-- .../com/stripe/param/QuoteUpdateParams.java | 222 +++-- .../param/SetupIntentConfirmParams.java | 637 +++++++++---- .../stripe/param/SetupIntentCreateParams.java | 651 +++++++++---- .../stripe/param/SetupIntentUpdateParams.java | 612 +++++++++---- .../param/SubscriptionCreateParams.java | 346 ++++--- .../param/SubscriptionItemCreateParams.java | 19 +- .../param/SubscriptionItemUpdateParams.java | 11 +- .../SubscriptionScheduleAmendParams.java | 216 +++-- .../SubscriptionScheduleCreateParams.java | 277 ++++-- .../SubscriptionScheduleUpdateParams.java | 302 +++++-- .../param/SubscriptionUpdateParams.java | 350 ++++--- .../param/WebhookEndpointCreateParams.java | 3 + .../param/WebhookEndpointUpdateParams.java | 3 + .../capital/FinancingOfferListParams.java | 365 ++++++++ .../FinancingOfferMarkDeliveredParams.java | 98 ++ .../capital/FinancingOfferRetrieveParams.java | 98 ++ .../FinancingSummaryRetrieveParams.java | 98 ++ .../FinancingTransactionListParams.java | 226 +++++ .../FinancingTransactionRetrieveParams.java | 98 ++ .../param/checkout/SessionCreateParams.java | 87 ++ .../param/giftcards/CardCreateParams.java | 14 +- .../param/giftcards/CardValidateParams.java | 16 +- .../giftcards/TransactionCreateParams.java | 15 +- .../param/issuing/CardCreateParams.java | 102 ++- .../ReaderPresentPaymentMethodParams.java | 7 +- .../OutboundTransferCreateParams.java | 16 +- .../treasury/ReceivedCreditCreateParams.java | 14 +- .../treasury/ReceivedDebitCreateParams.java | 14 +- 62 files changed, 7752 insertions(+), 2072 deletions(-) create mode 100644 src/main/java/com/stripe/model/capital/FinancingOffer.java create mode 100644 src/main/java/com/stripe/model/capital/FinancingOfferCollection.java create mode 100644 src/main/java/com/stripe/model/capital/FinancingSummary.java create mode 100644 src/main/java/com/stripe/model/capital/FinancingTransaction.java create mode 100644 src/main/java/com/stripe/model/capital/FinancingTransactionCollection.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingOfferListParams.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingOfferMarkDeliveredParams.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingOfferRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingSummaryRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingTransactionListParams.java create mode 100644 src/main/java/com/stripe/param/capital/FinancingTransactionRetrieveParams.java diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 073a3a984e1..72833e6d4c3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v185 \ No newline at end of file +v196 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/AccountSession.java b/src/main/java/com/stripe/model/AccountSession.java index c8fd9988c53..e55676cddd4 100644 --- a/src/main/java/com/stripe/model/AccountSession.java +++ b/src/main/java/com/stripe/model/AccountSession.java @@ -14,14 +14,14 @@ /** * An AccountSession allows a Connect platform to grant access to a connected account in Connect - * Elements. + * Embedded UIs. * *

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

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

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

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

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

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

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

One of {@code cash_advance}, or {@code flex_loan}. + */ + @SerializedName("financing_type") + String financingType; + + /** A unique identifier for the financing object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** + * The object type: financing_offer. + * + *

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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