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, MetadataStoreEqual 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