From fe1b011540084a9f45a73bf57ca81e1dfdf32003 Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Wed, 3 Jun 2020 09:10:34 -0700 Subject: [PATCH] Codegen for openapi 1158945 --- src/main/java/com/stripe/model/Account.java | 12 + .../java/com/stripe/model/PaymentIntent.java | 16 + .../java/com/stripe/model/PaymentMethod.java | 37 +- src/main/java/com/stripe/model/Source.java | 7 + .../com/stripe/model/checkout/Session.java | 7 +- .../param/PaymentIntentConfirmParams.java | 128 ++++++- .../param/PaymentIntentCreateParams.java | 128 ++++++- .../param/PaymentIntentUpdateParams.java | 128 ++++++- .../param/PaymentMethodCreateParams.java | 316 ++++++++++++++++++ .../stripe/param/PaymentMethodListParams.java | 12 + .../param/checkout/SessionCreateParams.java | 60 +++- 11 files changed, 833 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/stripe/model/Account.java b/src/main/java/com/stripe/model/Account.java index afb75fd8f67..8dd6b820bba 100644 --- a/src/main/java/com/stripe/model/Account.java +++ b/src/main/java/com/stripe/model/Account.java @@ -1043,6 +1043,9 @@ public static class Settings extends StripeObject { @SerializedName("payouts") SettingsPayouts payouts; + @SerializedName("sepa_debit_payments") + SepaDebitPayments sepaDebitPayments; + @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -1054,6 +1057,15 @@ public static class BacsDebitPayments extends StripeObject { @SerializedName("display_name") String displayName; } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SepaDebitPayments extends StripeObject { + /** SEPA creditor identifier that identifies the company making the payment. */ + @SerializedName("creditor_id") + String creditorId; + } } @Getter diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index f17a17f9cf3..fdcd6fca0ab 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -1087,9 +1087,25 @@ public static class NextActionRedirectToUrl extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class PaymentMethodOptions extends StripeObject { + @SerializedName("bancontact") + Bancontact bancontact; + @SerializedName("card") Card card; + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Bancontact extends StripeObject { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + * + *

One of {@code de}, {@code en}, {@code fr}, or {@code nl}. + */ + @SerializedName("preferred_language") + String preferredLanguage; + } + @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 a287679eb1f..22e64d7470a 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -26,6 +26,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore

customer; + @SerializedName("eps") + Eps eps; + @SerializedName("fpx") Fpx fpx; + @SerializedName("giropay") + Giropay giropay; + /** Unique identifier for the object. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") @@ -85,6 +94,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore

One of {@code au_becs_debit}, {@code bacs_debit}, {@code card}, {@code card_present}, {@code - * fpx}, {@code ideal}, or {@code sepa_debit}. + *

One of {@code au_becs_debit}, {@code bacs_debit}, {@code bancontact}, {@code card}, {@code + * card_present}, {@code eps}, {@code fpx}, {@code giropay}, {@code ideal}, {@code p24}, or {@code + * sepa_debit}. */ @SerializedName("type") String type; @@ -438,6 +451,11 @@ public static class BacsDebit extends StripeObject { String sortCode; } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Bancontact extends StripeObject {} + @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -700,6 +718,11 @@ public static class VisaCheckout extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class CardPresent extends StripeObject {} + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Eps extends StripeObject {} + @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -719,6 +742,11 @@ public static class Fpx extends StripeObject { String bank; } + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Giropay extends StripeObject {} + @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -747,6 +775,11 @@ public static class Ideal extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class InteracPresent extends StripeObject {} + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class P24 extends StripeObject {} + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/Source.java b/src/main/java/com/stripe/model/Source.java index 2fbc85b2873..286ce33046d 100644 --- a/src/main/java/com/stripe/model/Source.java +++ b/src/main/java/com/stripe/model/Source.java @@ -942,6 +942,13 @@ public static class OrderItem extends StripeObject { @SerializedName("description") String description; + /** + * The ID of the associated object for this line item. Expandable if not null (e.g., expandable + * to a SKU). + */ + @SerializedName("parent") + String parent; + /** * The quantity of this order item. When type is {@code sku}, this is the number of instances of * the SKU to be ordered. diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index fa534aa19e5..dbe4eab3d09 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -94,9 +94,10 @@ public class Session extends ApiResource implements HasId { * The IETF language tag of the locale Checkout is displayed in. If blank or {@code auto}, the * browser's locale is used. * - *

One of {@code auto}, {@code da}, {@code de}, {@code en}, {@code es}, {@code fi}, {@code fr}, - * {@code it}, {@code ja}, {@code ms}, {@code nb}, {@code nl}, {@code pl}, {@code pt}, {@code - * pt-BR}, {@code sv}, or {@code zh}. + *

One of {@code auto}, {@code bg}, {@code cs}, {@code da}, {@code de}, {@code el}, {@code en}, + * {@code es}, {@code et}, {@code fi}, {@code fr}, {@code hu}, {@code it}, {@code ja}, {@code lt}, + * {@code lv}, {@code ms}, {@code mt}, {@code nb}, {@code nl}, {@code pl}, {@code pt}, {@code + * pt-BR}, {@code ro}, {@code ru}, {@code sk}, {@code sl}, {@code sv}, {@code tr}, or {@code zh}. */ @SerializedName("locale") String locale; diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 113acca8a2b..d801b1c1c3c 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -825,6 +825,13 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter public static class PaymentMethodOptions { + /** + * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the + * Bancontact payment method options. + */ + @SerializedName("bancontact") + Object bancontact; + /** Configuration for any card payments attempted on this PaymentIntent. */ @SerializedName("card") Object card; @@ -838,7 +845,8 @@ public static class PaymentMethodOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private PaymentMethodOptions(Object card, Map extraParams) { + private PaymentMethodOptions(Object bancontact, Object card, Map extraParams) { + this.bancontact = bancontact; this.card = card; this.extraParams = extraParams; } @@ -848,13 +856,33 @@ public static Builder builder() { } public static class Builder { + private Object bancontact; + private Object card; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ public PaymentMethodOptions build() { - return new PaymentMethodOptions(this.card, this.extraParams); + return new PaymentMethodOptions(this.bancontact, this.card, this.extraParams); + } + + /** + * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the + * Bancontact payment method options. + */ + public Builder setBancontact(Bancontact bancontact) { + this.bancontact = bancontact; + return this; + } + + /** + * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the + * Bancontact payment method options. + */ + public Builder setBancontact(EmptyParam bancontact) { + this.bancontact = bancontact; + return this; } /** Configuration for any card payments attempted on this PaymentIntent. */ @@ -897,6 +925,102 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Bancontact { + /** + * 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; + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + @SerializedName("preferred_language") + PreferredLanguage preferredLanguage; + + private Bancontact(Map extraParams, PreferredLanguage preferredLanguage) { + this.extraParams = extraParams; + this.preferredLanguage = preferredLanguage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private PreferredLanguage preferredLanguage; + + /** Finalize and obtain parameter instance from this builder. */ + public Bancontact build() { + return new Bancontact(this.extraParams, this.preferredLanguage); + } + + /** + * 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.Bancontact#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.Bancontact#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected + * to. + */ + public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + this.preferredLanguage = preferredLanguage; + return this; + } + } + + public enum PreferredLanguage implements ApiRequestParams.EnumParam { + @SerializedName("de") + DE("de"), + + @SerializedName("en") + EN("en"), + + @SerializedName("fr") + FR("fr"), + + @SerializedName("nl") + NL("nl"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLanguage(String value) { + this.value = value; + } + } + } + @Getter public static class Card { /** diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index b9aa4c3b03d..923b643aeaf 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -1207,6 +1207,13 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter public static class PaymentMethodOptions { + /** + * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the + * Bancontact payment method options. + */ + @SerializedName("bancontact") + Object bancontact; + /** Configuration for any card payments attempted on this PaymentIntent. */ @SerializedName("card") Object card; @@ -1220,7 +1227,8 @@ public static class PaymentMethodOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private PaymentMethodOptions(Object card, Map extraParams) { + private PaymentMethodOptions(Object bancontact, Object card, Map extraParams) { + this.bancontact = bancontact; this.card = card; this.extraParams = extraParams; } @@ -1230,13 +1238,33 @@ public static Builder builder() { } public static class Builder { + private Object bancontact; + private Object card; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ public PaymentMethodOptions build() { - return new PaymentMethodOptions(this.card, this.extraParams); + return new PaymentMethodOptions(this.bancontact, this.card, this.extraParams); + } + + /** + * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the + * Bancontact payment method options. + */ + public Builder setBancontact(Bancontact bancontact) { + this.bancontact = bancontact; + return this; + } + + /** + * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the + * Bancontact payment method options. + */ + public Builder setBancontact(EmptyParam bancontact) { + this.bancontact = bancontact; + return this; } /** Configuration for any card payments attempted on this PaymentIntent. */ @@ -1279,6 +1307,102 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Bancontact { + /** + * 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; + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + @SerializedName("preferred_language") + PreferredLanguage preferredLanguage; + + private Bancontact(Map extraParams, PreferredLanguage preferredLanguage) { + this.extraParams = extraParams; + this.preferredLanguage = preferredLanguage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private PreferredLanguage preferredLanguage; + + /** Finalize and obtain parameter instance from this builder. */ + public Bancontact build() { + return new Bancontact(this.extraParams, this.preferredLanguage); + } + + /** + * 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.Bancontact#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.Bancontact#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected + * to. + */ + public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + this.preferredLanguage = preferredLanguage; + return this; + } + } + + public enum PreferredLanguage implements ApiRequestParams.EnumParam { + @SerializedName("de") + DE("de"), + + @SerializedName("en") + EN("en"), + + @SerializedName("fr") + FR("fr"), + + @SerializedName("nl") + NL("nl"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLanguage(String value) { + this.value = value; + } + } + } + @Getter public static class Card { /** diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 680c00a381c..7ba5fc945a7 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -735,6 +735,13 @@ public Builder setTransferGroup(EmptyParam transferGroup) { @Getter public static class PaymentMethodOptions { + /** + * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the + * Bancontact payment method options. + */ + @SerializedName("bancontact") + Object bancontact; + /** Configuration for any card payments attempted on this PaymentIntent. */ @SerializedName("card") Object card; @@ -748,7 +755,8 @@ public static class PaymentMethodOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private PaymentMethodOptions(Object card, Map extraParams) { + private PaymentMethodOptions(Object bancontact, Object card, Map extraParams) { + this.bancontact = bancontact; this.card = card; this.extraParams = extraParams; } @@ -758,13 +766,33 @@ public static Builder builder() { } public static class Builder { + private Object bancontact; + private Object card; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ public PaymentMethodOptions build() { - return new PaymentMethodOptions(this.card, this.extraParams); + return new PaymentMethodOptions(this.bancontact, this.card, this.extraParams); + } + + /** + * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the + * Bancontact payment method options. + */ + public Builder setBancontact(Bancontact bancontact) { + this.bancontact = bancontact; + return this; + } + + /** + * If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the + * Bancontact payment method options. + */ + public Builder setBancontact(EmptyParam bancontact) { + this.bancontact = bancontact; + return this; } /** Configuration for any card payments attempted on this PaymentIntent. */ @@ -807,6 +835,102 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Bancontact { + /** + * 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; + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + @SerializedName("preferred_language") + PreferredLanguage preferredLanguage; + + private Bancontact(Map extraParams, PreferredLanguage preferredLanguage) { + this.extraParams = extraParams; + this.preferredLanguage = preferredLanguage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private PreferredLanguage preferredLanguage; + + /** Finalize and obtain parameter instance from this builder. */ + public Bancontact build() { + return new Bancontact(this.extraParams, this.preferredLanguage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodOptions.Bancontact#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodOptions.Bancontact#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected + * to. + */ + public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) { + this.preferredLanguage = preferredLanguage; + return this; + } + } + + public enum PreferredLanguage implements ApiRequestParams.EnumParam { + @SerializedName("de") + DE("de"), + + @SerializedName("en") + EN("en"), + + @SerializedName("fr") + FR("fr"), + + @SerializedName("nl") + NL("nl"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLanguage(String value) { + this.value = value; + } + } + } + @Getter public static class Card { /** diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index a68aa190f50..3448a3df3e2 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -24,6 +24,13 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("bacs_debit") BacsDebit bacsDebit; + /** + * If this is a {@code bancontact} PaymentMethod, this hash contains details about the Bancontact + * payment method. + */ + @SerializedName("bancontact") + Bancontact bancontact; + /** * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. @@ -46,6 +53,13 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("customer") String customer; + /** + * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment + * method. + */ + @SerializedName("eps") + Eps eps; + /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; @@ -66,6 +80,13 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("fpx") Fpx fpx; + /** + * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay + * payment method. + */ + @SerializedName("giropay") + Giropay giropay; + /** * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL payment * method. @@ -89,6 +110,13 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; + /** + * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment + * method. + */ + @SerializedName("p24") + P24 p24; + /** The PaymentMethod to share. */ @SerializedName("payment_method") String paymentMethod; @@ -113,29 +141,37 @@ public class PaymentMethodCreateParams extends ApiRequestParams { private PaymentMethodCreateParams( AuBecsDebit auBecsDebit, BacsDebit bacsDebit, + Bancontact bancontact, BillingDetails billingDetails, Object card, String customer, + Eps eps, List expand, Map extraParams, Fpx fpx, + Giropay giropay, Ideal ideal, InteracPresent interacPresent, Map metadata, + P24 p24, String paymentMethod, SepaDebit sepaDebit, Type type) { this.auBecsDebit = auBecsDebit; this.bacsDebit = bacsDebit; + this.bancontact = bancontact; this.billingDetails = billingDetails; this.card = card; this.customer = customer; + this.eps = eps; this.expand = expand; this.extraParams = extraParams; this.fpx = fpx; + this.giropay = giropay; this.ideal = ideal; this.interacPresent = interacPresent; this.metadata = metadata; + this.p24 = p24; this.paymentMethod = paymentMethod; this.sepaDebit = sepaDebit; this.type = type; @@ -150,24 +186,32 @@ public static class Builder { private BacsDebit bacsDebit; + private Bancontact bancontact; + private BillingDetails billingDetails; private Object card; private String customer; + private Eps eps; + private List expand; private Map extraParams; private Fpx fpx; + private Giropay giropay; + private Ideal ideal; private InteracPresent interacPresent; private Map metadata; + private P24 p24; + private String paymentMethod; private SepaDebit sepaDebit; @@ -179,15 +223,19 @@ public PaymentMethodCreateParams build() { return new PaymentMethodCreateParams( this.auBecsDebit, this.bacsDebit, + this.bancontact, this.billingDetails, this.card, this.customer, + this.eps, this.expand, this.extraParams, this.fpx, + this.giropay, this.ideal, this.interacPresent, this.metadata, + this.p24, this.paymentMethod, this.sepaDebit, this.type); @@ -211,6 +259,15 @@ public Builder setBacsDebit(BacsDebit bacsDebit) { return this; } + /** + * If this is a {@code bancontact} PaymentMethod, this hash contains details about the + * Bancontact payment method. + */ + public Builder setBancontact(Bancontact bancontact) { + this.bancontact = bancontact; + return this; + } + /** * Billing information associated with the PaymentMethod that may be used or required by * particular types of payment methods. @@ -252,6 +309,15 @@ public Builder setCustomer(String customer) { return this; } + /** + * If this is an {@code eps} PaymentMethod, this hash contains details about the EPS payment + * method. + */ + public Builder setEps(Eps eps) { + this.eps = eps; + return this; + } + /** * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link @@ -313,6 +379,15 @@ public Builder setFpx(Fpx fpx) { return this; } + /** + * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay + * payment method. + */ + public Builder setGiropay(Giropay giropay) { + this.giropay = giropay; + return this; + } + /** * If this is an {@code ideal} PaymentMethod, this hash contains details about the iDEAL payment * method. @@ -357,6 +432,15 @@ public Builder putAllMetadata(Map map) { return this; } + /** + * If this is a {@code p24} PaymentMethod, this hash contains details about the P24 payment + * method. + */ + public Builder setP24(P24 p24) { + this.p24 = p24; + return this; + } + /** The PaymentMethod to share. */ public Builder setPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; @@ -547,6 +631,61 @@ public Builder setSortCode(String sortCode) { } } + @Getter + public static class Bancontact { + /** + * 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 Bancontact(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Bancontact build() { + return new Bancontact(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodCreateParams.Bancontact#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodCreateParams.Bancontact#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 BillingDetails { /** Billing address. */ @@ -987,6 +1126,61 @@ public Builder setToken(String token) { } } + @Getter + public static class Eps { + /** + * 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 Eps(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Eps build() { + return new Eps(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodCreateParams.Eps#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodCreateParams.Eps#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 Fpx { /** Account holder type for FPX transaction. */ @@ -1152,6 +1346,61 @@ public enum Bank implements ApiRequestParams.EnumParam { } } + @Getter + public static class Giropay { + /** + * 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 Giropay(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public Giropay build() { + return new Giropay(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodCreateParams.Giropay#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodCreateParams.Giropay#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 Ideal { /** The customer's bank. */ @@ -1321,6 +1570,61 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class P24 { + /** + * 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 P24(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public P24 build() { + return new P24(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodCreateParams.P24#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodCreateParams.P24#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter public static class SepaDebit { /** @@ -1396,18 +1700,30 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("bacs_debit") BACS_DEBIT("bacs_debit"), + @SerializedName("bancontact") + BANCONTACT("bancontact"), + @SerializedName("card") CARD("card"), @SerializedName("card_present") CARD_PRESENT("card_present"), + @SerializedName("eps") + EPS("eps"), + @SerializedName("fpx") FPX("fpx"), + @SerializedName("giropay") + GIROPAY("giropay"), + @SerializedName("ideal") IDEAL("ideal"), + @SerializedName("p24") + P24("p24"), + @SerializedName("sepa_debit") SEPA_DEBIT("sepa_debit"); diff --git a/src/main/java/com/stripe/param/PaymentMethodListParams.java b/src/main/java/com/stripe/param/PaymentMethodListParams.java index 44bc7c745fc..b04c5070161 100644 --- a/src/main/java/com/stripe/param/PaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodListParams.java @@ -204,18 +204,30 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("au_becs_debit") AU_BECS_DEBIT("au_becs_debit"), + @SerializedName("bancontact") + BANCONTACT("bancontact"), + @SerializedName("card") CARD("card"), @SerializedName("card_present") CARD_PRESENT("card_present"), + @SerializedName("eps") + EPS("eps"), + @SerializedName("fpx") FPX("fpx"), + @SerializedName("giropay") + GIROPAY("giropay"), + @SerializedName("ideal") IDEAL("ideal"), + @SerializedName("p24") + P24("p24"), + @SerializedName("sepa_debit") SEPA_DEBIT("sepa_debit"); diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 29165ff495c..886d2e44ed7 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -63,10 +63,8 @@ public class SessionCreateParams extends ApiRequestParams { /** * A list of items the customer is purchasing. Use this parameter to pass one-time or recurring prices. - * - *

If not using recurring prices, this parameter is for one-time payments or adding invoice - * line items to a subscription (used in conjunction with {@code subscription_data.items}). + * href="https://stripe.com/docs/api/prices">prices. One-time prices in {@code subscription} + * mode will be on the initial invoice only. * *

There is a maximum of 100 line items, however it is recommended to consolidate line items if * there are more than a few dozen. @@ -105,7 +103,16 @@ public class SessionCreateParams extends ApiRequestParams { @SerializedName("payment_intent_data") PaymentIntentData paymentIntentData; - /** A list of the types of payment methods (e.g., card) this Checkout session can accept. */ + /** + * A list of the types of payment methods (e.g., {@code card}) this Checkout session can accept. + * + *

Read more about the supported payment methods and their requirements in our payment method details + * guide. + * + *

If multiple payment methods are passed, Checkout will dynamically reorder them to prioritize + * the most relevant payment methods based on the customer's location and other characteristics. + */ @SerializedName("payment_method_types") List paymentMethodTypes; @@ -820,7 +827,7 @@ public static class PriceData { @SerializedName("recurring") Recurring recurring; - /** A positive integer in %s (or 0 for a free price) representing how much to charge. */ + /** A positive integer in %s representing how much to charge. */ @SerializedName("unit_amount") Long unitAmount; @@ -941,7 +948,7 @@ public Builder setRecurring(Recurring recurring) { return this; } - /** A positive integer in %s (or 0 for a free price) representing how much to charge. */ + /** A positive integer in %s representing how much to charge. */ public Builder setUnitAmount(Long unitAmount) { this.unitAmount = unitAmount; return this; @@ -3369,33 +3376,57 @@ public enum Locale implements ApiRequestParams.EnumParam { @SerializedName("auto") AUTO("auto"), + @SerializedName("bg") + BG("bg"), + + @SerializedName("cs") + CS("cs"), + @SerializedName("da") DA("da"), @SerializedName("de") DE("de"), + @SerializedName("el") + EL("el"), + @SerializedName("en") EN("en"), @SerializedName("es") ES("es"), + @SerializedName("et") + ET("et"), + @SerializedName("fi") FI("fi"), @SerializedName("fr") FR("fr"), + @SerializedName("hu") + HU("hu"), + @SerializedName("it") IT("it"), @SerializedName("ja") JA("ja"), + @SerializedName("lt") + LT("lt"), + + @SerializedName("lv") + LV("lv"), + @SerializedName("ms") MS("ms"), + @SerializedName("mt") + MT("mt"), + @SerializedName("nb") NB("nb"), @@ -3411,9 +3442,24 @@ public enum Locale implements ApiRequestParams.EnumParam { @SerializedName("pt-BR") PT_BR("pt-BR"), + @SerializedName("ro") + RO("ro"), + + @SerializedName("ru") + RU("ru"), + + @SerializedName("sk") + SK("sk"), + + @SerializedName("sl") + SL("sl"), + @SerializedName("sv") SV("sv"), + @SerializedName("tr") + TR("tr"), + @SerializedName("zh") ZH("zh");