diff --git a/src/main/java/com/stripe/model/AccountLink.java b/src/main/java/com/stripe/model/AccountLink.java index 39421a82b2f..dd65734267f 100644 --- a/src/main/java/com/stripe/model/AccountLink.java +++ b/src/main/java/com/stripe/model/AccountLink.java @@ -32,16 +32,16 @@ public class AccountLink extends ApiResource { String url; /** - * Creates an AccountLink object that returns a Stripe URL that the user can redirect their user - * to in order to take them through the Connect Onboarding flow. + * Creates an AccountLink object that returns a single-use Stripe URL that the user can redirect + * their user to in order to take them through the Connect Onboarding flow. */ public static AccountLink create(Map params) throws StripeException { return create(params, (RequestOptions) null); } /** - * Creates an AccountLink object that returns a Stripe URL that the user can redirect their user - * to in order to take them through the Connect Onboarding flow. + * Creates an AccountLink object that returns a single-use Stripe URL that the user can redirect + * their user to in order to take them through the Connect Onboarding flow. */ public static AccountLink create(Map params, RequestOptions options) throws StripeException { @@ -51,16 +51,16 @@ public static AccountLink create(Map params, RequestOptions opti } /** - * Creates an AccountLink object that returns a Stripe URL that the user can redirect their user - * to in order to take them through the Connect Onboarding flow. + * Creates an AccountLink object that returns a single-use Stripe URL that the user can redirect + * their user to in order to take them through the Connect Onboarding flow. */ public static AccountLink create(AccountLinkCreateParams params) throws StripeException { return create(params, (RequestOptions) null); } /** - * Creates an AccountLink object that returns a Stripe URL that the user can redirect their user - * to in order to take them through the Connect Onboarding flow. + * Creates an AccountLink object that returns a single-use Stripe URL that the user can redirect + * their user to in order to take them through the Connect Onboarding flow. */ public static AccountLink create(AccountLinkCreateParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 5b817b07a0c..9ee4def5c4c 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -1235,6 +1235,15 @@ public static class Card extends StripeObject { @SerializedName("iin") String iin; + /** + * Installment details for this payment (Mexico only). + * + *

For more information, see the [installments integration + * guide](https://stripe.com/docs/payments/installments). + */ + @SerializedName("installments") + Installments installments; + /** * Issuer bank name of the card. (Only for internal use only and not typically available in * standard API requests.) @@ -1284,6 +1293,15 @@ public static class Checks extends StripeObject { String cvcCheck; } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Installments extends StripeObject { + /** Installment plan selected for the payment. */ + @SerializedName("plan") + PaymentIntent.PaymentMethodOptions.Card.Installments.Plan plan; + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index b2f430e2d0d..d3b80e600d3 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -1245,8 +1245,8 @@ public static class CustomField extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class CustomerTaxId extends StripeObject { /** - * The type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `no_vat`, `nz_gst`, - * `unknown`, or `za_vat`. + * The type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `mx_rfc`, `no_vat`, + * `nz_gst`, `unknown`, or `za_vat`. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 125a48618a7..3c665a3ae54 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -1085,6 +1085,15 @@ public static class PaymentMethodOptions extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Card extends StripeObject { + /** + * Installment details for this payment (Mexico only). + * + *

For more information, see the [installments integration + * guide](https://stripe.com/docs/payments/installments). + */ + @SerializedName("installments") + Installments installments; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and [other @@ -1097,6 +1106,46 @@ public static class Card extends StripeObject { */ @SerializedName("request_three_d_secure") String requestThreeDSecure; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Installments extends StripeObject { + /** Installment plans that may be selected for this PaymentIntent. */ + @SerializedName("available_plans") + List availablePlans; + + /** Whether Installments are enabled for this PaymentIntent. */ + @SerializedName("enabled") + Boolean enabled; + + /** Installment plan selected for this PaymentIntent. */ + @SerializedName("plan") + Plan plan; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Plan extends StripeObject { + /** + * For `fixed_count` installment plans, this is the number of installment payments your + * customer will make to their credit card. + */ + @SerializedName("count") + Long count; + + /** + * For `fixed_count` installment plans, this is the interval between installment payments + * your customer will make to their credit card. One of `month`. + */ + @SerializedName("interval") + String interval; + + /** Type of installment plan, one of `fixed_count`. */ + @SerializedName("type") + String type; + } + } } } diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index b51cbeec6c1..7b3e096f077 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -170,10 +170,25 @@ public class Subscription extends ApiResource implements HasId, MetadataStore metadata; + /** + * Specifies the approximate timestamp on which any pending invoice items will be billed according + * to the schedule provided at `pending_invoice_item_interval`. + */ + @SerializedName("next_pending_invoice_item_invoice") + Long nextPendingInvoiceItemInvoice; + /** String representing the object's type. Objects of the same type share the same value. */ @SerializedName("object") String object; + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to + * calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given + * subscription at the specified interval. + */ + @SerializedName("pending_invoice_item_interval") + PendingInvoiceItemInterval pendingInvoiceItemInterval; + /** * You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user * authentication when creating a subscription without immediate payment or updating a @@ -684,4 +699,21 @@ public static class BillingThresholds extends StripeObject { @SerializedName("reset_billing_cycle_anchor") Boolean resetBillingCycleAnchor; } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PendingInvoiceItemInterval extends StripeObject { + /** Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. */ + @SerializedName("interval") + String interval; + + /** + * The number of intervals between invoices. For example, `interval=month` and + * `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 + * months, or 52 weeks). + */ + @SerializedName("interval_count") + Long intervalCount; + } } diff --git a/src/main/java/com/stripe/model/TaxId.java b/src/main/java/com/stripe/model/TaxId.java index 85ce35acf91..a8ed21e0c2a 100644 --- a/src/main/java/com/stripe/model/TaxId.java +++ b/src/main/java/com/stripe/model/TaxId.java @@ -49,8 +49,8 @@ public class TaxId extends ApiResource implements HasId { String object; /** - * Type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `no_vat`, `nz_gst`, - * `unknown`, or `za_vat`. + * Type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `mx_rfc`, `no_vat`, + * `nz_gst`, `za_vat`, or `unknown`. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/WebhookEndpoint.java b/src/main/java/com/stripe/model/WebhookEndpoint.java index ddb0310c36e..452afb835db 100644 --- a/src/main/java/com/stripe/model/WebhookEndpoint.java +++ b/src/main/java/com/stripe/model/WebhookEndpoint.java @@ -36,7 +36,8 @@ public class WebhookEndpoint extends ApiResource implements HasId { Boolean deleted; /** - * The list of events to enable for this endpoint. You may specify `['*']` to enable all events. + * The list of events to enable for this endpoint. `['*']` indicates that all events are enabled, + * except those that require explicit selection. */ @SerializedName("enabled_events") List enabledEvents; diff --git a/src/main/java/com/stripe/param/AccountLinkCreateParams.java b/src/main/java/com/stripe/param/AccountLinkCreateParams.java index 7848813f098..f5ad8ce3a46 100644 --- a/src/main/java/com/stripe/param/AccountLinkCreateParams.java +++ b/src/main/java/com/stripe/param/AccountLinkCreateParams.java @@ -38,7 +38,10 @@ public class AccountLinkCreateParams extends ApiRequestParams { @SerializedName("failure_url") String failureUrl; - /** The URL that the user will be redirected to upon completing the linked flow successfully. */ + /** + * The URL that the user will be redirected to upon leaving or completing the linked flow + * successfully. + */ @SerializedName("success_url") String successUrl; @@ -170,7 +173,10 @@ public Builder setFailureUrl(String failureUrl) { return this; } - /** The URL that the user will be redirected to upon completing the linked flow successfully. */ + /** + * The URL that the user will be redirected to upon leaving or completing the linked flow + * successfully. + */ public Builder setSuccessUrl(String successUrl) { this.successUrl = successUrl; return this; diff --git a/src/main/java/com/stripe/param/CustomerCreateParams.java b/src/main/java/com/stripe/param/CustomerCreateParams.java index 07acb3c171f..9a61e31ada5 100644 --- a/src/main/java/com/stripe/param/CustomerCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerCreateParams.java @@ -1062,8 +1062,8 @@ public static class TaxIdData { Map extraParams; /** - * Type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `no_vat`, `nz_gst`, or - * `za_vat`. + * Type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `mx_rfc`, `no_vat`, + * `nz_gst`, or `za_vat`. */ @SerializedName("type") Type type; @@ -1121,8 +1121,8 @@ public Builder putAllExtraParam(Map map) { } /** - * Type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `no_vat`, `nz_gst`, or - * `za_vat`. + * Type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `mx_rfc`, `no_vat`, + * `nz_gst`, or `za_vat`. */ public Builder setType(Type type) { this.type = type; @@ -1149,6 +1149,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("in_gst") IN_GST("in_gst"), + @SerializedName("mx_rfc") + MX_RFC("mx_rfc"), + @SerializedName("no_vat") NO_VAT("no_vat"), diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 772d6ffaa3b..5535a2ffeb2 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -455,6 +455,15 @@ public static class Card { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + * + *

For more information, see the [installments integration + * guide](https://stripe.com/docs/payments/installments). + */ + @SerializedName("installments") + Installments installments; + /** * When specified, this parameter indicates that a transaction will be marked as MOTO (Mail * Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided @@ -477,8 +486,12 @@ public static class Card { RequestThreeDSecure requestThreeDSecure; private Card( - Map extraParams, Boolean moto, RequestThreeDSecure requestThreeDSecure) { + Map extraParams, + Installments installments, + Boolean moto, + RequestThreeDSecure requestThreeDSecure) { this.extraParams = extraParams; + this.installments = installments; this.moto = moto; this.requestThreeDSecure = requestThreeDSecure; } @@ -490,13 +503,15 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Installments installments; + private Boolean moto; private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ public Card build() { - return new Card(this.extraParams, this.moto, this.requestThreeDSecure); + return new Card(this.extraParams, this.installments, this.moto, this.requestThreeDSecure); } /** @@ -527,6 +542,17 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + * + *

For more information, see the [installments integration + * guide](https://stripe.com/docs/payments/installments). + */ + public Builder setInstallments(Installments installments) { + this.installments = installments; + return this; + } + /** * When specified, this parameter indicates that a transaction will be marked as MOTO (Mail * Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided @@ -553,6 +579,250 @@ public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { } } + @Getter + public static class Installments { + /** + * Setting to true enables installments for this PaymentIntent. This will cause the response + * to contain a list of available installment plans. Setting to false will prevent any + * selected plan from applying to a charge. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * The selected installment plan to use for this payment attempt. This parameter can only be + * provided during confirmation. + */ + @SerializedName("plan") + Object plan; + + private Installments(Boolean enabled, Map extraParams, Object plan) { + this.enabled = enabled; + this.extraParams = extraParams; + this.plan = plan; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Object plan; + + /** Finalize and obtain parameter instance from this builder. */ + public Installments build() { + return new Installments(this.enabled, this.extraParams, this.plan); + } + + /** + * Setting to true enables installments for this PaymentIntent. This will cause the + * response to contain a list of available installment plans. Setting to false will + * prevent any selected plan from applying to a charge. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * The selected installment plan to use for this payment attempt. This parameter can only + * be provided during confirmation. + */ + public Builder setPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * The selected installment plan to use for this payment attempt. This parameter can only + * be provided during confirmation. + */ + public Builder setPlan(EmptyParam plan) { + this.plan = plan; + return this; + } + } + + @Getter + public static class Plan { + /** + * For `fixed_count` installment plans, this is the number of installment payments your + * customer will make to their credit card. + */ + @SerializedName("count") + Long count; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * For `fixed_count` installment plans, this is the interval between installment payments + * your customer will make to their credit card. One of `month`. + */ + @SerializedName("interval") + Interval interval; + + /** Type of installment plan, one of `fixed_count`. */ + @SerializedName("type") + Type type; + + private Plan(Long count, Map extraParams, Interval interval, Type type) { + this.count = count; + this.extraParams = extraParams; + this.interval = interval; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long count; + + private Map extraParams; + + private Interval interval; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public Plan build() { + return new Plan(this.count, this.extraParams, this.interval, this.type); + } + + /** + * For `fixed_count` installment plans, this is the number of installment payments your + * customer will make to their credit card. + */ + public Builder setCount(Long count) { + this.count = count; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments.Plan#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments.Plan#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * For `fixed_count` installment plans, this is the interval between installment + * payments your customer will make to their credit card. One of `month`. + */ + public Builder setInterval(Interval interval) { + this.interval = interval; + return this; + } + + /** Type of installment plan, one of `fixed_count`. */ + public Builder setType(Type type) { + this.type = type; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("month") + MONTH("month"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("fixed_count") + FIXED_COUNT("fixed_count"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + public enum RequestThreeDSecure implements ApiRequestParams.EnumParam { @SerializedName("any") ANY("any"), diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index a5e7023abba..2ed7a27f15d 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -2,6 +2,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -826,6 +827,15 @@ public static class Card { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + * + *

For more information, see the [installments integration + * guide](https://stripe.com/docs/payments/installments). + */ + @SerializedName("installments") + Installments installments; + /** * When specified, this parameter indicates that a transaction will be marked as MOTO (Mail * Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided @@ -848,8 +858,12 @@ public static class Card { RequestThreeDSecure requestThreeDSecure; private Card( - Map extraParams, Boolean moto, RequestThreeDSecure requestThreeDSecure) { + Map extraParams, + Installments installments, + Boolean moto, + RequestThreeDSecure requestThreeDSecure) { this.extraParams = extraParams; + this.installments = installments; this.moto = moto; this.requestThreeDSecure = requestThreeDSecure; } @@ -861,13 +875,15 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Installments installments; + private Boolean moto; private RequestThreeDSecure requestThreeDSecure; /** Finalize and obtain parameter instance from this builder. */ public Card build() { - return new Card(this.extraParams, this.moto, this.requestThreeDSecure); + return new Card(this.extraParams, this.installments, this.moto, this.requestThreeDSecure); } /** @@ -898,6 +914,17 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + * + *

For more information, see the [installments integration + * guide](https://stripe.com/docs/payments/installments). + */ + public Builder setInstallments(Installments installments) { + this.installments = installments; + return this; + } + /** * When specified, this parameter indicates that a transaction will be marked as MOTO (Mail * Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided @@ -924,6 +951,250 @@ public Builder setRequestThreeDSecure(RequestThreeDSecure requestThreeDSecure) { } } + @Getter + public static class Installments { + /** + * Setting to true enables installments for this PaymentIntent. This will cause the response + * to contain a list of available installment plans. Setting to false will prevent any + * selected plan from applying to a charge. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * The selected installment plan to use for this payment attempt. This parameter can only be + * provided during confirmation. + */ + @SerializedName("plan") + Object plan; + + private Installments(Boolean enabled, Map extraParams, Object plan) { + this.enabled = enabled; + this.extraParams = extraParams; + this.plan = plan; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Object plan; + + /** Finalize and obtain parameter instance from this builder. */ + public Installments build() { + return new Installments(this.enabled, this.extraParams, this.plan); + } + + /** + * Setting to true enables installments for this PaymentIntent. This will cause the + * response to contain a list of available installment plans. Setting to false will + * prevent any selected plan from applying to a charge. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * The selected installment plan to use for this payment attempt. This parameter can only + * be provided during confirmation. + */ + public Builder setPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * The selected installment plan to use for this payment attempt. This parameter can only + * be provided during confirmation. + */ + public Builder setPlan(EmptyParam plan) { + this.plan = plan; + return this; + } + } + + @Getter + public static class Plan { + /** + * For `fixed_count` installment plans, this is the number of installment payments your + * customer will make to their credit card. + */ + @SerializedName("count") + Long count; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * For `fixed_count` installment plans, this is the interval between installment payments + * your customer will make to their credit card. One of `month`. + */ + @SerializedName("interval") + Interval interval; + + /** Type of installment plan, one of `fixed_count`. */ + @SerializedName("type") + Type type; + + private Plan(Long count, Map extraParams, Interval interval, Type type) { + this.count = count; + this.extraParams = extraParams; + this.interval = interval; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long count; + + private Map extraParams; + + private Interval interval; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public Plan build() { + return new Plan(this.count, this.extraParams, this.interval, this.type); + } + + /** + * For `fixed_count` installment plans, this is the number of installment payments your + * customer will make to their credit card. + */ + public Builder setCount(Long count) { + this.count = count; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments.Plan#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments.Plan#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * For `fixed_count` installment plans, this is the interval between installment + * payments your customer will make to their credit card. One of `month`. + */ + public Builder setInterval(Interval interval) { + this.interval = interval; + return this; + } + + /** Type of installment plan, one of `fixed_count`. */ + public Builder setType(Type type) { + this.type = type; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("month") + MONTH("month"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("fixed_count") + FIXED_COUNT("fixed_count"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + public enum RequestThreeDSecure implements ApiRequestParams.EnumParam { @SerializedName("any") ANY("any"), diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index fbbee56e081..3fdb738b57c 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -155,6 +155,14 @@ public class SubscriptionCreateParams extends ApiRequestParams { @SerializedName("payment_behavior") PaymentBehavior paymentBehavior; + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to + * calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given + * subscription at the specified interval. + */ + @SerializedName("pending_invoice_item_interval") + Object pendingInvoiceItemInterval; + /** * Boolean (defaults to `true`) telling us whether to [credit for unused * time](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle @@ -230,6 +238,7 @@ private SubscriptionCreateParams( Map metadata, Boolean offSession, PaymentBehavior paymentBehavior, + Object pendingInvoiceItemInterval, Boolean prorate, Object taxPercent, TransferData transferData, @@ -255,6 +264,7 @@ private SubscriptionCreateParams( this.metadata = metadata; this.offSession = offSession; this.paymentBehavior = paymentBehavior; + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; this.prorate = prorate; this.taxPercent = taxPercent; this.transferData = transferData; @@ -306,6 +316,8 @@ public static class Builder { private PaymentBehavior paymentBehavior; + private Object pendingInvoiceItemInterval; + private Boolean prorate; private Object taxPercent; @@ -340,6 +352,7 @@ public SubscriptionCreateParams build() { this.metadata, this.offSession, this.paymentBehavior, + this.pendingInvoiceItemInterval, this.prorate, this.taxPercent, this.transferData, @@ -648,6 +661,27 @@ public Builder setPaymentBehavior(PaymentBehavior paymentBehavior) { return this; } + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to + * calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given + * subscription at the specified interval. + */ + public Builder setPendingInvoiceItemInterval( + PendingInvoiceItemInterval pendingInvoiceItemInterval) { + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; + return this; + } + + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to + * calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given + * subscription at the specified interval. + */ + public Builder setPendingInvoiceItemInterval(EmptyParam pendingInvoiceItemInterval) { + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; + return this; + } + /** * Boolean (defaults to `true`) telling us whether to [credit for unused * time](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle @@ -1117,6 +1151,119 @@ public Builder setUsageGte(Long usageGte) { } } + @Getter + public static class PendingInvoiceItemInterval { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals between invoices. For example, `interval=month` and + * `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 + * months, or 52 weeks). + */ + @SerializedName("interval_count") + Long intervalCount; + + private PendingInvoiceItemInterval( + Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public PendingInvoiceItemInterval build() { + return new PendingInvoiceItemInterval(this.extraParams, this.interval, this.intervalCount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SubscriptionCreateParams.PendingInvoiceItemInterval#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SubscriptionCreateParams.PendingInvoiceItemInterval#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. */ + public Builder setInterval(Interval interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals between invoices. For example, `interval=month` and + * `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 + * months, or 52 weeks). + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + @Getter public static class TransferData { /** ID of an existing, connected Stripe account. */ diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index 84cda88b78a..90a8f04669b 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -142,6 +142,14 @@ public class SubscriptionUpdateParams extends ApiRequestParams { @SerializedName("payment_behavior") PaymentBehavior paymentBehavior; + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to + * calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given + * subscription at the specified interval. + */ + @SerializedName("pending_invoice_item_interval") + Object pendingInvoiceItemInterval; + /** * Boolean (defaults to `true`) telling us whether to [credit for unused * time](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle @@ -218,6 +226,7 @@ private SubscriptionUpdateParams( Map metadata, Boolean offSession, PaymentBehavior paymentBehavior, + Object pendingInvoiceItemInterval, Boolean prorate, Long prorationDate, Object taxPercent, @@ -241,6 +250,7 @@ private SubscriptionUpdateParams( this.metadata = metadata; this.offSession = offSession; this.paymentBehavior = paymentBehavior; + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; this.prorate = prorate; this.prorationDate = prorationDate; this.taxPercent = taxPercent; @@ -288,6 +298,8 @@ public static class Builder { private PaymentBehavior paymentBehavior; + private Object pendingInvoiceItemInterval; + private Boolean prorate; private Long prorationDate; @@ -320,6 +332,7 @@ public SubscriptionUpdateParams build() { this.metadata, this.offSession, this.paymentBehavior, + this.pendingInvoiceItemInterval, this.prorate, this.prorationDate, this.taxPercent, @@ -649,6 +662,27 @@ public Builder setPaymentBehavior(PaymentBehavior paymentBehavior) { return this; } + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to + * calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given + * subscription at the specified interval. + */ + public Builder setPendingInvoiceItemInterval( + PendingInvoiceItemInterval pendingInvoiceItemInterval) { + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; + return this; + } + + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to + * calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given + * subscription at the specified interval. + */ + public Builder setPendingInvoiceItemInterval(EmptyParam pendingInvoiceItemInterval) { + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; + return this; + } + /** * Boolean (defaults to `true`) telling us whether to [credit for unused * time](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle @@ -1194,6 +1228,119 @@ public Builder setUsageGte(Long usageGte) { } } + @Getter + public static class PendingInvoiceItemInterval { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals between invoices. For example, `interval=month` and + * `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 + * months, or 52 weeks). + */ + @SerializedName("interval_count") + Long intervalCount; + + private PendingInvoiceItemInterval( + Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public PendingInvoiceItemInterval build() { + return new PendingInvoiceItemInterval(this.extraParams, this.interval, this.intervalCount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SubscriptionUpdateParams.PendingInvoiceItemInterval#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SubscriptionUpdateParams.PendingInvoiceItemInterval#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. */ + public Builder setInterval(Interval interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals between invoices. For example, `interval=month` and + * `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 + * months, or 52 weeks). + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + @Getter public static class TransferData { /** ID of an existing, connected Stripe account. */ diff --git a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java index 87302b56a6b..efcb3c172cb 100644 --- a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java @@ -24,8 +24,8 @@ public class TaxIdCollectionCreateParams extends ApiRequestParams { Map extraParams; /** - * Type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `no_vat`, `nz_gst`, or - * `za_vat`. + * Type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `mx_rfc`, `no_vat`, + * `nz_gst`, or `za_vat`. */ @SerializedName("type") Type type; @@ -113,8 +113,8 @@ public Builder putAllExtraParam(Map map) { } /** - * Type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `no_vat`, `nz_gst`, or - * `za_vat`. + * Type of the tax ID, one of `au_abn`, `ch_vat`, `eu_vat`, `in_gst`, `mx_rfc`, `no_vat`, + * `nz_gst`, or `za_vat`. */ public Builder setType(Type type) { this.type = type; @@ -141,6 +141,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("in_gst") IN_GST("in_gst"), + @SerializedName("mx_rfc") + MX_RFC("mx_rfc"), + @SerializedName("no_vat") NO_VAT("no_vat"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index 1172bc85e5c..d3dec65dfad 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -25,7 +25,8 @@ public class WebhookEndpointCreateParams extends ApiRequestParams { Boolean connect; /** - * The list of events to enable for this endpoint. You may specify `['*']` to enable all events. + * The list of events to enable for this endpoint. You may specify `['*']` to enable all events, + * except those that require explicit selection. */ @SerializedName("enabled_events") List enabledEvents; diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index c78945a7706..4f853a42473 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -16,7 +16,8 @@ public class WebhookEndpointUpdateParams extends ApiRequestParams { Boolean disabled; /** - * The list of events to enable for this endpoint. You may specify `['*']` to enable all events. + * The list of events to enable for this endpoint. You may specify `['*']` to enable all events, + * except those that require explicit selection. */ @SerializedName("enabled_events") List enabledEvents;