addInvoiceItems;
diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java
index c78dcca2db8..097e4ff7c01 100644
--- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java
+++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java
@@ -75,11 +75,14 @@ public class SessionCreateParams extends ApiRequestParams {
/**
* 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.
+ * href="https://stripe.com/docs/api/prices">Prices.
*
- * There is a maximum of 100 line items, however it is recommended to consolidate line items if
- * there are more than a few dozen.
+ *
For {@code payment} mode, there is a maximum of 100 line items, however it is recommended to
+ * consolidate line items if there are more than a few dozen.
+ *
+ *
For {@code subscription} mode, there is a maximum of 20 line items with recurring Prices and
+ * 20 line items with one-time Prices. Line items with one-time Prices in will be on the initial
+ * invoice only.
*/
@SerializedName("line_items")
List lineItems;
@@ -1681,8 +1684,9 @@ public static class PaymentIntentData {
String receiptEmail;
/**
- * Indicates that you intend to make future payments with the payment method collected by this
- * Checkout Session.
+ * Indicates that you intend to make future payments
+ * with the payment method collected by this Checkout Session.
*
* When setting this to {@code on_session}, Checkout will show a notice to the customer that
* their payment details will be saved.
@@ -1914,8 +1918,9 @@ public Builder setReceiptEmail(String receiptEmail) {
}
/**
- * Indicates that you intend to make future payments with the payment method collected by this
- * Checkout Session.
+ * Indicates that you intend to make future
+ * payments with the payment method collected by this Checkout Session.
*
*
When setting this to {@code on_session}, Checkout will show a notice to the customer
* that their payment details will be saved.
@@ -3397,6 +3402,13 @@ public static class SubscriptionData {
@SerializedName("metadata")
Map metadata;
+ /**
+ * If specified, the funds from the subscription's invoices will be transferred to the
+ * destination and the ID of the resulting transfers will be found on the resulting charges.
+ */
+ @SerializedName("transfer_data")
+ TransferData transferData;
+
/**
* 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.
@@ -3426,6 +3438,7 @@ private SubscriptionData(
Map extraParams,
List- items,
Map metadata,
+ TransferData transferData,
Long trialEnd,
Boolean trialFromPlan,
Long trialPeriodDays) {
@@ -3435,6 +3448,7 @@ private SubscriptionData(
this.extraParams = extraParams;
this.items = items;
this.metadata = metadata;
+ this.transferData = transferData;
this.trialEnd = trialEnd;
this.trialFromPlan = trialFromPlan;
this.trialPeriodDays = trialPeriodDays;
@@ -3457,6 +3471,8 @@ public static class Builder {
private Map metadata;
+ private TransferData transferData;
+
private Long trialEnd;
private Boolean trialFromPlan;
@@ -3472,6 +3488,7 @@ public SubscriptionData build() {
this.extraParams,
this.items,
this.metadata,
+ this.transferData,
this.trialEnd,
this.trialFromPlan,
this.trialPeriodDays);
@@ -3603,6 +3620,15 @@ public Builder putAllMetadata(Map map) {
return this;
}
+ /**
+ * If specified, the funds from the subscription's invoices will be transferred to the
+ * destination and the ID of the resulting transfers will be found on the resulting charges.
+ */
+ public Builder setTransferData(TransferData transferData) {
+ this.transferData = transferData;
+ 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.
@@ -3757,6 +3783,99 @@ public Builder addAllTaxRate(List elements) {
}
}
}
+
+ @Getter
+ public static class TransferData {
+ /**
+ * 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
+ * destination account. By default, the entire amount is transferred to the destination.
+ */
+ @SerializedName("amount_percent")
+ BigDecimal amountPercent;
+
+ /** ID of an existing, connected Stripe account. */
+ @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(
+ BigDecimal amountPercent, String destination, Map extraParams) {
+ this.amountPercent = amountPercent;
+ this.destination = destination;
+ this.extraParams = extraParams;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private BigDecimal amountPercent;
+
+ private String destination;
+
+ private Map extraParams;
+
+ /** Finalize and obtain parameter instance from this builder. */
+ public TransferData build() {
+ return new TransferData(this.amountPercent, this.destination, this.extraParams);
+ }
+
+ /**
+ * 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 destination account. By default, the entire amount is transferred to the
+ * destination.
+ */
+ public Builder setAmountPercent(BigDecimal amountPercent) {
+ this.amountPercent = amountPercent;
+ return this;
+ }
+
+ /** ID of an existing, connected Stripe account. */
+ 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.SubscriptionData.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;
+ }
+
+ /**
+ * 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.TransferData#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 BillingAddressCollection implements ApiRequestParams.EnumParam {