com.stripe.param.checkout.SessionCreateParams Maven / Gradle / Ivy
// Generated by delombok at Thu Oct 22 19:52:27 PDT 2020
// File generated from our OpenAPI spec
package com.stripe.param.checkout;
import com.google.gson.annotations.SerializedName;
import com.stripe.net.ApiRequestParams;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SessionCreateParams extends ApiRequestParams {
/**
* Enables user redeemable promotion codes.
*/
@SerializedName("allow_promotion_codes")
Boolean allowPromotionCodes;
/**
* Specify whether Checkout should collect the customer's billing address.
*/
@SerializedName("billing_address_collection")
BillingAddressCollection billingAddressCollection;
/**
* The URL the customer will be directed to if they decide to cancel payment and return to your
* website.
*/
@SerializedName("cancel_url")
String cancelUrl;
/**
* A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or
* similar, and can be used to reconcile the session with your internal systems.
*/
@SerializedName("client_reference_id")
String clientReferenceId;
/**
* ID of an existing customer, if one exists. The email stored on the customer will be used to
* prefill the email field on the Checkout page. If the customer changes their email on the
* Checkout page, the Customer object will be updated with the new email. If blank for Checkout
* Sessions in {@code payment} or {@code subscription} mode, Checkout will create a new customer
* object based on information provided during the session.
*/
@SerializedName("customer")
String customer;
/**
* If provided, this value will be used when the Customer object is created. If not provided,
* customers will be asked to enter their email address. Use this parameter to prefill customer
* data if you already have an email on file. To access information about the customer once a
* session is complete, use the {@code customer} field.
*/
@SerializedName("customer_email")
String customerEmail;
/**
* The coupon or promotion code to apply to this session. Currently, only up to one may be
* specified.
*/
@SerializedName("discounts")
List discounts;
/**
* Specifies which fields in the response should be expanded.
*/
@SerializedName("expand")
List expand;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* A list of items the customer is purchasing. Use this parameter to pass one-time or recurring 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.
*/
@SerializedName("line_items")
List lineItems;
/**
* The IETF language tag of the locale Checkout is displayed in. If blank or {@code auto}, the
* browser's locale is used.
*/
@SerializedName("locale")
Locale locale;
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format. Individual keys can be unset by posting an empty value to them. All keys can
* be unset by posting an empty value to {@code metadata}.
*/
@SerializedName("metadata")
Map metadata;
/**
* The mode of the Checkout Session. Required when using prices or {@code setup} mode. Pass {@code
* subscription} if Checkout session includes at least one recurring item.
*/
@SerializedName("mode")
Mode mode;
/**
* A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code
* payment} mode.
*/
@SerializedName("payment_intent_data")
PaymentIntentData paymentIntentData;
/**
* 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;
/**
* A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in {@code
* setup} mode.
*/
@SerializedName("setup_intent_data")
SetupIntentData setupIntentData;
/**
* When set, provides configuration for Checkout to collect a shipping address from a customer.
*/
@SerializedName("shipping_address_collection")
ShippingAddressCollection shippingAddressCollection;
/**
* Describes the type of transaction being performed by Checkout in order to customize relevant
* text on the page, such as the submit button. {@code submit_type} can only be specified on
* Checkout Sessions in {@code payment} mode, but not Checkout Sessions in {@code subscription} or
* {@code setup} mode.
*/
@SerializedName("submit_type")
SubmitType submitType;
/**
* A subset of parameters to be passed to subscription creation for Checkout Sessions in {@code
* subscription} mode.
*/
@SerializedName("subscription_data")
SubscriptionData subscriptionData;
/**
* The URL to which Stripe should send customers when payment or setup is complete. If you’d like
* access to the Checkout Session for the successful payment, read more about it in the guide on
* fulfilling orders.
*/
@SerializedName("success_url")
String successUrl;
private SessionCreateParams(Boolean allowPromotionCodes, BillingAddressCollection billingAddressCollection, String cancelUrl, String clientReferenceId, String customer, String customerEmail, List discounts, List expand, Map extraParams, List lineItems, Locale locale, Map metadata, Mode mode, PaymentIntentData paymentIntentData, List paymentMethodTypes, SetupIntentData setupIntentData, ShippingAddressCollection shippingAddressCollection, SubmitType submitType, SubscriptionData subscriptionData, String successUrl) {
this.allowPromotionCodes = allowPromotionCodes;
this.billingAddressCollection = billingAddressCollection;
this.cancelUrl = cancelUrl;
this.clientReferenceId = clientReferenceId;
this.customer = customer;
this.customerEmail = customerEmail;
this.discounts = discounts;
this.expand = expand;
this.extraParams = extraParams;
this.lineItems = lineItems;
this.locale = locale;
this.metadata = metadata;
this.mode = mode;
this.paymentIntentData = paymentIntentData;
this.paymentMethodTypes = paymentMethodTypes;
this.setupIntentData = setupIntentData;
this.shippingAddressCollection = shippingAddressCollection;
this.submitType = submitType;
this.subscriptionData = subscriptionData;
this.successUrl = successUrl;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Boolean allowPromotionCodes;
private BillingAddressCollection billingAddressCollection;
private String cancelUrl;
private String clientReferenceId;
private String customer;
private String customerEmail;
private List discounts;
private List expand;
private Map extraParams;
private List lineItems;
private Locale locale;
private Map metadata;
private Mode mode;
private PaymentIntentData paymentIntentData;
private List paymentMethodTypes;
private SetupIntentData setupIntentData;
private ShippingAddressCollection shippingAddressCollection;
private SubmitType submitType;
private SubscriptionData subscriptionData;
private String successUrl;
/**
* Finalize and obtain parameter instance from this builder.
*/
public SessionCreateParams build() {
return new SessionCreateParams(this.allowPromotionCodes, this.billingAddressCollection, this.cancelUrl, this.clientReferenceId, this.customer, this.customerEmail, this.discounts, this.expand, this.extraParams, this.lineItems, this.locale, this.metadata, this.mode, this.paymentIntentData, this.paymentMethodTypes, this.setupIntentData, this.shippingAddressCollection, this.submitType, this.subscriptionData, this.successUrl);
}
/**
* Enables user redeemable promotion codes.
*/
public Builder setAllowPromotionCodes(Boolean allowPromotionCodes) {
this.allowPromotionCodes = allowPromotionCodes;
return this;
}
/**
* Specify whether Checkout should collect the customer's billing address.
*/
public Builder setBillingAddressCollection(BillingAddressCollection billingAddressCollection) {
this.billingAddressCollection = billingAddressCollection;
return this;
}
/**
* The URL the customer will be directed to if they decide to cancel payment and return to your
* website.
*/
public Builder setCancelUrl(String cancelUrl) {
this.cancelUrl = cancelUrl;
return this;
}
/**
* A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or
* similar, and can be used to reconcile the session with your internal systems.
*/
public Builder setClientReferenceId(String clientReferenceId) {
this.clientReferenceId = clientReferenceId;
return this;
}
/**
* ID of an existing customer, if one exists. The email stored on the customer will be used to
* prefill the email field on the Checkout page. If the customer changes their email on the
* Checkout page, the Customer object will be updated with the new email. If blank for Checkout
* Sessions in {@code payment} or {@code subscription} mode, Checkout will create a new customer
* object based on information provided during the session.
*/
public Builder setCustomer(String customer) {
this.customer = customer;
return this;
}
/**
* If provided, this value will be used when the Customer object is created. If not provided,
* customers will be asked to enter their email address. Use this parameter to prefill customer
* data if you already have an email on file. To access information about the customer once a
* session is complete, use the {@code customer} field.
*/
public Builder setCustomerEmail(String customerEmail) {
this.customerEmail = customerEmail;
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
* SessionCreateParams#discounts} for the field documentation.
*/
public Builder addDiscount(Discount element) {
if (this.discounts == null) {
this.discounts = new ArrayList<>();
}
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
* SessionCreateParams#discounts} for the field documentation.
*/
public Builder addAllDiscount(List elements) {
if (this.discounts == null) {
this.discounts = new ArrayList<>();
}
this.discounts.addAll(elements);
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
* SessionCreateParams#expand} for the field documentation.
*/
public Builder addExpand(String element) {
if (this.expand == null) {
this.expand = new ArrayList<>();
}
this.expand.add(element);
return this;
}
/**
* Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams#expand} for the field documentation.
*/
public Builder addAllExpand(List elements) {
if (this.expand == null) {
this.expand = new ArrayList<>();
}
this.expand.addAll(elements);
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SessionCreateParams#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SessionCreateParams#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Add an element to `lineItems` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams#lineItems} for the field documentation.
*/
public Builder addLineItem(LineItem element) {
if (this.lineItems == null) {
this.lineItems = new ArrayList<>();
}
this.lineItems.add(element);
return this;
}
/**
* Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams#lineItems} for the field documentation.
*/
public Builder addAllLineItem(List elements) {
if (this.lineItems == null) {
this.lineItems = new ArrayList<>();
}
this.lineItems.addAll(elements);
return this;
}
/**
* The IETF language tag of the locale Checkout is displayed in. If blank or {@code auto}, the
* browser's locale is used.
*/
public Builder setLocale(Locale locale) {
this.locale = locale;
return this;
}
/**
* Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
* and subsequent calls add additional key/value pairs to the original map. See {@link
* SessionCreateParams#metadata} for the field documentation.
*/
public Builder putMetadata(String key, String value) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `metadata` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SessionCreateParams#metadata} for the field documentation.
*/
public Builder putAllMetadata(Map map) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.putAll(map);
return this;
}
/**
* The mode of the Checkout Session. Required when using prices or {@code setup} mode. Pass
* {@code subscription} if Checkout session includes at least one recurring item.
*/
public Builder setMode(Mode mode) {
this.mode = mode;
return this;
}
/**
* A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code
* payment} mode.
*/
public Builder setPaymentIntentData(PaymentIntentData paymentIntentData) {
this.paymentIntentData = paymentIntentData;
return this;
}
/**
* Add an element to `paymentMethodTypes` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams#paymentMethodTypes} for the field documentation.
*/
public Builder addPaymentMethodType(PaymentMethodType element) {
if (this.paymentMethodTypes == null) {
this.paymentMethodTypes = new ArrayList<>();
}
this.paymentMethodTypes.add(element);
return this;
}
/**
* Add all elements to `paymentMethodTypes` list. A list is initialized for the first
* `add/addAll` call, and subsequent calls adds additional elements to the original list. See
* {@link SessionCreateParams#paymentMethodTypes} for the field documentation.
*/
public Builder addAllPaymentMethodType(List elements) {
if (this.paymentMethodTypes == null) {
this.paymentMethodTypes = new ArrayList<>();
}
this.paymentMethodTypes.addAll(elements);
return this;
}
/**
* A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in {@code
* setup} mode.
*/
public Builder setSetupIntentData(SetupIntentData setupIntentData) {
this.setupIntentData = setupIntentData;
return this;
}
/**
* When set, provides configuration for Checkout to collect a shipping address from a customer.
*/
public Builder setShippingAddressCollection(ShippingAddressCollection shippingAddressCollection) {
this.shippingAddressCollection = shippingAddressCollection;
return this;
}
/**
* Describes the type of transaction being performed by Checkout in order to customize relevant
* text on the page, such as the submit button. {@code submit_type} can only be specified on
* Checkout Sessions in {@code payment} mode, but not Checkout Sessions in {@code subscription}
* or {@code setup} mode.
*/
public Builder setSubmitType(SubmitType submitType) {
this.submitType = submitType;
return this;
}
/**
* A subset of parameters to be passed to subscription creation for Checkout Sessions in {@code
* subscription} mode.
*/
public Builder setSubscriptionData(SubscriptionData subscriptionData) {
this.subscriptionData = subscriptionData;
return this;
}
/**
* The URL to which Stripe should send customers when payment or setup is complete. If you’d
* like access to the Checkout Session for the successful payment, read more about it in the
* guide on fulfilling
* orders.
*/
public Builder setSuccessUrl(String successUrl) {
this.successUrl = successUrl;
return this;
}
}
public static class Discount {
/**
* The ID of the coupon to apply to this session.
*/
@SerializedName("coupon")
String coupon;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* The ID of a promotion code to apply to this session.
*/
@SerializedName("promotion_code")
String promotionCode;
private Discount(String coupon, Map extraParams, String promotionCode) {
this.coupon = coupon;
this.extraParams = extraParams;
this.promotionCode = promotionCode;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String coupon;
private Map extraParams;
private String promotionCode;
/** Finalize and obtain parameter instance from this builder. */
public Discount build() {
return new Discount(this.coupon, this.extraParams, this.promotionCode);
}
/** The ID of the coupon to apply to this session. */
public Builder setCoupon(String coupon) {
this.coupon = coupon;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SessionCreateParams.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 SessionCreateParams.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;
}
public Builder setPromotionCode(String promotionCode) {
this.promotionCode = promotionCode;
return this;
}
}
/**
* The ID of the coupon to apply to this session.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCoupon() {
return this.coupon;
}
/**
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* The ID of a promotion code to apply to this session.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getPromotionCode() {
return this.promotionCode;
}
}
/**
* The ID of a promotion code to apply to this session.
*/
public static class LineItem {
/**
* The amount to be collected per unit of the line item. If specified, must also pass {@code
* currency} and {@code name}.
*/
@SerializedName("amount")
Long amount;
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported
* currency. Required if {@code amount} is passed.
*/
@SerializedName("currency")
String currency;
/**
* The description for the line item, to be displayed on the Checkout page.
*
* If using {@code price} or {@code price_data}, will default to the name of the associated
* product.
*/
@SerializedName("description")
String description;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* A list of image URLs representing this line item. Each image can be up to 5 MB in size. If
* passing {@code price} or {@code price_data}, specify images on the associated product
* instead.
*/
@SerializedName("images")
List images;
/**
* The name for the item to be displayed on the Checkout page. Required if {@code amount} is
* passed.
*/
@SerializedName("name")
String name;
/**
* The ID of the Price or Plan object. One of {@code price}, {@code
* price_data} or {@code amount} is required.
*/
@SerializedName("price")
String price;
/**
* Data used to generate a new Price object
* inline. One of {@code price}, {@code price_data} or {@code amount} is required.
*/
@SerializedName("price_data")
PriceData priceData;
/**
* The quantity of the line item being purchased.
*/
@SerializedName("quantity")
Long quantity;
/**
* The tax rates which apply to this line
* item. This is only allowed in subscription mode.
*/
@SerializedName("tax_rates")
List taxRates;
private LineItem(Long amount, String currency, String description, Map extraParams, List images, String name, String price, PriceData priceData, Long quantity, List taxRates) {
this.amount = amount;
this.currency = currency;
this.description = description;
this.extraParams = extraParams;
this.images = images;
this.name = name;
this.price = price;
this.priceData = priceData;
this.quantity = quantity;
this.taxRates = taxRates;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Long amount;
private String currency;
private String description;
private Map extraParams;
private List images;
private String name;
private String price;
private PriceData priceData;
private Long quantity;
private List taxRates;
/**
* Finalize and obtain parameter instance from this builder.
*/
public LineItem build() {
return new LineItem(this.amount, this.currency, this.description, this.extraParams, this.images, this.name, this.price, this.priceData, this.quantity, this.taxRates);
}
/**
* The amount to be collected per unit of the line item. If specified, must also pass {@code
* currency} and {@code name}.
*/
public Builder setAmount(Long amount) {
this.amount = amount;
return this;
}
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported
* currency. Required if {@code amount} is passed.
*/
public Builder setCurrency(String currency) {
this.currency = currency;
return this;
}
/**
* The description for the line item, to be displayed on the Checkout page.
*
* If using {@code price} or {@code price_data}, will default to the name of the associated
* product.
*/
public Builder setDescription(String description) {
this.description = description;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SessionCreateParams.LineItem#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SessionCreateParams.LineItem#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Add an element to `images` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.LineItem#images} for the field documentation.
*/
public Builder addImage(String element) {
if (this.images == null) {
this.images = new ArrayList<>();
}
this.images.add(element);
return this;
}
/**
* Add all elements to `images` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.LineItem#images} for the field documentation.
*/
public Builder addAllImage(List elements) {
if (this.images == null) {
this.images = new ArrayList<>();
}
this.images.addAll(elements);
return this;
}
/**
* The name for the item to be displayed on the Checkout page. Required if {@code amount} is
* passed.
*/
public Builder setName(String name) {
this.name = name;
return this;
}
/**
* The ID of the Price or Plan object. One of {@code price}, {@code
* price_data} or {@code amount} is required.
*/
public Builder setPrice(String price) {
this.price = price;
return this;
}
/**
* Data used to generate a new Price object
* inline. One of {@code price}, {@code price_data} or {@code amount} is required.
*/
public Builder setPriceData(PriceData priceData) {
this.priceData = priceData;
return this;
}
/**
* The quantity of the line item being purchased.
*/
public Builder setQuantity(Long quantity) {
this.quantity = quantity;
return this;
}
/**
* Add an element to `taxRates` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.LineItem#taxRates} for the field documentation.
*/
public Builder addTaxRate(String element) {
if (this.taxRates == null) {
this.taxRates = new ArrayList<>();
}
this.taxRates.add(element);
return this;
}
/**
* Add all elements to `taxRates` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.LineItem#taxRates} for the field documentation.
*/
public Builder addAllTaxRate(List elements) {
if (this.taxRates == null) {
this.taxRates = new ArrayList<>();
}
this.taxRates.addAll(elements);
return this;
}
}
public static class PriceData {
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported
* currency.
*/
@SerializedName("currency")
String currency;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
* name in this param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* The ID of the product that this price will belong to. One of {@code product} or {@code
* product_data} is required.
*/
@SerializedName("product")
String product;
/**
* Data used to generate a new product object inline. One of {@code product} or {@code
* product_data} is required.
*/
@SerializedName("product_data")
ProductData productData;
/** The recurring components of a price such as {@code interval} and {@code usage_type}. */
@SerializedName("recurring")
Recurring recurring;
/**
* A non-negative integer in %s representing how much to charge. One of {@code unit_amount} or
* {@code unit_amount_decimal} is required.
*/
@SerializedName("unit_amount")
Long unitAmount;
/**
* Same as {@code unit_amount}, but accepts a decimal value in %s with at most 12 decimal
* places. Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
@SerializedName("unit_amount_decimal")
BigDecimal unitAmountDecimal;
private PriceData(String currency, Map extraParams, String product, ProductData productData, Recurring recurring, Long unitAmount, BigDecimal unitAmountDecimal) {
this.currency = currency;
this.extraParams = extraParams;
this.product = product;
this.productData = productData;
this.recurring = recurring;
this.unitAmount = unitAmount;
this.unitAmountDecimal = unitAmountDecimal;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String currency;
private Map extraParams;
private String product;
private ProductData productData;
private Recurring recurring;
private Long unitAmount;
private BigDecimal unitAmountDecimal;
/** Finalize and obtain parameter instance from this builder. */
public PriceData build() {
return new PriceData(this.currency, this.extraParams, this.product, this.productData, this.recurring, this.unitAmount, this.unitAmountDecimal);
}
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported
* currency.
*/
public Builder setCurrency(String currency) {
this.currency = currency;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.LineItem.PriceData#extraParams} for the field
* documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.LineItem.PriceData#extraParams} for the field
* documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* The ID of the product that this price will belong to. One of {@code product} or {@code
* product_data} is required.
*/
public Builder setProduct(String product) {
this.product = product;
return this;
}
/**
* Data used to generate a new product object inline. One of {@code product} or {@code
* product_data} is required.
*/
public Builder setProductData(ProductData productData) {
this.productData = productData;
return this;
}
/** The recurring components of a price such as {@code interval} and {@code usage_type}. */
public Builder setRecurring(Recurring recurring) {
this.recurring = recurring;
return this;
}
/**
* A non-negative integer in %s representing how much to charge. One of {@code unit_amount}
* or {@code unit_amount_decimal} is required.
*/
public Builder setUnitAmount(Long unitAmount) {
this.unitAmount = unitAmount;
return this;
}
/**
* Same as {@code unit_amount}, but accepts a decimal value in %s with at most 12 decimal
* places. Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) {
this.unitAmountDecimal = unitAmountDecimal;
return this;
}
}
public static class ProductData {
/**
* The product's description, meant to be displayable to the customer. Use this field to
* optionally store a long form explanation of the product being sold for your own rendering
* purposes.
*/
@SerializedName("description")
String description;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* A list of up to 8 URLs of images for this product, meant to be displayable to the
* customer.
*/
@SerializedName("images")
List images;
/**
* Set of key-value pairs that you can
* attach to an object. This can be useful for storing additional information about the
* object in a structured format. Individual keys can be unset by posting an empty value to
* them. All keys can be unset by posting an empty value to {@code metadata}.
*/
@SerializedName("metadata")
Map metadata;
/**
* The product's name, meant to be displayable to the customer. Whenever this product is
* sold via a subscription, name will show up on associated invoice line item descriptions.
*/
@SerializedName("name")
String name;
private ProductData(String description, Map extraParams, List images, Map metadata, String name) {
this.description = description;
this.extraParams = extraParams;
this.images = images;
this.metadata = metadata;
this.name = name;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String description;
private Map extraParams;
private List images;
private Map metadata;
private String name;
/** Finalize and obtain parameter instance from this builder. */
public ProductData build() {
return new ProductData(this.description, this.extraParams, this.images, this.metadata, this.name);
}
/**
* The product's description, meant to be displayable to the customer. Use this field to
* optionally store a long form explanation of the product being sold for your own
* rendering purposes.
*/
public Builder setDescription(String description) {
this.description = description;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.LineItem.PriceData.ProductData#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.LineItem.PriceData.ProductData#extraParams} for the
* field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Add an element to `images` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.LineItem.PriceData.ProductData#images} for the field documentation.
*/
public Builder addImage(String element) {
if (this.images == null) {
this.images = new ArrayList<>();
}
this.images.add(element);
return this;
}
/**
* Add all elements to `images` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.LineItem.PriceData.ProductData#images} for the field documentation.
*/
public Builder addAllImage(List elements) {
if (this.images == null) {
this.images = new ArrayList<>();
}
this.images.addAll(elements);
return this;
}
/**
* Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See
* {@link SessionCreateParams.LineItem.PriceData.ProductData#metadata} for the field
* documentation.
*/
public Builder putMetadata(String key, String value) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `metadata` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.LineItem.PriceData.ProductData#metadata} for the
* field documentation.
*/
public Builder putAllMetadata(Map map) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.putAll(map);
return this;
}
/**
* The product's name, meant to be displayable to the customer. Whenever this product is
* sold via a subscription, name will show up on associated invoice line item
* descriptions.
*/
public Builder setName(String name) {
this.name = name;
return this;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getDescription() {
return this.description;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getImages() {
return this.images;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getMetadata() {
return this.metadata;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getName() {
return this.name;
}
}
public static class Recurring {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code
* year}.
*/
@SerializedName("interval")
Interval interval;
/**
* The number of intervals between subscription billings. For example, {@code
* interval=month} and {@code interval_count=3} bills every 3 months. Maximum of one year
* interval allowed (1 year, 12 months, or 52 weeks).
*/
@SerializedName("interval_count")
Long intervalCount;
private Recurring(Map extraParams, Interval interval, Long intervalCount) {
this.extraParams = extraParams;
this.interval = interval;
this.intervalCount = intervalCount;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private Interval interval;
private Long intervalCount;
/** Finalize and obtain parameter instance from this builder. */
public Recurring build() {
return new Recurring(this.extraParams, this.interval, this.intervalCount);
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.LineItem.PriceData.Recurring#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.LineItem.PriceData.Recurring#extraParams} for the
* field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code
* year}.
*/
public Builder setInterval(Interval interval) {
this.interval = interval;
return this;
}
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");
private final String value;
Interval(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Interval getInterval() {
return this.interval;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getIntervalCount() {
return this.intervalCount;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCurrency() {
return this.currency;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getProduct() {
return this.product;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public ProductData getProductData() {
return this.productData;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Recurring getRecurring() {
return this.recurring;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getUnitAmount() {
return this.unitAmount;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public BigDecimal getUnitAmountDecimal() {
return this.unitAmountDecimal;
}
}
/**
* The amount to be collected per unit of the line item. If specified, must also pass {@code
* currency} and {@code name}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getAmount() {
return this.amount;
}
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported
* currency. Required if {@code amount} is passed.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCurrency() {
return this.currency;
}
/**
* The description for the line item, to be displayed on the Checkout page.
*
* If using {@code price} or {@code price_data}, will default to the name of the associated
* product.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getDescription() {
return this.description;
}
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* A list of image URLs representing this line item. Each image can be up to 5 MB in size. If
* passing {@code price} or {@code price_data}, specify images on the associated product
* instead.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getImages() {
return this.images;
}
/**
* The name for the item to be displayed on the Checkout page. Required if {@code amount} is
* passed.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getName() {
return this.name;
}
/**
* The ID of the Price or Plan object. One of {@code price}, {@code
* price_data} or {@code amount} is required.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getPrice() {
return this.price;
}
/**
* Data used to generate a new Price object
* inline. One of {@code price}, {@code price_data} or {@code amount} is required.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public PriceData getPriceData() {
return this.priceData;
}
/**
* The quantity of the line item being purchased.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getQuantity() {
return this.quantity;
}
/**
* The tax rates which apply to this line
* item. This is only allowed in subscription mode.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getTaxRates() {
return this.taxRates;
}
}
/**
* The number of intervals between subscription billings. For example, {@code
* interval=month} and {@code interval_count=3} bills every 3 months. Maximum of one year
* interval allowed (1 year, 12 months, or 52 weeks).
*/
public static class PaymentIntentData {
/**
* The amount of the application fee (if any) that will be requested to be applied to the
* payment and transferred to the application owner's Stripe account. The amount of the
* application fee collected will be capped at the total payment amount. To use an application
* fee, the request must be made on behalf of another account, using the {@code Stripe-Account}
* header or an OAuth key. For more information, see the PaymentIntents use case for connected
* accounts.
*/
@SerializedName("application_fee_amount")
Long applicationFeeAmount;
/**
* Controls when the funds will be captured from the customer's account.
*/
@SerializedName("capture_method")
CaptureMethod captureMethod;
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
@SerializedName("description")
String description;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* 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;
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format. Individual keys can be unset by posting an empty value to them. All keys
* can be unset by posting an empty value to {@code metadata}.
*/
@SerializedName("metadata")
Map metadata;
/**
* The Stripe account ID for which these funds are intended. For details, see the PaymentIntents
* use case for connected
* accounts.
*/
@SerializedName("on_behalf_of")
String onBehalfOf;
/**
* Email address that the receipt for the resulting payment will be sent to. If {@code
* receipt_email} is specified for a payment in live mode, a receipt will be sent regardless of
* your email settings.
*/
@SerializedName("receipt_email")
String receiptEmail;
/**
* Indicates that you intend to make future payments with the payment method collected by this
* Checkout Session.
*
* When setting this to {@code off_session}, Checkout will show a notice to the customer that
* their payment details will be saved and used for future payments.
*
*
When processing card payments, Checkout also uses {@code setup_future_usage} to
* dynamically optimize your payment flow and comply with regional legislation and network
* rules, such as SCA.
*/
@SerializedName("setup_future_usage")
SetupFutureUsage setupFutureUsage;
/**
* Shipping information for this payment.
*/
@SerializedName("shipping")
Shipping shipping;
/**
* Extra information about the payment. This will appear on your customer's statement when this
* payment succeeds in creating a charge.
*/
@SerializedName("statement_descriptor")
String statementDescriptor;
/**
* Provides information about the charge that customers see on their statements. Concatenated
* with the prefix (shortened descriptor) or statement descriptor that’s set on the account to
* form the complete statement descriptor. Maximum 22 characters for the concatenated
* descriptor.
*/
@SerializedName("statement_descriptor_suffix")
String statementDescriptorSuffix;
/**
* The parameters used to automatically create a Transfer when the payment succeeds. For more
* information, see the PaymentIntents use case for connected
* accounts.
*/
@SerializedName("transfer_data")
TransferData transferData;
/**
* A string that identifies the resulting payment as part of a group. See the PaymentIntents use case for connected
* accounts for details.
*/
@SerializedName("transfer_group")
String transferGroup;
private PaymentIntentData(Long applicationFeeAmount, CaptureMethod captureMethod, String description, Map extraParams, Map metadata, String onBehalfOf, String receiptEmail, SetupFutureUsage setupFutureUsage, Shipping shipping, String statementDescriptor, String statementDescriptorSuffix, TransferData transferData, String transferGroup) {
this.applicationFeeAmount = applicationFeeAmount;
this.captureMethod = captureMethod;
this.description = description;
this.extraParams = extraParams;
this.metadata = metadata;
this.onBehalfOf = onBehalfOf;
this.receiptEmail = receiptEmail;
this.setupFutureUsage = setupFutureUsage;
this.shipping = shipping;
this.statementDescriptor = statementDescriptor;
this.statementDescriptorSuffix = statementDescriptorSuffix;
this.transferData = transferData;
this.transferGroup = transferGroup;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Long applicationFeeAmount;
private CaptureMethod captureMethod;
private String description;
private Map extraParams;
private Map metadata;
private String onBehalfOf;
private String receiptEmail;
private SetupFutureUsage setupFutureUsage;
private Shipping shipping;
private String statementDescriptor;
private String statementDescriptorSuffix;
private TransferData transferData;
private String transferGroup;
/**
* Finalize and obtain parameter instance from this builder.
*/
public PaymentIntentData build() {
return new PaymentIntentData(this.applicationFeeAmount, this.captureMethod, this.description, this.extraParams, this.metadata, this.onBehalfOf, this.receiptEmail, this.setupFutureUsage, this.shipping, this.statementDescriptor, this.statementDescriptorSuffix, this.transferData, this.transferGroup);
}
/**
* The amount of the application fee (if any) that will be requested to be applied to the
* payment and transferred to the application owner's Stripe account. The amount of the
* application fee collected will be capped at the total payment amount. To use an application
* fee, the request must be made on behalf of another account, using the {@code
* Stripe-Account} header or an OAuth key. For more information, see the PaymentIntents use case for connected
* accounts.
*/
public Builder setApplicationFeeAmount(Long applicationFeeAmount) {
this.applicationFeeAmount = applicationFeeAmount;
return this;
}
/**
* Controls when the funds will be captured from the customer's account.
*/
public Builder setCaptureMethod(CaptureMethod captureMethod) {
this.captureMethod = captureMethod;
return this;
}
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
public Builder setDescription(String description) {
this.description = description;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SessionCreateParams.PaymentIntentData#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SessionCreateParams.PaymentIntentData#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SessionCreateParams.PaymentIntentData#metadata} for the field documentation.
*/
public Builder putMetadata(String key, String value) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `metadata` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SessionCreateParams.PaymentIntentData#metadata} for the field documentation.
*/
public Builder putAllMetadata(Map map) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.putAll(map);
return this;
}
/**
* The Stripe account ID for which these funds are intended. For details, see the
* PaymentIntents use case for
* connected accounts.
*/
public Builder setOnBehalfOf(String onBehalfOf) {
this.onBehalfOf = onBehalfOf;
return this;
}
/**
* Email address that the receipt for the resulting payment will be sent to. If {@code
* receipt_email} is specified for a payment in live mode, a receipt will be sent regardless
* of your email settings.
*/
public Builder setReceiptEmail(String receiptEmail) {
this.receiptEmail = receiptEmail;
return this;
}
/**
* Indicates that you intend to make future payments with the payment method collected by this
* Checkout Session.
*
* When setting this to {@code off_session}, Checkout will show a notice to the customer
* that their payment details will be saved and used for future payments.
*
*
When processing card payments, Checkout also uses {@code setup_future_usage} to
* dynamically optimize your payment flow and comply with regional legislation and network
* rules, such as SCA.
*/
public Builder setSetupFutureUsage(SetupFutureUsage setupFutureUsage) {
this.setupFutureUsage = setupFutureUsage;
return this;
}
/**
* Shipping information for this payment.
*/
public Builder setShipping(Shipping shipping) {
this.shipping = shipping;
return this;
}
/**
* Extra information about the payment. This will appear on your customer's statement when
* this payment succeeds in creating a charge.
*/
public Builder setStatementDescriptor(String statementDescriptor) {
this.statementDescriptor = statementDescriptor;
return this;
}
/**
* Provides information about the charge that customers see on their statements. Concatenated
* with the prefix (shortened descriptor) or statement descriptor that’s set on the account to
* form the complete statement descriptor. Maximum 22 characters for the concatenated
* descriptor.
*/
public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) {
this.statementDescriptorSuffix = statementDescriptorSuffix;
return this;
}
/**
* The parameters used to automatically create a Transfer when the payment succeeds. For more
* information, see the PaymentIntents use case for connected
* accounts.
*/
public Builder setTransferData(TransferData transferData) {
this.transferData = transferData;
return this;
}
/**
* A string that identifies the resulting payment as part of a group. See the PaymentIntents
* use case for connected
* accounts for details.
*/
public Builder setTransferGroup(String transferGroup) {
this.transferGroup = transferGroup;
return this;
}
}
public static class Shipping {
/**
* Shipping address.
*/
@SerializedName("address")
Address address;
/**
* The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
*/
@SerializedName("carrier")
String carrier;
/**
* 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;
/**
* Recipient name.
*/
@SerializedName("name")
String name;
/**
* Recipient phone (including extension).
*/
@SerializedName("phone")
String phone;
/**
* The tracking number for a physical product, obtained from the delivery service. If multiple
* tracking numbers were generated for this purchase, please separate them with commas.
*/
@SerializedName("tracking_number")
String trackingNumber;
private Shipping(Address address, String carrier, Map extraParams, String name, String phone, String trackingNumber) {
this.address = address;
this.carrier = carrier;
this.extraParams = extraParams;
this.name = name;
this.phone = phone;
this.trackingNumber = trackingNumber;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Address address;
private String carrier;
private Map extraParams;
private String name;
private String phone;
private String trackingNumber;
/**
* Finalize and obtain parameter instance from this builder.
*/
public Shipping build() {
return new Shipping(this.address, this.carrier, this.extraParams, this.name, this.phone, this.trackingNumber);
}
/**
* Shipping address.
*/
public Builder setAddress(Address address) {
this.address = address;
return this;
}
/**
* The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
*/
public Builder setCarrier(String carrier) {
this.carrier = carrier;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.PaymentIntentData.Shipping#extraParams} for the field
* documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.PaymentIntentData.Shipping#extraParams} for the field
* documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Recipient name.
*/
public Builder setName(String name) {
this.name = name;
return this;
}
/**
* Recipient phone (including extension).
*/
public Builder setPhone(String phone) {
this.phone = phone;
return this;
}
/**
* The tracking number for a physical product, obtained from the delivery service. If
* multiple tracking numbers were generated for this purchase, please separate them with
* commas.
*/
public Builder setTrackingNumber(String trackingNumber) {
this.trackingNumber = trackingNumber;
return this;
}
}
public static class Address {
/** City, district, suburb, town, or village. */
@SerializedName("city")
String city;
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
@SerializedName("country")
String country;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/** Address line 1 (e.g., street, PO Box, or company name). */
@SerializedName("line1")
String line1;
/** Address line 2 (e.g., apartment, suite, unit, or building). */
@SerializedName("line2")
String line2;
/** ZIP or postal code. */
@SerializedName("postal_code")
String postalCode;
/** State, county, province, or region. */
@SerializedName("state")
String state;
private Address(String city, String country, Map extraParams, String line1, String line2, String postalCode, String state) {
this.city = city;
this.country = country;
this.extraParams = extraParams;
this.line1 = line1;
this.line2 = line2;
this.postalCode = postalCode;
this.state = state;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String city;
private String country;
private Map extraParams;
private String line1;
private String line2;
private String postalCode;
private String state;
/** Finalize and obtain parameter instance from this builder. */
public Address build() {
return new Address(this.city, this.country, this.extraParams, this.line1, this.line2, this.postalCode, this.state);
}
/** City, district, suburb, town, or village. */
public Builder setCity(String city) {
this.city = city;
return this;
}
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
public Builder setCountry(String country) {
this.country = country;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.PaymentIntentData.Shipping.Address#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.PaymentIntentData.Shipping.Address#extraParams} for
* the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Address line 1 (e.g., street, PO Box, or company name). */
public Builder setLine1(String line1) {
this.line1 = line1;
return this;
}
/** Address line 2 (e.g., apartment, suite, unit, or building). */
public Builder setLine2(String line2) {
this.line2 = line2;
return this;
}
/** ZIP or postal code. */
public Builder setPostalCode(String postalCode) {
this.postalCode = postalCode;
return this;
}
public Builder setState(String state) {
this.state = state;
return this;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCity() {
return this.city;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCountry() {
return this.country;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getLine1() {
return this.line1;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getLine2() {
return this.line2;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getPostalCode() {
return this.postalCode;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getState() {
return this.state;
}
}
/**
* Shipping address.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Address getAddress() {
return this.address;
}
/**
* The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCarrier() {
return this.carrier;
}
/**
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* Recipient name.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getName() {
return this.name;
}
/**
* Recipient phone (including extension).
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getPhone() {
return this.phone;
}
/**
* The tracking number for a physical product, obtained from the delivery service. If multiple
* tracking numbers were generated for this purchase, please separate them with commas.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getTrackingNumber() {
return this.trackingNumber;
}
}
/**
* State, county, province, or region.
*/
public static class TransferData {
/**
* The amount that will be transferred automatically when a charge succeeds.
*/
@SerializedName("amount")
Long amount;
/**
* If specified, successful charges will be attributed to the destination account for tax
* reporting, and the funds from charges will be transferred to the destination account. The
* ID of the resulting transfer will be returned on the successful charge's {@code transfer}
* field.
*/
@SerializedName("destination")
String destination;
/**
* 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 TransferData(Long amount, String destination, Map extraParams) {
this.amount = amount;
this.destination = destination;
this.extraParams = extraParams;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Long amount;
private String destination;
private Map extraParams;
/** Finalize and obtain parameter instance from this builder. */
public TransferData build() {
return new TransferData(this.amount, this.destination, this.extraParams);
}
/** The amount that will be transferred automatically when a charge succeeds. */
public Builder setAmount(Long amount) {
this.amount = amount;
return this;
}
/**
* If specified, successful charges will be attributed to the destination account for tax
* reporting, and the funds from charges will be transferred to the destination account. The
* ID of the resulting transfer will be returned on the successful charge's {@code transfer}
* field.
*/
public Builder setDestination(String destination) {
this.destination = destination;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.PaymentIntentData.TransferData#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;
}
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}
/**
* The amount that will be transferred automatically when a charge succeeds.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getAmount() {
return this.amount;
}
/**
* If specified, successful charges will be attributed to the destination account for tax
* reporting, and the funds from charges will be transferred to the destination account. The
* ID of the resulting transfer will be returned on the successful charge's {@code transfer}
* field.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getDestination() {
return this.destination;
}
/**
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.PaymentIntentData.TransferData#extraParams} for the
* field documentation.
*/
public enum CaptureMethod implements ApiRequestParams.EnumParam {
@SerializedName("automatic")
AUTOMATIC("automatic"), @SerializedName("manual")
MANUAL("manual");
private final String value;
CaptureMethod(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum SetupFutureUsage implements ApiRequestParams.EnumParam {
@SerializedName("off_session")
OFF_SESSION("off_session"), @SerializedName("on_session")
ON_SESSION("on_session");
private final String value;
SetupFutureUsage(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
/**
* The amount of the application fee (if any) that will be requested to be applied to the
* payment and transferred to the application owner's Stripe account. The amount of the
* application fee collected will be capped at the total payment amount. To use an application
* fee, the request must be made on behalf of another account, using the {@code Stripe-Account}
* header or an OAuth key. For more information, see the PaymentIntents use case for connected
* accounts.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getApplicationFeeAmount() {
return this.applicationFeeAmount;
}
/**
* Controls when the funds will be captured from the customer's account.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public CaptureMethod getCaptureMethod() {
return this.captureMethod;
}
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getDescription() {
return this.description;
}
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format. Individual keys can be unset by posting an empty value to them. All keys
* can be unset by posting an empty value to {@code metadata}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getMetadata() {
return this.metadata;
}
/**
* The Stripe account ID for which these funds are intended. For details, see the PaymentIntents
* use case for connected
* accounts.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getOnBehalfOf() {
return this.onBehalfOf;
}
/**
* Email address that the receipt for the resulting payment will be sent to. If {@code
* receipt_email} is specified for a payment in live mode, a receipt will be sent regardless of
* your email settings.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getReceiptEmail() {
return this.receiptEmail;
}
/**
* Indicates that you intend to make future payments with the payment method collected by this
* Checkout Session.
*
* When setting this to {@code off_session}, Checkout will show a notice to the customer that
* their payment details will be saved and used for future payments.
*
*
When processing card payments, Checkout also uses {@code setup_future_usage} to
* dynamically optimize your payment flow and comply with regional legislation and network
* rules, such as SCA.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public SetupFutureUsage getSetupFutureUsage() {
return this.setupFutureUsage;
}
/**
* Shipping information for this payment.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Shipping getShipping() {
return this.shipping;
}
/**
* Extra information about the payment. This will appear on your customer's statement when this
* payment succeeds in creating a charge.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getStatementDescriptor() {
return this.statementDescriptor;
}
/**
* Provides information about the charge that customers see on their statements. Concatenated
* with the prefix (shortened descriptor) or statement descriptor that’s set on the account to
* form the complete statement descriptor. Maximum 22 characters for the concatenated
* descriptor.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getStatementDescriptorSuffix() {
return this.statementDescriptorSuffix;
}
/**
* The parameters used to automatically create a Transfer when the payment succeeds. For more
* information, see the PaymentIntents use case for connected
* accounts.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public TransferData getTransferData() {
return this.transferData;
}
/**
* A string that identifies the resulting payment as part of a group. See the PaymentIntents use case for connected
* accounts for details.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getTransferGroup() {
return this.transferGroup;
}
}
public static class SetupIntentData {
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
@SerializedName("description")
String description;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* 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;
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format. Individual keys can be unset by posting an empty value to them. All keys
* can be unset by posting an empty value to {@code metadata}.
*/
@SerializedName("metadata")
Map metadata;
/**
* The Stripe account for which the setup is intended.
*/
@SerializedName("on_behalf_of")
String onBehalfOf;
private SetupIntentData(String description, Map extraParams, Map metadata, String onBehalfOf) {
this.description = description;
this.extraParams = extraParams;
this.metadata = metadata;
this.onBehalfOf = onBehalfOf;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String description;
private Map extraParams;
private Map metadata;
private String onBehalfOf;
/** Finalize and obtain parameter instance from this builder. */
public SetupIntentData build() {
return new SetupIntentData(this.description, this.extraParams, this.metadata, this.onBehalfOf);
}
/** An arbitrary string attached to the object. Often useful for displaying to users. */
public Builder setDescription(String description) {
this.description = description;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SessionCreateParams.SetupIntentData#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SessionCreateParams.SetupIntentData#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SessionCreateParams.SetupIntentData#metadata} for the field documentation.
*/
public Builder putMetadata(String key, String value) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `metadata` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SessionCreateParams.SetupIntentData#metadata} for the field documentation.
*/
public Builder putAllMetadata(Map map) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.putAll(map);
return this;
}
public Builder setOnBehalfOf(String onBehalfOf) {
this.onBehalfOf = onBehalfOf;
return this;
}
}
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getDescription() {
return this.description;
}
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format. Individual keys can be unset by posting an empty value to them. All keys
* can be unset by posting an empty value to {@code metadata}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getMetadata() {
return this.metadata;
}
/**
* The Stripe account for which the setup is intended.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getOnBehalfOf() {
return this.onBehalfOf;
}
}
/**
* The Stripe account for which the setup is intended.
*/
public static class ShippingAddressCollection {
/**
* An array of two-letter ISO country codes representing which countries Checkout should provide
* as options for shipping locations. Unsupported country codes: {@code AS, CX, CC, CU, HM, IR,
* KP, MH, FM, NF, MP, PW, SD, SY, UM, VI}.
*/
@SerializedName("allowed_countries")
List allowedCountries;
/**
* 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 ShippingAddressCollection(List allowedCountries, Map extraParams) {
this.allowedCountries = allowedCountries;
this.extraParams = extraParams;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private List allowedCountries;
private Map extraParams;
/**
* Finalize and obtain parameter instance from this builder.
*/
public ShippingAddressCollection build() {
return new ShippingAddressCollection(this.allowedCountries, this.extraParams);
}
/**
* Add an element to `allowedCountries` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.ShippingAddressCollection#allowedCountries} for the field
* documentation.
*/
public Builder addAllowedCountry(AllowedCountry element) {
if (this.allowedCountries == null) {
this.allowedCountries = new ArrayList<>();
}
this.allowedCountries.add(element);
return this;
}
/**
* Add all elements to `allowedCountries` list. A list is initialized for the first
* `add/addAll` call, and subsequent calls adds additional elements to the original list. See
* {@link SessionCreateParams.ShippingAddressCollection#allowedCountries} for the field
* documentation.
*/
public Builder addAllAllowedCountry(List elements) {
if (this.allowedCountries == null) {
this.allowedCountries = new ArrayList<>();
}
this.allowedCountries.addAll(elements);
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SessionCreateParams.ShippingAddressCollection#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SessionCreateParams.ShippingAddressCollection#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 enum AllowedCountry implements ApiRequestParams.EnumParam {
@SerializedName("AC")
AC("AC"), @SerializedName("AD")
AD("AD"), @SerializedName("AE")
AE("AE"), @SerializedName("AF")
AF("AF"), @SerializedName("AG")
AG("AG"), @SerializedName("AI")
AI("AI"), @SerializedName("AL")
AL("AL"), @SerializedName("AM")
AM("AM"), @SerializedName("AO")
AO("AO"), @SerializedName("AQ")
AQ("AQ"), @SerializedName("AR")
AR("AR"), @SerializedName("AT")
AT("AT"), @SerializedName("AU")
AU("AU"), @SerializedName("AW")
AW("AW"), @SerializedName("AX")
AX("AX"), @SerializedName("AZ")
AZ("AZ"), @SerializedName("BA")
BA("BA"), @SerializedName("BB")
BB("BB"), @SerializedName("BD")
BD("BD"), @SerializedName("BE")
BE("BE"), @SerializedName("BF")
BF("BF"), @SerializedName("BG")
BG("BG"), @SerializedName("BH")
BH("BH"), @SerializedName("BI")
BI("BI"), @SerializedName("BJ")
BJ("BJ"), @SerializedName("BL")
BL("BL"), @SerializedName("BM")
BM("BM"), @SerializedName("BN")
BN("BN"), @SerializedName("BO")
BO("BO"), @SerializedName("BQ")
BQ("BQ"), @SerializedName("BR")
BR("BR"), @SerializedName("BS")
BS("BS"), @SerializedName("BT")
BT("BT"), @SerializedName("BV")
BV("BV"), @SerializedName("BW")
BW("BW"), @SerializedName("BY")
BY("BY"), @SerializedName("BZ")
BZ("BZ"), @SerializedName("CA")
CA("CA"), @SerializedName("CD")
CD("CD"), @SerializedName("CF")
CF("CF"), @SerializedName("CG")
CG("CG"), @SerializedName("CH")
CH("CH"), @SerializedName("CI")
CI("CI"), @SerializedName("CK")
CK("CK"), @SerializedName("CL")
CL("CL"), @SerializedName("CM")
CM("CM"), @SerializedName("CN")
CN("CN"), @SerializedName("CO")
CO("CO"), @SerializedName("CR")
CR("CR"), @SerializedName("CV")
CV("CV"), @SerializedName("CW")
CW("CW"), @SerializedName("CY")
CY("CY"), @SerializedName("CZ")
CZ("CZ"), @SerializedName("DE")
DE("DE"), @SerializedName("DJ")
DJ("DJ"), @SerializedName("DK")
DK("DK"), @SerializedName("DM")
DM("DM"), @SerializedName("DO")
DO("DO"), @SerializedName("DZ")
DZ("DZ"), @SerializedName("EC")
EC("EC"), @SerializedName("EE")
EE("EE"), @SerializedName("EG")
EG("EG"), @SerializedName("EH")
EH("EH"), @SerializedName("ER")
ER("ER"), @SerializedName("ES")
ES("ES"), @SerializedName("ET")
ET("ET"), @SerializedName("FI")
FI("FI"), @SerializedName("FJ")
FJ("FJ"), @SerializedName("FK")
FK("FK"), @SerializedName("FO")
FO("FO"), @SerializedName("FR")
FR("FR"), @SerializedName("GA")
GA("GA"), @SerializedName("GB")
GB("GB"), @SerializedName("GD")
GD("GD"), @SerializedName("GE")
GE("GE"), @SerializedName("GF")
GF("GF"), @SerializedName("GG")
GG("GG"), @SerializedName("GH")
GH("GH"), @SerializedName("GI")
GI("GI"), @SerializedName("GL")
GL("GL"), @SerializedName("GM")
GM("GM"), @SerializedName("GN")
GN("GN"), @SerializedName("GP")
GP("GP"), @SerializedName("GQ")
GQ("GQ"), @SerializedName("GR")
GR("GR"), @SerializedName("GS")
GS("GS"), @SerializedName("GT")
GT("GT"), @SerializedName("GU")
GU("GU"), @SerializedName("GW")
GW("GW"), @SerializedName("GY")
GY("GY"), @SerializedName("HK")
HK("HK"), @SerializedName("HN")
HN("HN"), @SerializedName("HR")
HR("HR"), @SerializedName("HT")
HT("HT"), @SerializedName("HU")
HU("HU"), @SerializedName("ID")
ID("ID"), @SerializedName("IE")
IE("IE"), @SerializedName("IL")
IL("IL"), @SerializedName("IM")
IM("IM"), @SerializedName("IN")
IN("IN"), @SerializedName("IO")
IO("IO"), @SerializedName("IQ")
IQ("IQ"), @SerializedName("IS")
IS("IS"), @SerializedName("IT")
IT("IT"), @SerializedName("JE")
JE("JE"), @SerializedName("JM")
JM("JM"), @SerializedName("JO")
JO("JO"), @SerializedName("JP")
JP("JP"), @SerializedName("KE")
KE("KE"), @SerializedName("KG")
KG("KG"), @SerializedName("KH")
KH("KH"), @SerializedName("KI")
KI("KI"), @SerializedName("KM")
KM("KM"), @SerializedName("KN")
KN("KN"), @SerializedName("KR")
KR("KR"), @SerializedName("KW")
KW("KW"), @SerializedName("KY")
KY("KY"), @SerializedName("KZ")
KZ("KZ"), @SerializedName("LA")
LA("LA"), @SerializedName("LB")
LB("LB"), @SerializedName("LC")
LC("LC"), @SerializedName("LI")
LI("LI"), @SerializedName("LK")
LK("LK"), @SerializedName("LR")
LR("LR"), @SerializedName("LS")
LS("LS"), @SerializedName("LT")
LT("LT"), @SerializedName("LU")
LU("LU"), @SerializedName("LV")
LV("LV"), @SerializedName("LY")
LY("LY"), @SerializedName("MA")
MA("MA"), @SerializedName("MC")
MC("MC"), @SerializedName("MD")
MD("MD"), @SerializedName("ME")
ME("ME"), @SerializedName("MF")
MF("MF"), @SerializedName("MG")
MG("MG"), @SerializedName("MK")
MK("MK"), @SerializedName("ML")
ML("ML"), @SerializedName("MM")
MM("MM"), @SerializedName("MN")
MN("MN"), @SerializedName("MO")
MO("MO"), @SerializedName("MQ")
MQ("MQ"), @SerializedName("MR")
MR("MR"), @SerializedName("MS")
MS("MS"), @SerializedName("MT")
MT("MT"), @SerializedName("MU")
MU("MU"), @SerializedName("MV")
MV("MV"), @SerializedName("MW")
MW("MW"), @SerializedName("MX")
MX("MX"), @SerializedName("MY")
MY("MY"), @SerializedName("MZ")
MZ("MZ"), @SerializedName("NA")
NA("NA"), @SerializedName("NC")
NC("NC"), @SerializedName("NE")
NE("NE"), @SerializedName("NG")
NG("NG"), @SerializedName("NI")
NI("NI"), @SerializedName("NL")
NL("NL"), @SerializedName("NO")
NO("NO"), @SerializedName("NP")
NP("NP"), @SerializedName("NR")
NR("NR"), @SerializedName("NU")
NU("NU"), @SerializedName("NZ")
NZ("NZ"), @SerializedName("OM")
OM("OM"), @SerializedName("PA")
PA("PA"), @SerializedName("PE")
PE("PE"), @SerializedName("PF")
PF("PF"), @SerializedName("PG")
PG("PG"), @SerializedName("PH")
PH("PH"), @SerializedName("PK")
PK("PK"), @SerializedName("PL")
PL("PL"), @SerializedName("PM")
PM("PM"), @SerializedName("PN")
PN("PN"), @SerializedName("PR")
PR("PR"), @SerializedName("PS")
PS("PS"), @SerializedName("PT")
PT("PT"), @SerializedName("PY")
PY("PY"), @SerializedName("QA")
QA("QA"), @SerializedName("RE")
RE("RE"), @SerializedName("RO")
RO("RO"), @SerializedName("RS")
RS("RS"), @SerializedName("RU")
RU("RU"), @SerializedName("RW")
RW("RW"), @SerializedName("SA")
SA("SA"), @SerializedName("SB")
SB("SB"), @SerializedName("SC")
SC("SC"), @SerializedName("SE")
SE("SE"), @SerializedName("SG")
SG("SG"), @SerializedName("SH")
SH("SH"), @SerializedName("SI")
SI("SI"), @SerializedName("SJ")
SJ("SJ"), @SerializedName("SK")
SK("SK"), @SerializedName("SL")
SL("SL"), @SerializedName("SM")
SM("SM"), @SerializedName("SN")
SN("SN"), @SerializedName("SO")
SO("SO"), @SerializedName("SR")
SR("SR"), @SerializedName("SS")
SS("SS"), @SerializedName("ST")
ST("ST"), @SerializedName("SV")
SV("SV"), @SerializedName("SX")
SX("SX"), @SerializedName("SZ")
SZ("SZ"), @SerializedName("TA")
TA("TA"), @SerializedName("TC")
TC("TC"), @SerializedName("TD")
TD("TD"), @SerializedName("TF")
TF("TF"), @SerializedName("TG")
TG("TG"), @SerializedName("TH")
TH("TH"), @SerializedName("TJ")
TJ("TJ"), @SerializedName("TK")
TK("TK"), @SerializedName("TL")
TL("TL"), @SerializedName("TM")
TM("TM"), @SerializedName("TN")
TN("TN"), @SerializedName("TO")
TO("TO"), @SerializedName("TR")
TR("TR"), @SerializedName("TT")
TT("TT"), @SerializedName("TV")
TV("TV"), @SerializedName("TW")
TW("TW"), @SerializedName("TZ")
TZ("TZ"), @SerializedName("UA")
UA("UA"), @SerializedName("UG")
UG("UG"), @SerializedName("US")
US("US"), @SerializedName("UY")
UY("UY"), @SerializedName("UZ")
UZ("UZ"), @SerializedName("VA")
VA("VA"), @SerializedName("VC")
VC("VC"), @SerializedName("VE")
VE("VE"), @SerializedName("VG")
VG("VG"), @SerializedName("VN")
VN("VN"), @SerializedName("VU")
VU("VU"), @SerializedName("WF")
WF("WF"), @SerializedName("WS")
WS("WS"), @SerializedName("XK")
XK("XK"), @SerializedName("YE")
YE("YE"), @SerializedName("YT")
YT("YT"), @SerializedName("ZA")
ZA("ZA"), @SerializedName("ZM")
ZM("ZM"), @SerializedName("ZW")
ZW("ZW"), @SerializedName("ZZ")
ZZ("ZZ");
private final String value;
AllowedCountry(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
/**
* An array of two-letter ISO country codes representing which countries Checkout should provide
* as options for shipping locations. Unsupported country codes: {@code AS, CX, CC, CU, HM, IR,
* KP, MH, FM, NF, MP, PW, SD, SY, UM, VI}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getAllowedCountries() {
return this.allowedCountries;
}
/**
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
}
public static class SubscriptionData {
/**
* A non-negative decimal between 0 and 100, with at most two decimal places. This represents
* the percentage of the subscription invoice subtotal that will be transferred to the
* application owner's Stripe account. To use an application fee percent, the request must be
* made on behalf of another account, using the {@code Stripe-Account} header or an OAuth key.
* For more information, see the application fees documentation.
*/
@SerializedName("application_fee_percent")
BigDecimal applicationFeePercent;
/**
* The ID of the coupon to apply to this subscription. A coupon applied to a subscription will
* only affect invoices created for that particular subscription.
*/
@SerializedName("coupon")
String coupon;
/**
* The tax rates that will apply to any subscription item that does not have {@code tax_rates}
* set. Invoices created will have their {@code default_tax_rates} populated from the
* subscription.
*/
@SerializedName("default_tax_rates")
List defaultTaxRates;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* A list of items, each with an attached plan, that the customer is subscribing to. Prefer
* using {@code line_items}.
*/
@SerializedName("items")
List- items;
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format. Individual keys can be unset by posting an empty value to them. All keys
* can be unset by posting an empty value to {@code metadata}.
*/
@SerializedName("metadata")
Map
metadata;
/**
* Unix timestamp representing the end of the trial period the customer will get before being
* charged for the first time. Has to be at least 48 hours in the future.
*/
@SerializedName("trial_end")
Long trialEnd;
/**
* Indicates if a plan’s {@code trial_period_days} should be applied to the subscription.
* Setting {@code trial_end} on {@code subscription_data} is preferred. Defaults to {@code
* false}.
*/
@SerializedName("trial_from_plan")
Boolean trialFromPlan;
/**
* Integer representing the number of trial period days before the customer is charged for the
* first time. Has to be at least 1.
*/
@SerializedName("trial_period_days")
Long trialPeriodDays;
private SubscriptionData(BigDecimal applicationFeePercent, String coupon, List defaultTaxRates, Map extraParams, List- items, Map
metadata, Long trialEnd, Boolean trialFromPlan, Long trialPeriodDays) {
this.applicationFeePercent = applicationFeePercent;
this.coupon = coupon;
this.defaultTaxRates = defaultTaxRates;
this.extraParams = extraParams;
this.items = items;
this.metadata = metadata;
this.trialEnd = trialEnd;
this.trialFromPlan = trialFromPlan;
this.trialPeriodDays = trialPeriodDays;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private BigDecimal applicationFeePercent;
private String coupon;
private List defaultTaxRates;
private Map extraParams;
private List- items;
private Map
metadata;
private Long trialEnd;
private Boolean trialFromPlan;
private Long trialPeriodDays;
/**
* Finalize and obtain parameter instance from this builder.
*/
public SubscriptionData build() {
return new SubscriptionData(this.applicationFeePercent, this.coupon, this.defaultTaxRates, this.extraParams, this.items, this.metadata, this.trialEnd, this.trialFromPlan, this.trialPeriodDays);
}
/**
* A non-negative decimal between 0 and 100, with at most two decimal places. This represents
* the percentage of the subscription invoice subtotal that will be transferred to the
* application owner's Stripe account. To use an application fee percent, the request must be
* made on behalf of another account, using the {@code Stripe-Account} header or an OAuth key.
* For more information, see the application fees documentation.
*/
public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) {
this.applicationFeePercent = applicationFeePercent;
return this;
}
/**
* The ID of the coupon to apply to this subscription. A coupon applied to a subscription will
* only affect invoices created for that particular subscription.
*/
public Builder setCoupon(String coupon) {
this.coupon = coupon;
return this;
}
/**
* Add an element to `defaultTaxRates` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.SubscriptionData#defaultTaxRates} for the field documentation.
*/
public Builder addDefaultTaxRate(String element) {
if (this.defaultTaxRates == null) {
this.defaultTaxRates = new ArrayList<>();
}
this.defaultTaxRates.add(element);
return this;
}
/**
* Add all elements to `defaultTaxRates` list. A list is initialized for the first
* `add/addAll` call, and subsequent calls adds additional elements to the original list. See
* {@link SessionCreateParams.SubscriptionData#defaultTaxRates} for the field documentation.
*/
public Builder addAllDefaultTaxRate(List elements) {
if (this.defaultTaxRates == null) {
this.defaultTaxRates = new ArrayList<>();
}
this.defaultTaxRates.addAll(elements);
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SessionCreateParams.SubscriptionData#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SessionCreateParams.SubscriptionData#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Add an element to `items` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.SubscriptionData#items} for the field documentation.
*/
public Builder addItem(Item element) {
if (this.items == null) {
this.items = new ArrayList<>();
}
this.items.add(element);
return this;
}
/**
* Add all elements to `items` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.SubscriptionData#items} for the field documentation.
*/
public Builder addAllItem(List- elements) {
if (this.items == null) {
this.items = new ArrayList<>();
}
this.items.addAll(elements);
return this;
}
/**
* Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SessionCreateParams.SubscriptionData#metadata} for the field documentation.
*/
public Builder putMetadata(String key, String value) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `metadata` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SessionCreateParams.SubscriptionData#metadata} for the field documentation.
*/
public Builder putAllMetadata(Map
map) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.putAll(map);
return this;
}
/**
* Unix timestamp representing the end of the trial period the customer will get before being
* charged for the first time. Has to be at least 48 hours in the future.
*/
public Builder setTrialEnd(Long trialEnd) {
this.trialEnd = trialEnd;
return this;
}
/**
* Indicates if a plan’s {@code trial_period_days} should be applied to the subscription.
* Setting {@code trial_end} on {@code subscription_data} is preferred. Defaults to {@code
* false}.
*/
public Builder setTrialFromPlan(Boolean trialFromPlan) {
this.trialFromPlan = trialFromPlan;
return this;
}
/**
* Integer representing the number of trial period days before the customer is charged for the
* first time. Has to be at least 1.
*/
public Builder setTrialPeriodDays(Long trialPeriodDays) {
this.trialPeriodDays = trialPeriodDays;
return this;
}
}
public static class Item {
/**
* 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;
/** Plan ID for this item. */
@SerializedName("plan")
String plan;
/** Quantity for this item. */
@SerializedName("quantity")
Long quantity;
/**
* The tax rates which apply to this item. When set, the {@code default_tax_rates} on {@code
* subscription_data} do not apply to this item.
*/
@SerializedName("tax_rates")
List taxRates;
private Item(Map extraParams, String plan, Long quantity, List taxRates) {
this.extraParams = extraParams;
this.plan = plan;
this.quantity = quantity;
this.taxRates = taxRates;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private String plan;
private Long quantity;
private List taxRates;
/** Finalize and obtain parameter instance from this builder. */
public Item build() {
return new Item(this.extraParams, this.plan, this.quantity, this.taxRates);
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.SubscriptionData.Item#extraParams} for the field
* documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SessionCreateParams.SubscriptionData.Item#extraParams} for the field
* documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Plan ID for this item. */
public Builder setPlan(String plan) {
this.plan = plan;
return this;
}
/** Quantity for this item. */
public Builder setQuantity(Long quantity) {
this.quantity = quantity;
return this;
}
/**
* Add an element to `taxRates` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.SubscriptionData.Item#taxRates} for the field documentation.
*/
public Builder addTaxRate(String element) {
if (this.taxRates == null) {
this.taxRates = new ArrayList<>();
}
this.taxRates.add(element);
return this;
}
public Builder addAllTaxRate(List elements) {
if (this.taxRates == null) {
this.taxRates = new ArrayList<>();
}
this.taxRates.addAll(elements);
return this;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getPlan() {
return this.plan;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getQuantity() {
return this.quantity;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getTaxRates() {
return this.taxRates;
}
}
/**
* A non-negative decimal between 0 and 100, with at most two decimal places. This represents
* the percentage of the subscription invoice subtotal that will be transferred to the
* application owner's Stripe account. To use an application fee percent, the request must be
* made on behalf of another account, using the {@code Stripe-Account} header or an OAuth key.
* For more information, see the application fees documentation.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public BigDecimal getApplicationFeePercent() {
return this.applicationFeePercent;
}
/**
* The ID of the coupon to apply to this subscription. A coupon applied to a subscription will
* only affect invoices created for that particular subscription.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCoupon() {
return this.coupon;
}
/**
* The tax rates that will apply to any subscription item that does not have {@code tax_rates}
* set. Invoices created will have their {@code default_tax_rates} populated from the
* subscription.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getDefaultTaxRates() {
return this.defaultTaxRates;
}
/**
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* A list of items, each with an attached plan, that the customer is subscribing to. Prefer
* using {@code line_items}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List- getItems() {
return this.items;
}
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format. Individual keys can be unset by posting an empty value to them. All keys
* can be unset by posting an empty value to {@code metadata}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map
getMetadata() {
return this.metadata;
}
/**
* Unix timestamp representing the end of the trial period the customer will get before being
* charged for the first time. Has to be at least 48 hours in the future.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getTrialEnd() {
return this.trialEnd;
}
/**
* Indicates if a plan’s {@code trial_period_days} should be applied to the subscription.
* Setting {@code trial_end} on {@code subscription_data} is preferred. Defaults to {@code
* false}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getTrialFromPlan() {
return this.trialFromPlan;
}
/**
* Integer representing the number of trial period days before the customer is charged for the
* first time. Has to be at least 1.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getTrialPeriodDays() {
return this.trialPeriodDays;
}
}
/**
* Add all elements to `taxRates` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.SubscriptionData.Item#taxRates} for the field documentation.
*/
public enum BillingAddressCollection implements ApiRequestParams.EnumParam {
@SerializedName("auto")
AUTO("auto"), @SerializedName("required")
REQUIRED("required");
private final String value;
BillingAddressCollection(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
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("en-GB")
EN_GB("en-GB"), @SerializedName("es")
ES("es"), @SerializedName("es-419")
ES_419("es-419"), @SerializedName("et")
ET("et"), @SerializedName("fi")
FI("fi"), @SerializedName("fr")
FR("fr"), @SerializedName("fr-CA")
FR_CA("fr-CA"), @SerializedName("hu")
HU("hu"), @SerializedName("id")
ID("id"), @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"), @SerializedName("nl")
NL("nl"), @SerializedName("pl")
PL("pl"), @SerializedName("pt")
PT("pt"), @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"), @SerializedName("zh-HK")
ZH_HK("zh-HK"), @SerializedName("zh-TW")
ZH_TW("zh-TW");
private final String value;
Locale(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum Mode implements ApiRequestParams.EnumParam {
@SerializedName("payment")
PAYMENT("payment"), @SerializedName("setup")
SETUP("setup"), @SerializedName("subscription")
SUBSCRIPTION("subscription");
private final String value;
Mode(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum PaymentMethodType implements ApiRequestParams.EnumParam {
@SerializedName("alipay")
ALIPAY("alipay"), @SerializedName("bacs_debit")
BACS_DEBIT("bacs_debit"), @SerializedName("bancontact")
BANCONTACT("bancontact"), @SerializedName("card")
CARD("card"), @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"), @SerializedName("sofort")
SOFORT("sofort");
private final String value;
PaymentMethodType(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum SubmitType implements ApiRequestParams.EnumParam {
@SerializedName("auto")
AUTO("auto"), @SerializedName("book")
BOOK("book"), @SerializedName("donate")
DONATE("donate"), @SerializedName("pay")
PAY("pay");
private final String value;
SubmitType(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
/**
* Enables user redeemable promotion codes.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getAllowPromotionCodes() {
return this.allowPromotionCodes;
}
/**
* Specify whether Checkout should collect the customer's billing address.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public BillingAddressCollection getBillingAddressCollection() {
return this.billingAddressCollection;
}
/**
* The URL the customer will be directed to if they decide to cancel payment and return to your
* website.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCancelUrl() {
return this.cancelUrl;
}
/**
* A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or
* similar, and can be used to reconcile the session with your internal systems.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getClientReferenceId() {
return this.clientReferenceId;
}
/**
* ID of an existing customer, if one exists. The email stored on the customer will be used to
* prefill the email field on the Checkout page. If the customer changes their email on the
* Checkout page, the Customer object will be updated with the new email. If blank for Checkout
* Sessions in {@code payment} or {@code subscription} mode, Checkout will create a new customer
* object based on information provided during the session.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCustomer() {
return this.customer;
}
/**
* If provided, this value will be used when the Customer object is created. If not provided,
* customers will be asked to enter their email address. Use this parameter to prefill customer
* data if you already have an email on file. To access information about the customer once a
* session is complete, use the {@code customer} field.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCustomerEmail() {
return this.customerEmail;
}
/**
* The coupon or promotion code to apply to this session. Currently, only up to one may be
* specified.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getDiscounts() {
return this.discounts;
}
/**
* Specifies which fields in the response should be expanded.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getExpand() {
return this.expand;
}
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* A list of items the customer is purchasing. Use this parameter to pass one-time or recurring 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getLineItems() {
return this.lineItems;
}
/**
* The IETF language tag of the locale Checkout is displayed in. If blank or {@code auto}, the
* browser's locale is used.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Locale getLocale() {
return this.locale;
}
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format. Individual keys can be unset by posting an empty value to them. All keys can
* be unset by posting an empty value to {@code metadata}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getMetadata() {
return this.metadata;
}
/**
* The mode of the Checkout Session. Required when using prices or {@code setup} mode. Pass {@code
* subscription} if Checkout session includes at least one recurring item.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Mode getMode() {
return this.mode;
}
/**
* A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code
* payment} mode.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public PaymentIntentData getPaymentIntentData() {
return this.paymentIntentData;
}
/**
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getPaymentMethodTypes() {
return this.paymentMethodTypes;
}
/**
* A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in {@code
* setup} mode.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public SetupIntentData getSetupIntentData() {
return this.setupIntentData;
}
/**
* When set, provides configuration for Checkout to collect a shipping address from a customer.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public ShippingAddressCollection getShippingAddressCollection() {
return this.shippingAddressCollection;
}
/**
* Describes the type of transaction being performed by Checkout in order to customize relevant
* text on the page, such as the submit button. {@code submit_type} can only be specified on
* Checkout Sessions in {@code payment} mode, but not Checkout Sessions in {@code subscription} or
* {@code setup} mode.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public SubmitType getSubmitType() {
return this.submitType;
}
/**
* A subset of parameters to be passed to subscription creation for Checkout Sessions in {@code
* subscription} mode.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public SubscriptionData getSubscriptionData() {
return this.subscriptionData;
}
/**
* The URL to which Stripe should send customers when payment or setup is complete. If you’d like
* access to the Checkout Session for the successful payment, read more about it in the guide on
* fulfilling orders.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getSuccessUrl() {
return this.successUrl;
}
}