diff --git a/src/main/java/com/stripe/model/reporting/ReportRun.java b/src/main/java/com/stripe/model/reporting/ReportRun.java index 9855fc04ec6..f6235a838f9 100644 --- a/src/main/java/com/stripe/model/reporting/ReportRun.java +++ b/src/main/java/com/stripe/model/reporting/ReportRun.java @@ -38,7 +38,10 @@ public class ReportRun extends ApiResource implements HasId { @SerializedName("id") String id; - /** Always {@code true}: reports can only be run on live-mode data. */ + /** + * {@code true} if the report is run on live mode data and {@code false} if it is run on test mode + * data. + */ @SerializedName("livemode") Boolean livemode; @@ -83,27 +86,18 @@ public class ReportRun extends ApiResource implements HasId { @SerializedName("succeeded_at") Long succeededAt; - /** - * Retrieves the details of an existing Report Run. (Requires a live-mode API key.) - */ + /** Retrieves the details of an existing Report Run. */ public static ReportRun retrieve(String reportRun) throws StripeException { return retrieve(reportRun, (Map) null, (RequestOptions) null); } - /** - * Retrieves the details of an existing Report Run. (Requires a live-mode API key.) - */ + /** Retrieves the details of an existing Report Run. */ public static ReportRun retrieve(String reportRun, RequestOptions options) throws StripeException { return retrieve(reportRun, (Map) null, options); } - /** - * Retrieves the details of an existing Report Run. (Requires a live-mode API key.) - */ + /** Retrieves the details of an existing Report Run. */ public static ReportRun retrieve( String reportRun, Map params, RequestOptions options) throws StripeException { String url = @@ -115,10 +109,7 @@ public static ReportRun retrieve( ApiResource.RequestMethod.GET, url, params, ReportRun.class, options); } - /** - * Retrieves the details of an existing Report Run. (Requires a live-mode API key.) - */ + /** Retrieves the details of an existing Report Run. */ public static ReportRun retrieve( String reportRun, ReportRunRetrieveParams params, RequestOptions options) throws StripeException { @@ -132,7 +123,7 @@ public static ReportRun retrieve( } /** - * Creates a new object and begin running the report. (Requires a live-mode API key.) */ public static ReportRun create(Map params) throws StripeException { @@ -140,7 +131,7 @@ public static ReportRun create(Map params) throws StripeExceptio } /** - * Creates a new object and begin running the report. (Requires a live-mode API key.) */ public static ReportRun create(Map params, RequestOptions options) @@ -151,7 +142,7 @@ public static ReportRun create(Map params, RequestOptions option } /** - * Creates a new object and begin running the report. (Requires a live-mode API key.) */ public static ReportRun create(ReportRunCreateParams params) throws StripeException { @@ -159,7 +150,7 @@ public static ReportRun create(ReportRunCreateParams params) throws StripeExcept } /** - * Creates a new object and begin running the report. (Requires a live-mode API key.) */ public static ReportRun create(ReportRunCreateParams params, RequestOptions options) @@ -169,36 +160,24 @@ public static ReportRun create(ReportRunCreateParams params, RequestOptions opti ApiResource.RequestMethod.POST, url, params, ReportRun.class, options); } - /** - * Returns a list of Report Runs, with the most recent appearing first. (Requires a live-mode API key.) - */ + /** Returns a list of Report Runs, with the most recent appearing first. */ public static ReportRunCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); } - /** - * Returns a list of Report Runs, with the most recent appearing first. (Requires a live-mode API key.) - */ + /** Returns a list of Report Runs, with the most recent appearing first. */ public static ReportRunCollection list(Map params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/reporting/report_runs"); return ApiResource.requestCollection(url, params, ReportRunCollection.class, options); } - /** - * Returns a list of Report Runs, with the most recent appearing first. (Requires a live-mode API key.) - */ + /** Returns a list of Report Runs, with the most recent appearing first. */ public static ReportRunCollection list(ReportRunListParams params) throws StripeException { return list(params, (RequestOptions) null); } - /** - * Returns a list of Report Runs, with the most recent appearing first. (Requires a live-mode API key.) - */ + /** Returns a list of Report Runs, with the most recent appearing first. */ public static ReportRunCollection list(ReportRunListParams params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/reporting/report_runs"); diff --git a/src/main/java/com/stripe/model/reporting/ReportType.java b/src/main/java/com/stripe/model/reporting/ReportType.java index 3284e026945..b29999e69b8 100644 --- a/src/main/java/com/stripe/model/reporting/ReportType.java +++ b/src/main/java/com/stripe/model/reporting/ReportType.java @@ -72,7 +72,7 @@ public class ReportType extends ApiResource implements HasId { Long version; /** - * Retrieves the details of a Report Type. (Requires a live-mode API key.) */ public static ReportType retrieve(String reportType) throws StripeException { @@ -80,7 +80,7 @@ public static ReportType retrieve(String reportType) throws StripeException { } /** - * Retrieves the details of a Report Type. (Requires a live-mode API key.) */ public static ReportType retrieve(String reportType, RequestOptions options) @@ -89,7 +89,7 @@ public static ReportType retrieve(String reportType, RequestOptions options) } /** - * Retrieves the details of a Report Type. (Requires a live-mode API key.) */ public static ReportType retrieve( @@ -105,7 +105,7 @@ public static ReportType retrieve( } /** - * Retrieves the details of a Report Type. (Requires a live-mode API key.) */ public static ReportType retrieve( @@ -120,36 +120,24 @@ public static ReportType retrieve( ApiResource.RequestMethod.GET, url, params, ReportType.class, options); } - /** - * Returns a full list of Report Types. (Requires a live-mode API key.) - */ + /** Returns a full list of Report Types. */ public static ReportTypeCollection list(Map params) throws StripeException { return list(params, (RequestOptions) null); } - /** - * Returns a full list of Report Types. (Requires a live-mode API key.) - */ + /** Returns a full list of Report Types. */ public static ReportTypeCollection list(Map params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/reporting/report_types"); return ApiResource.requestCollection(url, params, ReportTypeCollection.class, options); } - /** - * Returns a full list of Report Types. (Requires a live-mode API key.) - */ + /** Returns a full list of Report Types. */ public static ReportTypeCollection list(ReportTypeListParams params) throws StripeException { return list(params, (RequestOptions) null); } - /** - * Returns a full list of Report Types. (Requires a live-mode API key.) - */ + /** Returns a full list of Report Types. */ public static ReportTypeCollection list(ReportTypeListParams params, RequestOptions options) throws StripeException { String url = String.format("%s%s", Stripe.getApiBase(), "/v1/reporting/report_types"); diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index 94eefdf92c0..51ca4dc2022 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -15,7 +15,7 @@ public class SubscriptionCreateParams extends ApiRequestParams { /** * A list of prices and quantities that will generate invoice items appended to the first invoice - * for this subscription. You may pass up to 10 items. + * for this subscription. You may pass up to 20 items. */ @SerializedName("add_invoice_items") List addInvoiceItems; diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java index 476d7d9116b..7da0e6b1cf5 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java @@ -861,7 +861,7 @@ public enum CollectionMethod implements ApiRequestParams.EnumParam { public static class Phase { /** * A list of prices and quantities that will generate invoice items appended to the next - * invoice. You may pass up to 10 items. + * invoice. You may pass up to 20 items. */ @SerializedName("add_invoice_items") List addInvoiceItems; diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java index 6ecae016406..9c4453300c7 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java @@ -826,7 +826,7 @@ public enum CollectionMethod implements ApiRequestParams.EnumParam { public static class Phase { /** * A list of prices and quantities that will generate invoice items appended to the next - * invoice. You may pass up to 10 items. + * invoice. You may pass up to 20 items. */ @SerializedName("add_invoice_items") List addInvoiceItems; diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index 0de49135d34..6ed3699eeee 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -15,7 +15,7 @@ public class SubscriptionUpdateParams extends ApiRequestParams { /** * A list of prices and quantities that will generate invoice items appended to the first invoice - * for this subscription. You may pass up to 10 items. + * for this subscription. You may pass up to 20 items. */ @SerializedName("add_invoice_items") List 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 {