From 7951d698636b0809385ede72b603c1a003a5cadb Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 15:08:53 -0700 Subject: [PATCH] Update generated code (#1606) * Update generated code for v409 * Update generated code for v412 * Update generated code for v413 * Update generated code for v415 * Update generated code for v416 * Update generated code for v417 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Charge.java | 4 + .../stripe/model/EventDataClassLookup.java | 1 + .../java/com/stripe/model/PaymentIntent.java | 14 + .../java/com/stripe/model/SetupIntent.java | 14 + .../java/com/stripe/model/StripeError.java | 12 +- .../com/stripe/model/tax/Calculation.java | 12 +- .../stripe/model/tax/CalculationLineItem.java | 7 +- .../java/com/stripe/model/tax/Settings.java | 185 +++++++ .../com/stripe/model/tax/Transaction.java | 8 +- .../stripe/model/tax/TransactionLineItem.java | 4 + .../param/PaymentIntentCreateParams.java | 50 +- .../stripe/param/SetupIntentCreateParams.java | 51 +- .../param/WebhookEndpointCreateParams.java | 3 + .../param/WebhookEndpointUpdateParams.java | 3 + .../param/tax/SettingsRetrieveParams.java | 98 ++++ .../param/tax/SettingsUpdateParams.java | 517 ++++++++++++++++++ .../stripe/functional/GeneratedExamples.java | 134 +++++ 18 files changed, 1096 insertions(+), 23 deletions(-) create mode 100644 src/main/java/com/stripe/model/tax/Settings.java create mode 100644 src/main/java/com/stripe/param/tax/SettingsRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/tax/SettingsUpdateParams.java diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index a0b891b03c7..bfd5e01b8b7 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v408 \ No newline at end of file +v417 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 6cf00356f89..a221d3e97bb 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -1359,6 +1359,10 @@ public static class Affirm extends StripeObject {} @Setter @EqualsAndHashCode(callSuper = false) public static class AfterpayClearpay extends StripeObject { + /** The Afterpay order ID associated with this payment intent. */ + @SerializedName("order_id") + String orderId; + /** Order identifier shown to the merchant in Afterpay’s online portal. */ @SerializedName("reference") String reference; diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index 6751c366e09..49970d40b60 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -123,6 +123,7 @@ final class EventDataClassLookup { classLookup.put("tax.calculation", com.stripe.model.tax.Calculation.class); classLookup.put("tax.calculation_line_item", com.stripe.model.tax.CalculationLineItem.class); + classLookup.put("tax.settings", com.stripe.model.tax.Settings.class); classLookup.put("tax.transaction", com.stripe.model.tax.Transaction.class); classLookup.put("tax.transaction_line_item", com.stripe.model.tax.TransactionLineItem.class); diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 727992454e8..6b1fe3d244f 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -1424,6 +1424,20 @@ public static class Tip extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class AutomaticPaymentMethods extends StripeObject { + /** + * Controls whether this PaymentIntent will accept redirect-based payment methods. + * + *

Redirect-based payment methods may require your customer to be redirected to a payment + * method's app or site for authentication or additional steps. To confirm this PaymentIntent, + * you may be required to provide a {@code return_url} to redirect customers back to your site + * after they authenticate or complete the payment. + * + *

One of {@code always}, or {@code never}. + */ + @SerializedName("allow_redirects") + String allowRedirects; + /** Automatically calculates compatible payment methods. */ @SerializedName("enabled") Boolean enabled; diff --git a/src/main/java/com/stripe/model/SetupIntent.java b/src/main/java/com/stripe/model/SetupIntent.java index c76e2406c52..a469957b4e7 100644 --- a/src/main/java/com/stripe/model/SetupIntent.java +++ b/src/main/java/com/stripe/model/SetupIntent.java @@ -776,6 +776,20 @@ public SetupIntent verifyMicrodeposits( @Setter @EqualsAndHashCode(callSuper = false) public static class AutomaticPaymentMethods extends StripeObject { + /** + * Controls whether this SetupIntent will accept redirect-based payment methods. + * + *

Redirect-based payment methods may require your customer to be redirected to a payment + * method's app or site for authentication or additional steps. To confirm this SetupIntent, you + * may be required to provide a {@code return_url} to redirect customers back to your site after + * they authenticate or complete the setup. + * + *

One of {@code always}, or {@code never}. + */ + @SerializedName("allow_redirects") + String allowRedirects; + /** Automatically calculates compatible payment methods. */ @SerializedName("enabled") Boolean enabled; diff --git a/src/main/java/com/stripe/model/StripeError.java b/src/main/java/com/stripe/model/StripeError.java index 812154130ec..4b244048da1 100644 --- a/src/main/java/com/stripe/model/StripeError.java +++ b/src/main/java/com/stripe/model/StripeError.java @@ -42,12 +42,12 @@ public class StripeError extends StripeObject { * insufficient_funds}, {@code intent_invalid_state}, {@code intent_verification_method_missing}, * {@code invalid_card_type}, {@code invalid_characters}, {@code invalid_charge_amount}, {@code * invalid_cvc}, {@code invalid_expiry_month}, {@code invalid_expiry_year}, {@code - * invalid_number}, {@code invalid_source_usage}, {@code invoice_no_customer_line_items}, {@code - * invoice_no_payment_method_types}, {@code invoice_no_subscription_line_items}, {@code - * invoice_not_editable}, {@code invoice_on_behalf_of_not_editable}, {@code - * invoice_payment_intent_requires_action}, {@code invoice_upcoming_none}, {@code - * livemode_mismatch}, {@code lock_timeout}, {@code missing}, {@code no_account}, {@code - * not_allowed_on_standard_account}, {@code out_of_inventory}, {@code + * invalid_number}, {@code invalid_source_usage}, {@code invalid_tax_location}, {@code + * invoice_no_customer_line_items}, {@code invoice_no_payment_method_types}, {@code + * invoice_no_subscription_line_items}, {@code invoice_not_editable}, {@code + * invoice_on_behalf_of_not_editable}, {@code invoice_payment_intent_requires_action}, {@code + * invoice_upcoming_none}, {@code livemode_mismatch}, {@code lock_timeout}, {@code missing}, + * {@code no_account}, {@code not_allowed_on_standard_account}, {@code out_of_inventory}, {@code * ownership_declaration_not_allowed}, {@code parameter_invalid_empty}, {@code * parameter_invalid_integer}, {@code parameter_invalid_string_blank}, {@code * parameter_invalid_string_empty}, {@code parameter_missing}, {@code parameter_unknown}, {@code diff --git a/src/main/java/com/stripe/model/tax/Calculation.java b/src/main/java/com/stripe/model/tax/Calculation.java index 1009833dd11..49bdfe4778c 100644 --- a/src/main/java/com/stripe/model/tax/Calculation.java +++ b/src/main/java/com/stripe/model/tax/Calculation.java @@ -274,7 +274,7 @@ public static class ShippingCost extends StripeObject { /** * The ID of an existing ShippingRate. + * href="https://stripe.com/docs/api/shipping_rates/object">ShippingRate. */ @SerializedName("shipping_rate") String shippingRate; @@ -395,8 +395,9 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

One of {@code gst}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code - * pst}, {@code qst}, {@code rst}, {@code sales_tax}, or {@code vat}. + *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, + * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code rst}, + * {@code sales_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; @@ -458,8 +459,9 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

One of {@code gst}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code - * pst}, {@code qst}, {@code rst}, {@code sales_tax}, or {@code vat}. + *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, + * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code rst}, {@code + * sales_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/CalculationLineItem.java b/src/main/java/com/stripe/model/tax/CalculationLineItem.java index 5a75389dedb..24965684b0b 100644 --- a/src/main/java/com/stripe/model/tax/CalculationLineItem.java +++ b/src/main/java/com/stripe/model/tax/CalculationLineItem.java @@ -44,7 +44,7 @@ public class CalculationLineItem extends StripeObject implements HasId { @SerializedName("object") String object; - /** A Product ID. */ + /** The ID of an existing Product. */ @SerializedName("product") String product; @@ -175,8 +175,9 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

One of {@code gst}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code - * pst}, {@code qst}, {@code rst}, {@code sales_tax}, or {@code vat}. + *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, + * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code rst}, {@code + * sales_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/Settings.java b/src/main/java/com/stripe/model/tax/Settings.java new file mode 100644 index 00000000000..8e052edf12b --- /dev/null +++ b/src/main/java/com/stripe/model/tax/Settings.java @@ -0,0 +1,185 @@ +// File generated from our OpenAPI spec +package com.stripe.model.tax; + +import com.google.gson.annotations.SerializedName; +import com.stripe.Stripe; +import com.stripe.exception.StripeException; +import com.stripe.model.Address; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiResource; +import com.stripe.net.RequestOptions; +import com.stripe.param.tax.SettingsRetrieveParams; +import com.stripe.param.tax.SettingsUpdateParams; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * You can use Tax {@code Settings} to manage configurations used by Stripe Tax calculations. + * + *

Related guide: Using the Settings API + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Settings extends ApiResource { + @SerializedName("defaults") + Defaults defaults; + + /** The place where your business is located. */ + @SerializedName("head_office") + HeadOffice headOffice; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code tax.settings}. + */ + @SerializedName("object") + String object; + + /** + * The {@code active} status indicates you have all required settings to calculate tax. A status + * can transition out of {@code active} when new required settings are introduced. + * + *

One of {@code active}, or {@code pending}. + */ + @SerializedName("status") + String status; + + @SerializedName("status_details") + StatusDetails statusDetails; + + /** Retrieves Tax {@code Settings} for a merchant. */ + public static Settings retrieve() throws StripeException { + return retrieve((Map) null, (RequestOptions) null); + } + + /** Retrieves Tax {@code Settings} for a merchant. */ + public static Settings retrieve(RequestOptions options) throws StripeException { + return retrieve((Map) null, options); + } + + /** Retrieves Tax {@code Settings} for a merchant. */ + public static Settings retrieve(Map params, RequestOptions options) + throws StripeException { + String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings"); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Settings.class, options); + } + + /** Retrieves Tax {@code Settings} for a merchant. */ + public static Settings retrieve(SettingsRetrieveParams params, RequestOptions options) + throws StripeException { + String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings"); + return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Settings.class, options); + } + + /** + * Updates Tax {@code Settings} parameters used in tax calculations. All parameters are editable + * but none can be removed once set. + */ + public static Settings update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates Tax {@code Settings} parameters used in tax calculations. All parameters are editable + * but none can be removed once set. + */ + public static Settings update(Map params, RequestOptions options) + throws StripeException { + String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, Settings.class, options); + } + + /** + * Updates Tax {@code Settings} parameters used in tax calculations. All parameters are editable + * but none can be removed once set. + */ + public static Settings update(SettingsUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** + * Updates Tax {@code Settings} parameters used in tax calculations. All parameters are editable + * but none can be removed once set. + */ + public static Settings update(SettingsUpdateParams params, RequestOptions options) + throws StripeException { + String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings"); + return ApiResource.request( + ApiResource.RequestMethod.POST, url, params, Settings.class, options); + } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Defaults extends StripeObject { + /** + * Default tax + * behavior used to specify whether the price is considered inclusive of taxes or exclusive + * of taxes. If the item's price has a tax behavior set, it will take precedence over the + * default tax behavior. + * + *

One of {@code exclusive}, {@code inclusive}, or {@code inferred_by_currency}. + */ + @SerializedName("tax_behavior") + String taxBehavior; + + /** + * Default tax code used to classify + * your products and prices. + */ + @SerializedName("tax_code") + String taxCode; + } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class HeadOffice extends StripeObject { + @SerializedName("address") + Address address; + } + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StatusDetails extends StripeObject { + @SerializedName("active") + Active active; + + @SerializedName("pending") + Pending pending; + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Active extends StripeObject {} + + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Pending extends StripeObject { + /** + * The list of missing fields that are required to perform calculations. It includes the entry + * {@code head_office} when the status is {@code pending}. It is recommended to set the + * optional values even if they aren't listed as required for calculating taxes. Calculations + * can fail if missing fields aren't explicitly provided on every call. + */ + @SerializedName("missing_fields") + List missingFields; + } + } +} diff --git a/src/main/java/com/stripe/model/tax/Transaction.java b/src/main/java/com/stripe/model/tax/Transaction.java index d344a4dbd2f..da733ded31e 100644 --- a/src/main/java/com/stripe/model/tax/Transaction.java +++ b/src/main/java/com/stripe/model/tax/Transaction.java @@ -366,8 +366,7 @@ public static class ShippingCost extends StripeObject { /** * The ID of an existing ShippingRate. (It is not - * populated for the transaction resource object and will be removed in the next API version.) + * href="https://stripe.com/docs/api/shipping_rates/object">ShippingRate. */ @SerializedName("shipping_rate") String shippingRate; @@ -491,8 +490,9 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

One of {@code gst}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code - * pst}, {@code qst}, {@code rst}, {@code sales_tax}, or {@code vat}. + *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, + * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code rst}, + * {@code sales_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/TransactionLineItem.java b/src/main/java/com/stripe/model/tax/TransactionLineItem.java index bc80115ce03..c7452e7f05b 100644 --- a/src/main/java/com/stripe/model/tax/TransactionLineItem.java +++ b/src/main/java/com/stripe/model/tax/TransactionLineItem.java @@ -52,6 +52,10 @@ public class TransactionLineItem extends StripeObject implements HasId { @SerializedName("object") String object; + /** The ID of an existing Product. */ + @SerializedName("product") + String product; + /** * The number of units of the item being purchased. For reversals, this is the quantity reversed. */ diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index c7b9ae6af0f..3e931bfb408 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -856,6 +856,18 @@ public Builder setUseStripeSdk(Boolean useStripeSdk) { @Getter public static class AutomaticPaymentMethods { + /** + * Controls whether this PaymentIntent will accept redirect-based payment methods. + * + *

Redirect-based payment methods may require your customer to be redirected to a payment + * method's app or site for authentication or additional steps. To confirm this PaymentIntent, + * you may be required to provide a {@code return_url} to redirect customers back to your site + * after they authenticate or complete the payment. + */ + @SerializedName("allow_redirects") + AllowRedirects allowRedirects; + /** Required. Whether this feature is enabled. */ @SerializedName("enabled") Boolean enabled; @@ -869,7 +881,9 @@ public static class AutomaticPaymentMethods { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private AutomaticPaymentMethods(Boolean enabled, Map extraParams) { + private AutomaticPaymentMethods( + AllowRedirects allowRedirects, Boolean enabled, Map extraParams) { + this.allowRedirects = allowRedirects; this.enabled = enabled; this.extraParams = extraParams; } @@ -879,6 +893,8 @@ public static Builder builder() { } public static class Builder { + private AllowRedirects allowRedirects; + private Boolean enabled; private Map extraParams; @@ -886,7 +902,22 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCreateParams.AutomaticPaymentMethods build() { return new PaymentIntentCreateParams.AutomaticPaymentMethods( - this.enabled, this.extraParams); + this.allowRedirects, this.enabled, this.extraParams); + } + + /** + * Controls whether this PaymentIntent will accept redirect-based payment methods. + * + *

Redirect-based payment methods may require your customer to be redirected to a payment + * method's app or site for authentication or additional steps. To confirm this PaymentIntent, + * you may be required to provide a {@code return_url} to redirect customers back to your site + * after they authenticate or complete the payment. + */ + public Builder setAllowRedirects( + PaymentIntentCreateParams.AutomaticPaymentMethods.AllowRedirects allowRedirects) { + this.allowRedirects = allowRedirects; + return this; } /** Required. Whether this feature is enabled. */ @@ -922,6 +953,21 @@ public Builder putAllExtraParam(Map map) { return this; } } + + public enum AllowRedirects implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AllowRedirects(String value) { + this.value = value; + } + } } @Getter diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index 9b1d0f76c94..8a03dcf12ac 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -502,6 +502,18 @@ public Builder setUsage(SetupIntentCreateParams.Usage usage) { @Getter public static class AutomaticPaymentMethods { + /** + * Controls whether this SetupIntent will accept redirect-based payment methods. + * + *

Redirect-based payment methods may require your customer to be redirected to a payment + * method's app or site for authentication or additional steps. To confirm this SetupIntent, you + * may be required to provide a {@code return_url} to redirect customers back to your site after + * they authenticate or complete the setup. + */ + @SerializedName("allow_redirects") + AllowRedirects allowRedirects; + /** Required. Whether this feature is enabled. */ @SerializedName("enabled") Boolean enabled; @@ -515,7 +527,9 @@ public static class AutomaticPaymentMethods { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private AutomaticPaymentMethods(Boolean enabled, Map extraParams) { + private AutomaticPaymentMethods( + AllowRedirects allowRedirects, Boolean enabled, Map extraParams) { + this.allowRedirects = allowRedirects; this.enabled = enabled; this.extraParams = extraParams; } @@ -525,13 +539,31 @@ public static Builder builder() { } public static class Builder { + private AllowRedirects allowRedirects; + private Boolean enabled; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ public SetupIntentCreateParams.AutomaticPaymentMethods build() { - return new SetupIntentCreateParams.AutomaticPaymentMethods(this.enabled, this.extraParams); + return new SetupIntentCreateParams.AutomaticPaymentMethods( + this.allowRedirects, this.enabled, this.extraParams); + } + + /** + * Controls whether this SetupIntent will accept redirect-based payment methods. + * + *

Redirect-based payment methods may require your customer to be redirected to a payment + * method's app or site for authentication or additional steps. To confirm this SetupIntent, you + * may be required to provide a {@code return_url} to redirect customers back to your site + * after they authenticate or complete the setup. + */ + public Builder setAllowRedirects( + SetupIntentCreateParams.AutomaticPaymentMethods.AllowRedirects allowRedirects) { + this.allowRedirects = allowRedirects; + return this; } /** Required. Whether this feature is enabled. */ @@ -567,6 +599,21 @@ public Builder putAllExtraParam(Map map) { return this; } } + + public enum AllowRedirects implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AllowRedirects(String value) { + this.value = value; + } + } } @Getter diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index 6418922726d..93bbd63222d 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -1114,6 +1114,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("subscription_schedule.updated") SUBSCRIPTION_SCHEDULE__UPDATED("subscription_schedule.updated"), + @SerializedName("tax.settings.updated") + TAX__SETTINGS__UPDATED("tax.settings.updated"), + @SerializedName("tax_rate.created") TAX_RATE__CREATED("tax_rate.created"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index bf30c6c1d64..e02fdb7e963 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -796,6 +796,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("subscription_schedule.updated") SUBSCRIPTION_SCHEDULE__UPDATED("subscription_schedule.updated"), + @SerializedName("tax.settings.updated") + TAX__SETTINGS__UPDATED("tax.settings.updated"), + @SerializedName("tax_rate.created") TAX_RATE__CREATED("tax_rate.created"), diff --git a/src/main/java/com/stripe/param/tax/SettingsRetrieveParams.java b/src/main/java/com/stripe/param/tax/SettingsRetrieveParams.java new file mode 100644 index 00000000000..545e445cd96 --- /dev/null +++ b/src/main/java/com/stripe/param/tax/SettingsRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.tax; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class SettingsRetrieveParams extends ApiRequestParams { + /** 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; + + private SettingsRetrieveParams(List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SettingsRetrieveParams build() { + return new SettingsRetrieveParams(this.expand, this.extraParams); + } + + /** + * 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 + * SettingsRetrieveParams#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 + * SettingsRetrieveParams#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 + * SettingsRetrieveParams#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 SettingsRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/tax/SettingsUpdateParams.java b/src/main/java/com/stripe/param/tax/SettingsUpdateParams.java new file mode 100644 index 00000000000..3554d1b6fa0 --- /dev/null +++ b/src/main/java/com/stripe/param/tax/SettingsUpdateParams.java @@ -0,0 +1,517 @@ +// File generated from our OpenAPI spec +package com.stripe.param.tax; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class SettingsUpdateParams extends ApiRequestParams { + /** Default configuration to be used on Stripe Tax calculations. */ + @SerializedName("defaults") + Defaults defaults; + + /** 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; + + /** The place where your business is located. */ + @SerializedName("head_office") + HeadOffice headOffice; + + private SettingsUpdateParams( + Defaults defaults, + List expand, + Map extraParams, + HeadOffice headOffice) { + this.defaults = defaults; + this.expand = expand; + this.extraParams = extraParams; + this.headOffice = headOffice; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Defaults defaults; + + private List expand; + + private Map extraParams; + + private HeadOffice headOffice; + + /** Finalize and obtain parameter instance from this builder. */ + public SettingsUpdateParams build() { + return new SettingsUpdateParams( + this.defaults, this.expand, this.extraParams, this.headOffice); + } + + /** Default configuration to be used on Stripe Tax calculations. */ + public Builder setDefaults(SettingsUpdateParams.Defaults defaults) { + this.defaults = defaults; + 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 + * SettingsUpdateParams#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 + * SettingsUpdateParams#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 + * SettingsUpdateParams#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 SettingsUpdateParams#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 place where your business is located. */ + public Builder setHeadOffice(SettingsUpdateParams.HeadOffice headOffice) { + this.headOffice = headOffice; + return this; + } + } + + @Getter + public static class Defaults { + /** + * 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 the default tax + * behavior to be used when the item's price has unspecified tax behavior. One of inclusive, + * exclusive, or inferred_by_currency. Once specified, it cannot be changed back to null. + */ + @SerializedName("tax_behavior") + TaxBehavior taxBehavior; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + private Defaults(Map extraParams, TaxBehavior taxBehavior, Object taxCode) { + this.extraParams = extraParams; + this.taxBehavior = taxBehavior; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private TaxBehavior taxBehavior; + + private Object taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public SettingsUpdateParams.Defaults build() { + return new SettingsUpdateParams.Defaults(this.extraParams, this.taxBehavior, this.taxCode); + } + + /** + * 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 + * SettingsUpdateParams.Defaults#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 SettingsUpdateParams.Defaults#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 the default tax + * behavior to be used when the item's price has unspecified tax behavior. One of + * inclusive, exclusive, or inferred_by_currency. Once specified, it cannot be changed back to + * null. + */ + public Builder setTaxBehavior(SettingsUpdateParams.Defaults.TaxBehavior taxBehavior) { + this.taxBehavior = taxBehavior; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(EmptyParam taxCode) { + this.taxCode = taxCode; + return this; + } + } + + public enum TaxBehavior implements ApiRequestParams.EnumParam { + @SerializedName("exclusive") + EXCLUSIVE("exclusive"), + + @SerializedName("inclusive") + INCLUSIVE("inclusive"), + + @SerializedName("inferred_by_currency") + INFERRED_BY_CURRENCY("inferred_by_currency"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TaxBehavior(String value) { + this.value = value; + } + } + } + + @Getter + public static class HeadOffice { + /** Required. The location of the business for tax purposes. */ + @SerializedName("address") + Address address; + + /** + * 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 HeadOffice(Address address, Map extraParams) { + this.address = address; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SettingsUpdateParams.HeadOffice build() { + return new SettingsUpdateParams.HeadOffice(this.address, this.extraParams); + } + + /** Required. The location of the business for tax purposes. */ + public Builder setAddress(SettingsUpdateParams.HeadOffice.Address address) { + this.address = address; + 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 + * SettingsUpdateParams.HeadOffice#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 SettingsUpdateParams.HeadOffice#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + Object city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + Object 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") + Object line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + Object line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + Object postalCode; + + /** + * State/province as an ISO 3166-2 + * subdivision code, without country prefix. Example: "NY" or "TX". + */ + @SerializedName("state") + Object state; + + private Address( + Object city, + Object country, + Map extraParams, + Object line1, + Object line2, + Object postalCode, + Object 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 Object city; + + private Object country; + + private Map extraParams; + + private Object line1; + + private Object line2; + + private Object postalCode; + + private Object state; + + /** Finalize and obtain parameter instance from this builder. */ + public SettingsUpdateParams.HeadOffice.Address build() { + return new SettingsUpdateParams.HeadOffice.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; + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(EmptyParam 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; + } + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + public Builder setCountry(EmptyParam 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 SettingsUpdateParams.HeadOffice.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 SettingsUpdateParams.HeadOffice.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 1 (e.g., street, PO Box, or company name). */ + public Builder setLine1(EmptyParam 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; + } + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + public Builder setLine2(EmptyParam line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(EmptyParam postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * State/province as an ISO 3166-2 + * subdivision code, without country prefix. Example: "NY" or "TX". + */ + public Builder setState(String state) { + this.state = state; + return this; + } + + /** + * State/province as an ISO 3166-2 + * subdivision code, without country prefix. Example: "NY" or "TX". + */ + public Builder setState(EmptyParam state) { + this.state = state; + return this; + } + } + } + } +} diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index bfbe8fb6912..b6550f6bdc0 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -129,6 +129,7 @@ public void testSessionCreate() throws StripeException { public void testSessionExpire() throws StripeException { com.stripe.model.checkout.Session resource = com.stripe.model.checkout.Session.retrieve("sess_xyz"); + com.stripe.param.checkout.SessionExpireParams params = com.stripe.param.checkout.SessionExpireParams.builder().build(); @@ -141,6 +142,7 @@ public void testSessionExpire() throws StripeException { @Test public void testCustomerCreateFundingInstructions() throws StripeException { Customer resource = Customer.retrieve("cus_123"); + CustomerCreateFundingInstructionsParams params = CustomerCreateFundingInstructionsParams.builder() .setBankTransfer( @@ -166,6 +168,7 @@ public void testCustomerCreateFundingInstructions() throws StripeException { @Test public void testCustomerListPaymentMethods() throws StripeException { Customer resource = Customer.retrieve("cus_xyz"); + CustomerListPaymentMethodsParams params = CustomerListPaymentMethodsParams.builder() .setType(CustomerListPaymentMethodsParams.Type.CARD) @@ -201,6 +204,7 @@ public void testAccountRetrieve() throws StripeException { public void testAccountDisconnect() throws StripeException { com.stripe.model.financialconnections.Account resource = com.stripe.model.financialconnections.Account.retrieve("fca_xyz"); + com.stripe.param.financialconnections.AccountDisconnectParams params = com.stripe.param.financialconnections.AccountDisconnectParams.builder().build(); @@ -216,6 +220,7 @@ public void testAccountDisconnect() throws StripeException { public void testAccountListOwners() throws StripeException { com.stripe.model.financialconnections.Account resource = com.stripe.model.financialconnections.Account.retrieve("fca_xyz"); + com.stripe.param.financialconnections.AccountListOwnersParams params = com.stripe.param.financialconnections.AccountListOwnersParams.builder() .setOwnership("fcaowns_xyz") @@ -234,6 +239,7 @@ public void testAccountListOwners() throws StripeException { public void testAccountRefresh() throws StripeException { com.stripe.model.financialconnections.Account resource = com.stripe.model.financialconnections.Account.retrieve("fca_xyz"); + com.stripe.param.financialconnections.AccountRefreshParams params = com.stripe.param.financialconnections.AccountRefreshParams.builder() .addFeature(com.stripe.param.financialconnections.AccountRefreshParams.Feature.BALANCE) @@ -307,6 +313,7 @@ public void testPaymentIntentCreate() throws StripeException { @Test public void testPaymentIntentVerifyMicrodeposits() throws StripeException { PaymentIntent resource = PaymentIntent.retrieve("pi_xxxxxxxxxxxxx"); + PaymentIntentVerifyMicrodepositsParams params = PaymentIntentVerifyMicrodepositsParams.builder().build(); @@ -344,6 +351,7 @@ public void testPaymentLinkRetrieve() throws StripeException { @Test public void testPaymentLinkListLineItems() throws StripeException { PaymentLink resource = PaymentLink.retrieve("pl_xyz"); + PaymentLinkListLineItemsParams params = PaymentLinkListLineItemsParams.builder().build(); LineItemCollection lineItems = resource.listLineItems(params); @@ -387,6 +395,7 @@ public void testSetupAttemptList() throws StripeException { @Test public void testSetupIntentVerifyMicrodeposits() throws StripeException { SetupIntent resource = SetupIntent.retrieve("seti_xxxxxxxxxxxxx"); + SetupIntentVerifyMicrodepositsParams params = SetupIntentVerifyMicrodepositsParams.builder().build(); @@ -469,6 +478,7 @@ public void testConfigurationRetrieve() throws StripeException { public void testConfigurationUpdate() throws StripeException { com.stripe.model.terminal.Configuration resource = com.stripe.model.terminal.Configuration.retrieve("uc_123"); + com.stripe.param.terminal.ConfigurationUpdateParams params = com.stripe.param.terminal.ConfigurationUpdateParams.builder() .setTipping( @@ -489,6 +499,7 @@ public void testConfigurationUpdate() throws StripeException { @Test public void testCustomerFundCashBalance() throws StripeException { Customer resource = Customer.retrieve("cus_123"); + CustomerFundCashBalanceParams params = CustomerFundCashBalanceParams.builder().setAmount(30L).setCurrency("eur").build(); @@ -504,6 +515,7 @@ public void testCustomerFundCashBalance() throws StripeException { @Test public void testCardDeliverCard() throws StripeException { com.stripe.model.issuing.Card resource = com.stripe.model.issuing.Card.retrieve("card_123"); + com.stripe.param.issuing.CardDeliverCardParams params = com.stripe.param.issuing.CardDeliverCardParams.builder().build(); @@ -518,6 +530,7 @@ public void testCardDeliverCard() throws StripeException { @Test public void testCardFailCard() throws StripeException { com.stripe.model.issuing.Card resource = com.stripe.model.issuing.Card.retrieve("card_123"); + com.stripe.param.issuing.CardFailCardParams params = com.stripe.param.issuing.CardFailCardParams.builder().build(); @@ -532,6 +545,7 @@ public void testCardFailCard() throws StripeException { @Test public void testCardReturnCard() throws StripeException { com.stripe.model.issuing.Card resource = com.stripe.model.issuing.Card.retrieve("card_123"); + com.stripe.param.issuing.CardReturnCardParams params = com.stripe.param.issuing.CardReturnCardParams.builder().build(); @@ -546,6 +560,7 @@ public void testCardReturnCard() throws StripeException { @Test public void testCardShipCard() throws StripeException { com.stripe.model.issuing.Card resource = com.stripe.model.issuing.Card.retrieve("card_123"); + com.stripe.param.issuing.CardShipCardParams params = com.stripe.param.issuing.CardShipCardParams.builder().build(); @@ -560,6 +575,7 @@ public void testCardShipCard() throws StripeException { @Test public void testRefundExpire() throws StripeException { Refund resource = Refund.retrieve("re_123"); + RefundExpireParams params = RefundExpireParams.builder().build(); Refund refund = resource.getTestHelpers().expire(params); @@ -615,6 +631,7 @@ public void testTestClockRetrieve() throws StripeException { public void testTestClockAdvance() throws StripeException { com.stripe.model.testhelpers.TestClock resource = com.stripe.model.testhelpers.TestClock.retrieve("clock_xyz"); + com.stripe.param.testhelpers.TestClockAdvanceParams params = com.stripe.param.testhelpers.TestClockAdvanceParams.builder().setFrozenTime(142L).build(); @@ -630,6 +647,7 @@ public void testTestClockAdvance() throws StripeException { public void testInboundTransferFail() throws StripeException { com.stripe.model.treasury.InboundTransfer resource = com.stripe.model.treasury.InboundTransfer.retrieve("ibt_123"); + com.stripe.param.treasury.InboundTransferFailParams params = com.stripe.param.treasury.InboundTransferFailParams.builder() .setFailureDetails( @@ -653,6 +671,7 @@ public void testInboundTransferFail() throws StripeException { public void testInboundTransferReturnInboundTransfer() throws StripeException { com.stripe.model.treasury.InboundTransfer resource = com.stripe.model.treasury.InboundTransfer.retrieve("ibt_123"); + com.stripe.param.treasury.InboundTransferReturnInboundTransferParams params = com.stripe.param.treasury.InboundTransferReturnInboundTransferParams.builder().build(); @@ -669,6 +688,7 @@ public void testInboundTransferReturnInboundTransfer() throws StripeException { public void testInboundTransferSucceed() throws StripeException { com.stripe.model.treasury.InboundTransfer resource = com.stripe.model.treasury.InboundTransfer.retrieve("ibt_123"); + com.stripe.param.treasury.InboundTransferSucceedParams params = com.stripe.param.treasury.InboundTransferSucceedParams.builder().build(); @@ -685,6 +705,7 @@ public void testInboundTransferSucceed() throws StripeException { public void testOutboundTransferFail() throws StripeException { com.stripe.model.treasury.OutboundTransfer resource = com.stripe.model.treasury.OutboundTransfer.retrieve("obt_123"); + com.stripe.param.treasury.OutboundTransferFailParams params = com.stripe.param.treasury.OutboundTransferFailParams.builder().build(); @@ -701,6 +722,7 @@ public void testOutboundTransferFail() throws StripeException { public void testOutboundTransferPost() throws StripeException { com.stripe.model.treasury.OutboundTransfer resource = com.stripe.model.treasury.OutboundTransfer.retrieve("obt_123"); + com.stripe.param.treasury.OutboundTransferPostParams params = com.stripe.param.treasury.OutboundTransferPostParams.builder().build(); @@ -717,6 +739,7 @@ public void testOutboundTransferPost() throws StripeException { public void testOutboundTransferReturnOutboundTransfer() throws StripeException { com.stripe.model.treasury.OutboundTransfer resource = com.stripe.model.treasury.OutboundTransfer.retrieve("obt_123"); + com.stripe.param.treasury.OutboundTransferReturnOutboundTransferParams params = com.stripe.param.treasury.OutboundTransferReturnOutboundTransferParams.builder() .setReturnedDetails( @@ -861,6 +884,7 @@ public void testAccountRetrieve2() throws StripeException { @Test public void testAccountUpdate() throws StripeException { Account resource = Account.retrieve("acct_xxxxxxxxxxxxx"); + AccountUpdateParams params = AccountUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -873,6 +897,7 @@ public void testAccountUpdate() throws StripeException { @Test public void testAccountReject() throws StripeException { Account resource = Account.retrieve("acct_xxxxxxxxxxxxx"); + AccountRejectParams params = AccountRejectParams.builder().setReason("fraud").build(); Account account = resource.reject(params); @@ -884,6 +909,7 @@ public void testAccountReject() throws StripeException { @Test public void testAccountCapabilities() throws StripeException { Account resource = Account.retrieve("acct_xxxxxxxxxxxxx"); + AccountCapabilitiesParams params = AccountCapabilitiesParams.builder().build(); CapabilityCollection capabilities = resource.capabilities(params); @@ -908,7 +934,9 @@ public void testCapabilityRetrieve() throws StripeException { @Test public void testCapabilityUpdate() throws StripeException { Account account = Account.retrieve("acct_xxxxxxxxxxxxx"); + Capability resource = account.capabilities().retrieve("card_payments"); + CapabilityUpdateParams params = CapabilityUpdateParams.builder().setRequested(true).build(); Capability capability = resource.update(params); @@ -922,6 +950,7 @@ public void testCapabilityUpdate() throws StripeException { @Test public void testAccountPersons() throws StripeException { Account resource = Account.retrieve("acct_xxxxxxxxxxxxx"); + AccountPersonsParams params = AccountPersonsParams.builder().setLimit(3L).build(); PersonCollection persons = resource.persons(params); @@ -933,6 +962,7 @@ public void testAccountPersons() throws StripeException { @Test public void testPersonCreate() throws StripeException { Account account = Account.retrieve("acct_xxxxxxxxxxxxx"); + PersonCollectionCreateParams params = PersonCollectionCreateParams.builder().setFirstName("Jane").setLastName("Diaz").build(); @@ -945,6 +975,7 @@ public void testPersonCreate() throws StripeException { @Test public void testPersonDelete() throws StripeException { Account account = Account.retrieve("acct_xxxxxxxxxxxxx"); + Person resource = account.persons().retrieve("person_xxxxxxxxxxxxx"); Person person = resource.delete(); @@ -968,7 +999,9 @@ public void testPersonRetrieve() throws StripeException { @Test public void testPersonUpdate() throws StripeException { Account account = Account.retrieve("acct_xxxxxxxxxxxxx"); + Person resource = account.persons().retrieve("person_xxxxxxxxxxxxx"); + PersonUpdateParams params = PersonUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -999,6 +1032,7 @@ public void testApplicationFeeRetrieve() throws StripeException { @Test public void testFeeRefundList() throws StripeException { ApplicationFee applicationFee = ApplicationFee.retrieve("fee_xxxxxxxxxxxxx"); + FeeRefundCollectionListParams params = FeeRefundCollectionListParams.builder().setLimit(3L).build(); @@ -1013,6 +1047,7 @@ public void testFeeRefundList() throws StripeException { @Test public void testFeeRefundCreate() throws StripeException { ApplicationFee applicationFee = ApplicationFee.retrieve("fee_xxxxxxxxxxxxx"); + FeeRefundCollectionCreateParams params = FeeRefundCollectionCreateParams.builder().build(); FeeRefund feeRefund = applicationFee.getRefunds().create(params); @@ -1037,7 +1072,9 @@ public void testFeeRefundRetrieve() throws StripeException { @Test public void testFeeRefundUpdate() throws StripeException { ApplicationFee applicationFee = ApplicationFee.retrieve("fee_xxxxxxxxxxxxx"); + FeeRefund resource = applicationFee.getRefunds().retrieve("fr_xxxxxxxxxxxxx"); + FeeRefundUpdateParams params = FeeRefundUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -1161,6 +1198,7 @@ public void testConfigurationRetrieve2() throws StripeException { public void testConfigurationUpdate2() throws StripeException { com.stripe.model.billingportal.Configuration resource = com.stripe.model.billingportal.Configuration.retrieve("bpc_xxxxxxxxxxxxx"); + com.stripe.param.billingportal.ConfigurationUpdateParams params = com.stripe.param.billingportal.ConfigurationUpdateParams.builder() .setBusinessProfile( @@ -1227,6 +1265,7 @@ public void testChargeRetrieve() throws StripeException { @Test public void testChargeUpdate() throws StripeException { Charge resource = Charge.retrieve("ch_xxxxxxxxxxxxx"); + ChargeUpdateParams params = ChargeUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -1238,6 +1277,7 @@ public void testChargeUpdate() throws StripeException { @Test public void testChargeCapture() throws StripeException { Charge resource = Charge.retrieve("ch_xxxxxxxxxxxxx"); + ChargeCaptureParams params = ChargeCaptureParams.builder().build(); Charge charge = resource.capture(params); @@ -1297,6 +1337,7 @@ public void testSessionRetrieve2() throws StripeException { public void testSessionExpire2() throws StripeException { com.stripe.model.checkout.Session resource = com.stripe.model.checkout.Session.retrieve("cs_test_xxxxxxxxxxxxx"); + com.stripe.param.checkout.SessionExpireParams params = com.stripe.param.checkout.SessionExpireParams.builder().build(); @@ -1366,6 +1407,7 @@ public void testCouponRetrieve() throws StripeException { @Test public void testCouponUpdate() throws StripeException { Coupon resource = Coupon.retrieve("Z4OV52SU"); + CouponUpdateParams params = CouponUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -1404,6 +1446,7 @@ public void testCreditNoteCreate() throws StripeException { @Test public void testCreditNoteVoidCreditNote() throws StripeException { CreditNote resource = CreditNote.retrieve("cn_xxxxxxxxxxxxx"); + CreditNoteVoidCreditNoteParams params = CreditNoteVoidCreditNoteParams.builder().build(); CreditNote creditNote = resource.voidCreditNote(params); @@ -1415,6 +1458,7 @@ public void testCreditNoteVoidCreditNote() throws StripeException { @Test public void testCreditNoteLineItemList() throws StripeException { CreditNote creditNote = CreditNote.retrieve("cn_xxxxxxxxxxxxx"); + CreditNoteLineItemCollectionListParams params = CreditNoteLineItemCollectionListParams.builder().setLimit(3L).build(); @@ -1492,6 +1536,7 @@ public void testCustomerRetrieve() throws StripeException { @Test public void testCustomerUpdate() throws StripeException { Customer resource = Customer.retrieve("cus_xxxxxxxxxxxxx"); + CustomerUpdateParams params = CustomerUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -1504,6 +1549,7 @@ public void testCustomerUpdate() throws StripeException { @Test public void testCustomerBalanceTransactions() throws StripeException { Customer resource = Customer.retrieve("cus_xxxxxxxxxxxxx"); + CustomerBalanceTransactionsParams params = CustomerBalanceTransactionsParams.builder().setLimit(3L).build(); @@ -1519,6 +1565,7 @@ public void testCustomerBalanceTransactions() throws StripeException { @Test public void testCustomerBalanceTransactionCreate() throws StripeException { Customer customer = Customer.retrieve("cus_xxxxxxxxxxxxx"); + CustomerBalanceTransactionCollectionCreateParams params = CustomerBalanceTransactionCollectionCreateParams.builder() .setAmount(-500L) @@ -1549,8 +1596,10 @@ public void testCustomerBalanceTransactionRetrieve() throws StripeException { @Test public void testCustomerBalanceTransactionUpdate() throws StripeException { Customer customer = Customer.retrieve("cus_xxxxxxxxxxxxx"); + CustomerBalanceTransaction resource = customer.balanceTransactions().retrieve("cbtxn_xxxxxxxxxxxxx"); + CustomerBalanceTransactionUpdateParams params = CustomerBalanceTransactionUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -1565,6 +1614,7 @@ public void testCustomerBalanceTransactionUpdate() throws StripeException { @Test public void testCustomerListPaymentMethods2() throws StripeException { Customer resource = Customer.retrieve("cus_xxxxxxxxxxxxx"); + CustomerListPaymentMethodsParams params = CustomerListPaymentMethodsParams.builder() .setType(CustomerListPaymentMethodsParams.Type.CARD) @@ -1621,6 +1671,7 @@ public void testDisputeRetrieve() throws StripeException { @Test public void testDisputeUpdate() throws StripeException { Dispute resource = Dispute.retrieve("dp_xxxxxxxxxxxxx"); + DisputeUpdateParams params = DisputeUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -1632,6 +1683,7 @@ public void testDisputeUpdate() throws StripeException { @Test public void testDisputeClose() throws StripeException { Dispute resource = Dispute.retrieve("dp_xxxxxxxxxxxxx"); + DisputeCloseParams params = DisputeCloseParams.builder().build(); Dispute dispute = resource.close(params); @@ -1685,6 +1737,7 @@ public void testFileLinkRetrieve() throws StripeException { @Test public void testFileLinkUpdate() throws StripeException { FileLink resource = FileLink.retrieve("link_xxxxxxxxxxxxx"); + FileLinkUpdateParams params = FileLinkUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -1724,6 +1777,7 @@ public void testAccountRetrieve3() throws StripeException { public void testAccountDisconnect2() throws StripeException { com.stripe.model.financialconnections.Account resource = com.stripe.model.financialconnections.Account.retrieve("fca_xxxxxxxxxxxxx"); + com.stripe.param.financialconnections.AccountDisconnectParams params = com.stripe.param.financialconnections.AccountDisconnectParams.builder().build(); @@ -1739,6 +1793,7 @@ public void testAccountDisconnect2() throws StripeException { public void testAccountListOwners2() throws StripeException { com.stripe.model.financialconnections.Account resource = com.stripe.model.financialconnections.Account.retrieve("fca_xxxxxxxxxxxxx"); + com.stripe.param.financialconnections.AccountListOwnersParams params = com.stripe.param.financialconnections.AccountListOwnersParams.builder() .setLimit(3L) @@ -1851,6 +1906,7 @@ public void testVerificationSessionRetrieve() throws StripeException { public void testVerificationSessionUpdate() throws StripeException { com.stripe.model.identity.VerificationSession resource = com.stripe.model.identity.VerificationSession.retrieve("vs_xxxxxxxxxxxxx"); + com.stripe.param.identity.VerificationSessionUpdateParams params = com.stripe.param.identity.VerificationSessionUpdateParams.builder() .setType(com.stripe.param.identity.VerificationSessionUpdateParams.Type.ID_NUMBER) @@ -1868,6 +1924,7 @@ public void testVerificationSessionUpdate() throws StripeException { public void testVerificationSessionCancel() throws StripeException { com.stripe.model.identity.VerificationSession resource = com.stripe.model.identity.VerificationSession.retrieve("vs_xxxxxxxxxxxxx"); + com.stripe.param.identity.VerificationSessionCancelParams params = com.stripe.param.identity.VerificationSessionCancelParams.builder().build(); @@ -1883,6 +1940,7 @@ public void testVerificationSessionCancel() throws StripeException { public void testVerificationSessionRedact() throws StripeException { com.stripe.model.identity.VerificationSession resource = com.stripe.model.identity.VerificationSession.retrieve("vs_xxxxxxxxxxxxx"); + com.stripe.param.identity.VerificationSessionRedactParams params = com.stripe.param.identity.VerificationSessionRedactParams.builder().build(); @@ -1935,6 +1993,7 @@ public void testInvoiceItemRetrieve() throws StripeException { @Test public void testInvoiceItemUpdate() throws StripeException { InvoiceItem resource = InvoiceItem.retrieve("ii_xxxxxxxxxxxxx"); + InvoiceItemUpdateParams params = InvoiceItemUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -1991,6 +2050,7 @@ public void testInvoiceRetrieve2() throws StripeException { @Test public void testInvoiceUpdate() throws StripeException { Invoice resource = Invoice.retrieve("in_xxxxxxxxxxxxx"); + InvoiceUpdateParams params = InvoiceUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -2002,6 +2062,7 @@ public void testInvoiceUpdate() throws StripeException { @Test public void testInvoiceFinalizeInvoice() throws StripeException { Invoice resource = Invoice.retrieve("in_xxxxxxxxxxxxx"); + InvoiceFinalizeInvoiceParams params = InvoiceFinalizeInvoiceParams.builder().build(); Invoice invoice = resource.finalizeInvoice(params); @@ -2013,6 +2074,7 @@ public void testInvoiceFinalizeInvoice() throws StripeException { @Test public void testInvoiceMarkUncollectible() throws StripeException { Invoice resource = Invoice.retrieve("in_xxxxxxxxxxxxx"); + InvoiceMarkUncollectibleParams params = InvoiceMarkUncollectibleParams.builder().build(); Invoice invoice = resource.markUncollectible(params); @@ -2026,6 +2088,7 @@ public void testInvoiceMarkUncollectible() throws StripeException { @Test public void testInvoicePay() throws StripeException { Invoice resource = Invoice.retrieve("in_xxxxxxxxxxxxx"); + InvoicePayParams params = InvoicePayParams.builder().build(); Invoice invoice = resource.pay(params); @@ -2037,6 +2100,7 @@ public void testInvoicePay() throws StripeException { @Test public void testInvoiceSendInvoice() throws StripeException { Invoice resource = Invoice.retrieve("in_xxxxxxxxxxxxx"); + InvoiceSendInvoiceParams params = InvoiceSendInvoiceParams.builder().build(); Invoice invoice = resource.sendInvoice(params); @@ -2048,6 +2112,7 @@ public void testInvoiceSendInvoice() throws StripeException { @Test public void testInvoiceVoidInvoice() throws StripeException { Invoice resource = Invoice.retrieve("in_xxxxxxxxxxxxx"); + InvoiceVoidInvoiceParams params = InvoiceVoidInvoiceParams.builder().build(); Invoice invoice = resource.voidInvoice(params); @@ -2089,6 +2154,7 @@ public void testAuthorizationRetrieve() throws StripeException { public void testAuthorizationUpdate() throws StripeException { com.stripe.model.issuing.Authorization resource = com.stripe.model.issuing.Authorization.retrieve("iauth_xxxxxxxxxxxxx"); + com.stripe.param.issuing.AuthorizationUpdateParams params = com.stripe.param.issuing.AuthorizationUpdateParams.builder() .putMetadata("order_id", "6735") @@ -2106,6 +2172,7 @@ public void testAuthorizationUpdate() throws StripeException { public void testAuthorizationApprove() throws StripeException { com.stripe.model.issuing.Authorization resource = com.stripe.model.issuing.Authorization.retrieve("iauth_xxxxxxxxxxxxx"); + com.stripe.param.issuing.AuthorizationApproveParams params = com.stripe.param.issuing.AuthorizationApproveParams.builder().build(); @@ -2121,6 +2188,7 @@ public void testAuthorizationApprove() throws StripeException { public void testAuthorizationDecline() throws StripeException { com.stripe.model.issuing.Authorization resource = com.stripe.model.issuing.Authorization.retrieve("iauth_xxxxxxxxxxxxx"); + com.stripe.param.issuing.AuthorizationDeclineParams params = com.stripe.param.issuing.AuthorizationDeclineParams.builder().build(); @@ -2182,6 +2250,7 @@ public void testCardholderRetrieve() throws StripeException { public void testCardholderUpdate() throws StripeException { com.stripe.model.issuing.Cardholder resource = com.stripe.model.issuing.Cardholder.retrieve("ich_xxxxxxxxxxxxx"); + com.stripe.param.issuing.CardholderUpdateParams params = com.stripe.param.issuing.CardholderUpdateParams.builder() .putMetadata("order_id", "6735") @@ -2230,6 +2299,7 @@ public void testCardRetrieve() throws StripeException { public void testCardUpdate() throws StripeException { com.stripe.model.issuing.Card resource = com.stripe.model.issuing.Card.retrieve("ic_xxxxxxxxxxxxx"); + com.stripe.param.issuing.CardUpdateParams params = com.stripe.param.issuing.CardUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -2283,6 +2353,7 @@ public void testDisputeRetrieve2() throws StripeException { public void testDisputeSubmit() throws StripeException { com.stripe.model.issuing.Dispute resource = com.stripe.model.issuing.Dispute.retrieve("idp_xxxxxxxxxxxxx"); + com.stripe.param.issuing.DisputeSubmitParams params = com.stripe.param.issuing.DisputeSubmitParams.builder().build(); @@ -2317,6 +2388,7 @@ public void testTransactionRetrieve() throws StripeException { public void testTransactionUpdate() throws StripeException { com.stripe.model.issuing.Transaction resource = com.stripe.model.issuing.Transaction.retrieve("ipi_xxxxxxxxxxxxx"); + com.stripe.param.issuing.TransactionUpdateParams params = com.stripe.param.issuing.TransactionUpdateParams.builder() .putMetadata("order_id", "6735") @@ -2373,6 +2445,7 @@ public void testPaymentIntentRetrieve() throws StripeException { @Test public void testPaymentIntentUpdate() throws StripeException { PaymentIntent resource = PaymentIntent.retrieve("pi_xxxxxxxxxxxxx"); + PaymentIntentUpdateParams params = PaymentIntentUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -2385,6 +2458,7 @@ public void testPaymentIntentUpdate() throws StripeException { @Test public void testPaymentIntentApplyCustomerBalance() throws StripeException { PaymentIntent resource = PaymentIntent.retrieve("pi_xxxxxxxxxxxxx"); + PaymentIntentApplyCustomerBalanceParams params = PaymentIntentApplyCustomerBalanceParams.builder().build(); @@ -2399,6 +2473,7 @@ public void testPaymentIntentApplyCustomerBalance() throws StripeException { @Test public void testPaymentIntentCancel() throws StripeException { PaymentIntent resource = PaymentIntent.retrieve("pi_xxxxxxxxxxxxx"); + PaymentIntentCancelParams params = PaymentIntentCancelParams.builder().build(); PaymentIntent paymentIntent = resource.cancel(params); @@ -2412,6 +2487,7 @@ public void testPaymentIntentCancel() throws StripeException { @Test public void testPaymentIntentCapture() throws StripeException { PaymentIntent resource = PaymentIntent.retrieve("pi_xxxxxxxxxxxxx"); + PaymentIntentCaptureParams params = PaymentIntentCaptureParams.builder().build(); PaymentIntent paymentIntent = resource.capture(params); @@ -2425,6 +2501,7 @@ public void testPaymentIntentCapture() throws StripeException { @Test public void testPaymentIntentConfirm() throws StripeException { PaymentIntent resource = PaymentIntent.retrieve("pi_xxxxxxxxxxxxx"); + PaymentIntentConfirmParams params = PaymentIntentConfirmParams.builder().setPaymentMethod("pm_card_visa").build(); @@ -2439,6 +2516,7 @@ public void testPaymentIntentConfirm() throws StripeException { @Test public void testPaymentIntentIncrementAuthorization() throws StripeException { PaymentIntent resource = PaymentIntent.retrieve("pi_xxxxxxxxxxxxx"); + PaymentIntentIncrementAuthorizationParams params = PaymentIntentIncrementAuthorizationParams.builder().setAmount(2099L).build(); @@ -2453,6 +2531,7 @@ public void testPaymentIntentIncrementAuthorization() throws StripeException { @Test public void testPaymentIntentVerifyMicrodeposits2() throws StripeException { PaymentIntent resource = PaymentIntent.retrieve("pi_xxxxxxxxxxxxx"); + PaymentIntentVerifyMicrodepositsParams params = PaymentIntentVerifyMicrodepositsParams.builder().addAmount(32L).addAmount(45L).build(); @@ -2511,6 +2590,7 @@ public void testPaymentLinkRetrieve2() throws StripeException { @Test public void testPaymentLinkUpdate() throws StripeException { PaymentLink resource = PaymentLink.retrieve("plink_xxxxxxxxxxxxx"); + PaymentLinkUpdateParams params = PaymentLinkUpdateParams.builder().setActive(false).build(); PaymentLink paymentLink = resource.update(params); @@ -2542,6 +2622,7 @@ public void testPaymentMethodRetrieve() throws StripeException { @Test public void testPaymentMethodUpdate() throws StripeException { PaymentMethod resource = PaymentMethod.retrieve("pm_xxxxxxxxxxxxx"); + PaymentMethodUpdateParams params = PaymentMethodUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -2554,6 +2635,7 @@ public void testPaymentMethodUpdate() throws StripeException { @Test public void testPaymentMethodAttach() throws StripeException { PaymentMethod resource = PaymentMethod.retrieve("pm_xxxxxxxxxxxxx"); + PaymentMethodAttachParams params = PaymentMethodAttachParams.builder().setCustomer("cus_xxxxxxxxxxxxx").build(); @@ -2568,6 +2650,7 @@ public void testPaymentMethodAttach() throws StripeException { @Test public void testPaymentMethodDetach() throws StripeException { PaymentMethod resource = PaymentMethod.retrieve("pm_xxxxxxxxxxxxx"); + PaymentMethodDetachParams params = PaymentMethodDetachParams.builder().build(); PaymentMethod paymentMethod = resource.detach(params); @@ -2607,6 +2690,7 @@ public void testPayoutRetrieve() throws StripeException { @Test public void testPayoutUpdate() throws StripeException { Payout resource = Payout.retrieve("po_xxxxxxxxxxxxx"); + PayoutUpdateParams params = PayoutUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -2618,6 +2702,7 @@ public void testPayoutUpdate() throws StripeException { @Test public void testPayoutCancel() throws StripeException { Payout resource = Payout.retrieve("po_xxxxxxxxxxxxx"); + PayoutCancelParams params = PayoutCancelParams.builder().build(); Payout payout = resource.cancel(params); @@ -2629,6 +2714,7 @@ public void testPayoutCancel() throws StripeException { @Test public void testPayoutReverse() throws StripeException { Payout resource = Payout.retrieve("po_xxxxxxxxxxxxx"); + PayoutReverseParams params = PayoutReverseParams.builder().build(); Payout payout = resource.reverse(params); @@ -2695,6 +2781,7 @@ public void testPlanRetrieve() throws StripeException { @Test public void testPlanUpdate() throws StripeException { Plan resource = Plan.retrieve("price_xxxxxxxxxxxxx"); + PlanUpdateParams params = PlanUpdateParams.builder().putMetadata("order_id", "6735").build(); Plan plan = resource.update(params); @@ -2739,6 +2826,7 @@ public void testPriceRetrieve() throws StripeException { @Test public void testPriceUpdate() throws StripeException { Price resource = Price.retrieve("price_xxxxxxxxxxxxx"); + PriceUpdateParams params = PriceUpdateParams.builder().putMetadata("order_id", "6735").build(); Price price = resource.update(params); @@ -2795,6 +2883,7 @@ public void testProductRetrieve() throws StripeException { @Test public void testProductUpdate() throws StripeException { Product resource = Product.retrieve("prod_xxxxxxxxxxxxx"); + ProductUpdateParams params = ProductUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -2845,6 +2934,7 @@ public void testPromotionCodeRetrieve() throws StripeException { @Test public void testPromotionCodeUpdate() throws StripeException { PromotionCode resource = PromotionCode.retrieve("promo_xxxxxxxxxxxxx"); + PromotionCodeUpdateParams params = PromotionCodeUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -2890,6 +2980,7 @@ public void testQuoteRetrieve() throws StripeException { @Test public void testQuoteUpdate() throws StripeException { Quote resource = Quote.retrieve("qt_xxxxxxxxxxxxx"); + QuoteUpdateParams params = QuoteUpdateParams.builder().putMetadata("order_id", "6735").build(); Quote quote = resource.update(params); @@ -2900,6 +2991,7 @@ public void testQuoteUpdate() throws StripeException { @Test public void testQuoteAccept() throws StripeException { Quote resource = Quote.retrieve("qt_xxxxxxxxxxxxx"); + QuoteAcceptParams params = QuoteAcceptParams.builder().build(); Quote quote = resource.accept(params); @@ -2911,6 +3003,7 @@ public void testQuoteAccept() throws StripeException { @Test public void testQuoteCancel() throws StripeException { Quote resource = Quote.retrieve("qt_xxxxxxxxxxxxx"); + QuoteCancelParams params = QuoteCancelParams.builder().build(); Quote quote = resource.cancel(params); @@ -2922,6 +3015,7 @@ public void testQuoteCancel() throws StripeException { @Test public void testQuoteFinalizeQuote() throws StripeException { Quote resource = Quote.retrieve("qt_xxxxxxxxxxxxx"); + QuoteFinalizeQuoteParams params = QuoteFinalizeQuoteParams.builder().build(); Quote quote = resource.finalizeQuote(params); @@ -3044,6 +3138,7 @@ public void testValueListRetrieve() throws StripeException { public void testValueListUpdate() throws StripeException { com.stripe.model.radar.ValueList resource = com.stripe.model.radar.ValueList.retrieve("rsl_xxxxxxxxxxxxx"); + com.stripe.param.radar.ValueListUpdateParams params = com.stripe.param.radar.ValueListUpdateParams.builder() .setName("Updated IP Block List") @@ -3083,6 +3178,7 @@ public void testRefundRetrieve() throws StripeException { @Test public void testRefundUpdate() throws StripeException { Refund resource = Refund.retrieve("re_xxxxxxxxxxxxx"); + RefundUpdateParams params = RefundUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -3094,6 +3190,7 @@ public void testRefundUpdate() throws StripeException { @Test public void testRefundCancel() throws StripeException { Refund resource = Refund.retrieve("re_xxxxxxxxxxxxx"); + RefundCancelParams params = RefundCancelParams.builder().build(); Refund refund = resource.cancel(params); @@ -3177,6 +3274,7 @@ public void testReviewRetrieve() throws StripeException { @Test public void testReviewApprove() throws StripeException { Review resource = Review.retrieve("prv_xxxxxxxxxxxxx"); + ReviewApproveParams params = ReviewApproveParams.builder().build(); Review review = resource.approve(params); @@ -3214,6 +3312,7 @@ public void testSetupIntentRetrieve() throws StripeException { @Test public void testSetupIntentUpdate() throws StripeException { SetupIntent resource = SetupIntent.retrieve("seti_xxxxxxxxxxxxx"); + SetupIntentUpdateParams params = SetupIntentUpdateParams.builder().putMetadata("user_id", "3435453").build(); @@ -3226,6 +3325,7 @@ public void testSetupIntentUpdate() throws StripeException { @Test public void testSetupIntentCancel() throws StripeException { SetupIntent resource = SetupIntent.retrieve("seti_xxxxxxxxxxxxx"); + SetupIntentCancelParams params = SetupIntentCancelParams.builder().build(); SetupIntent setupIntent = resource.cancel(params); @@ -3239,6 +3339,7 @@ public void testSetupIntentCancel() throws StripeException { @Test public void testSetupIntentConfirm() throws StripeException { SetupIntent resource = SetupIntent.retrieve("seti_xxxxxxxxxxxxx"); + SetupIntentConfirmParams params = SetupIntentConfirmParams.builder().setPaymentMethod("pm_card_visa").build(); @@ -3253,6 +3354,7 @@ public void testSetupIntentConfirm() throws StripeException { @Test public void testSetupIntentVerifyMicrodeposits2() throws StripeException { SetupIntent resource = SetupIntent.retrieve("seti_xxxxxxxxxxxxx"); + SetupIntentVerifyMicrodepositsParams params = SetupIntentVerifyMicrodepositsParams.builder().addAmount(32L).addAmount(45L).build(); @@ -3301,6 +3403,7 @@ public void testShippingRateRetrieve() throws StripeException { @Test public void testShippingRateUpdate() throws StripeException { ShippingRate resource = ShippingRate.retrieve("shr_xxxxxxxxxxxxx"); + ShippingRateUpdateParams params = ShippingRateUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -3347,6 +3450,7 @@ public void testSourceRetrieve2() throws StripeException { @Test public void testSourceUpdate() throws StripeException { Source resource = Source.retrieve("src_xxxxxxxxxxxxx"); + SourceUpdateParams params = SourceUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -3382,6 +3486,7 @@ public void testSubscriptionItemCreate() throws StripeException { @Test public void testSubscriptionItemDelete() throws StripeException { SubscriptionItem resource = SubscriptionItem.retrieve("si_xxxxxxxxxxxxx"); + SubscriptionItemDeleteParams params = SubscriptionItemDeleteParams.builder().build(); SubscriptionItem subscriptionItem = resource.delete(params); @@ -3402,6 +3507,7 @@ public void testSubscriptionItemRetrieve() throws StripeException { @Test public void testSubscriptionItemUpdate() throws StripeException { SubscriptionItem resource = SubscriptionItem.retrieve("si_xxxxxxxxxxxxx"); + SubscriptionItemUpdateParams params = SubscriptionItemUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -3414,6 +3520,7 @@ public void testSubscriptionItemUpdate() throws StripeException { @Test public void testSubscriptionItemUsageRecordSummaries() throws StripeException { SubscriptionItem resource = SubscriptionItem.retrieve("si_xxxxxxxxxxxxx"); + SubscriptionItemUsageRecordSummariesParams params = SubscriptionItemUsageRecordSummariesParams.builder().setLimit(3L).build(); @@ -3470,6 +3577,7 @@ public void testSubscriptionScheduleRetrieve() throws StripeException { @Test public void testSubscriptionScheduleUpdate() throws StripeException { SubscriptionSchedule resource = SubscriptionSchedule.retrieve("sub_sched_xxxxxxxxxxxxx"); + SubscriptionScheduleUpdateParams params = SubscriptionScheduleUpdateParams.builder() .setEndBehavior(SubscriptionScheduleUpdateParams.EndBehavior.RELEASE) @@ -3486,6 +3594,7 @@ public void testSubscriptionScheduleUpdate() throws StripeException { @Test public void testSubscriptionScheduleCancel() throws StripeException { SubscriptionSchedule resource = SubscriptionSchedule.retrieve("sub_sched_xxxxxxxxxxxxx"); + SubscriptionScheduleCancelParams params = SubscriptionScheduleCancelParams.builder().build(); SubscriptionSchedule subscriptionSchedule = resource.cancel(params); @@ -3499,6 +3608,7 @@ public void testSubscriptionScheduleCancel() throws StripeException { @Test public void testSubscriptionScheduleRelease() throws StripeException { SubscriptionSchedule resource = SubscriptionSchedule.retrieve("sub_sched_xxxxxxxxxxxxx"); + SubscriptionScheduleReleaseParams params = SubscriptionScheduleReleaseParams.builder().build(); SubscriptionSchedule subscriptionSchedule = resource.release(params); @@ -3535,6 +3645,7 @@ public void testSubscriptionCreate() throws StripeException { @Test public void testSubscriptionCancel() throws StripeException { Subscription resource = Subscription.retrieve("sub_xxxxxxxxxxxxx"); + SubscriptionCancelParams params = SubscriptionCancelParams.builder().build(); Subscription subscription = resource.cancel(params); @@ -3553,6 +3664,7 @@ public void testSubscriptionRetrieve() throws StripeException { @Test public void testSubscriptionUpdate() throws StripeException { Subscription resource = Subscription.retrieve("sub_xxxxxxxxxxxxx"); + SubscriptionUpdateParams params = SubscriptionUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -3625,6 +3737,7 @@ public void testTaxRateRetrieve() throws StripeException { @Test public void testTaxRateUpdate() throws StripeException { TaxRate resource = TaxRate.retrieve("txr_xxxxxxxxxxxxx"); + TaxRateUpdateParams params = TaxRateUpdateParams.builder().setActive(false).build(); TaxRate taxRate = resource.update(params); @@ -3683,6 +3796,7 @@ public void testConfigurationRetrieve3() throws StripeException { public void testConfigurationUpdate3() throws StripeException { com.stripe.model.terminal.Configuration resource = com.stripe.model.terminal.Configuration.retrieve("tmc_xxxxxxxxxxxxx"); + com.stripe.param.terminal.ConfigurationUpdateParams params = com.stripe.param.terminal.ConfigurationUpdateParams.builder() .setBbposWiseposE( @@ -3763,6 +3877,7 @@ public void testLocationRetrieve() throws StripeException { public void testLocationUpdate() throws StripeException { com.stripe.model.terminal.Location resource = com.stripe.model.terminal.Location.retrieve("tml_xxxxxxxxxxxxx"); + com.stripe.param.terminal.LocationUpdateParams params = com.stripe.param.terminal.LocationUpdateParams.builder() .setDisplayName("My First Store") @@ -3821,6 +3936,7 @@ public void testReaderRetrieve() throws StripeException { public void testReaderUpdate() throws StripeException { com.stripe.model.terminal.Reader resource = com.stripe.model.terminal.Reader.retrieve("tmr_xxxxxxxxxxxxx"); + com.stripe.param.terminal.ReaderUpdateParams params = com.stripe.param.terminal.ReaderUpdateParams.builder().setLabel("Blue Rabbit").build(); @@ -3834,6 +3950,7 @@ public void testReaderUpdate() throws StripeException { public void testReaderCancelAction() throws StripeException { com.stripe.model.terminal.Reader resource = com.stripe.model.terminal.Reader.retrieve("tmr_xxxxxxxxxxxxx"); + com.stripe.param.terminal.ReaderCancelActionParams params = com.stripe.param.terminal.ReaderCancelActionParams.builder().build(); @@ -3849,6 +3966,7 @@ public void testReaderCancelAction() throws StripeException { public void testReaderProcessPaymentIntent() throws StripeException { com.stripe.model.terminal.Reader resource = com.stripe.model.terminal.Reader.retrieve("tmr_xxxxxxxxxxxxx"); + com.stripe.param.terminal.ReaderProcessPaymentIntentParams params = com.stripe.param.terminal.ReaderProcessPaymentIntentParams.builder() .setPaymentIntent("pi_xxxxxxxxxxxxx") @@ -3866,6 +3984,7 @@ public void testReaderProcessPaymentIntent() throws StripeException { public void testReaderProcessSetupIntent() throws StripeException { com.stripe.model.terminal.Reader resource = com.stripe.model.terminal.Reader.retrieve("tmr_xxxxxxxxxxxxx"); + com.stripe.param.terminal.ReaderProcessSetupIntentParams params = com.stripe.param.terminal.ReaderProcessSetupIntentParams.builder() .setSetupIntent("seti_xxxxxxxxxxxxx") @@ -3928,6 +4047,7 @@ public void testTestClockRetrieve2() throws StripeException { public void testTestClockAdvance2() throws StripeException { com.stripe.model.testhelpers.TestClock resource = com.stripe.model.testhelpers.TestClock.retrieve("clock_xxxxxxxxxxxxx"); + com.stripe.param.testhelpers.TestClockAdvanceParams params = com.stripe.param.testhelpers.TestClockAdvanceParams.builder() .setFrozenTime(1675552261L) @@ -4065,6 +4185,7 @@ public void testTopupRetrieve() throws StripeException { @Test public void testTopupUpdate() throws StripeException { Topup resource = Topup.retrieve("tu_xxxxxxxxxxxxx"); + TopupUpdateParams params = TopupUpdateParams.builder().putMetadata("order_id", "6735").build(); Topup topup = resource.update(params); @@ -4075,6 +4196,7 @@ public void testTopupUpdate() throws StripeException { @Test public void testTopupCancel() throws StripeException { Topup resource = Topup.retrieve("tu_xxxxxxxxxxxxx"); + TopupCancelParams params = TopupCancelParams.builder().build(); Topup topup = resource.cancel(params); @@ -4117,6 +4239,7 @@ public void testTransferRetrieve() throws StripeException { @Test public void testTransferUpdate() throws StripeException { Transfer resource = Transfer.retrieve("tr_xxxxxxxxxxxxx"); + TransferUpdateParams params = TransferUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -4128,6 +4251,7 @@ public void testTransferUpdate() throws StripeException { @Test public void testTransferReversalList() throws StripeException { Transfer transfer = Transfer.retrieve("tr_xxxxxxxxxxxxx"); + TransferReversalCollectionListParams params = TransferReversalCollectionListParams.builder().setLimit(3L).build(); @@ -4140,6 +4264,7 @@ public void testTransferReversalList() throws StripeException { @Test public void testTransferReversalCreate() throws StripeException { Transfer transfer = Transfer.retrieve("tr_xxxxxxxxxxxxx"); + TransferReversalCollectionCreateParams params = TransferReversalCollectionCreateParams.builder().setAmount(100L).build(); @@ -4163,7 +4288,9 @@ public void testTransferReversalRetrieve() throws StripeException { @Test public void testTransferReversalUpdate() throws StripeException { Transfer transfer = Transfer.retrieve("tr_xxxxxxxxxxxxx"); + TransferReversal resource = transfer.getReversals().retrieve("trr_xxxxxxxxxxxxx"); + TransferReversalUpdateParams params = TransferReversalUpdateParams.builder().putMetadata("order_id", "6735").build(); @@ -4287,6 +4414,7 @@ public void testFinancialAccountRetrieve() throws StripeException { public void testFinancialAccountUpdate() throws StripeException { com.stripe.model.treasury.FinancialAccount resource = com.stripe.model.treasury.FinancialAccount.retrieve("fa_xxxxxxxxxxxxx"); + com.stripe.param.treasury.FinancialAccountUpdateParams params = com.stripe.param.treasury.FinancialAccountUpdateParams.builder() .putMetadata("order_id", "6735") @@ -4304,6 +4432,7 @@ public void testFinancialAccountUpdate() throws StripeException { public void testFinancialAccountRetrieveFeatures() throws StripeException { com.stripe.model.treasury.FinancialAccount resource = com.stripe.model.treasury.FinancialAccount.retrieve("fa_xxxxxxxxxxxxx"); + com.stripe.param.treasury.FinancialAccountRetrieveFeaturesParams params = com.stripe.param.treasury.FinancialAccountRetrieveFeaturesParams.builder().build(); @@ -4360,6 +4489,7 @@ public void testInboundTransferRetrieve() throws StripeException { public void testInboundTransferCancel() throws StripeException { com.stripe.model.treasury.InboundTransfer resource = com.stripe.model.treasury.InboundTransfer.retrieve("ibt_xxxxxxxxxxxxx"); + com.stripe.param.treasury.InboundTransferCancelParams params = com.stripe.param.treasury.InboundTransferCancelParams.builder().build(); @@ -4416,6 +4546,7 @@ public void testOutboundPaymentRetrieve() throws StripeException { public void testOutboundPaymentCancel() throws StripeException { com.stripe.model.treasury.OutboundPayment resource = com.stripe.model.treasury.OutboundPayment.retrieve("bot_xxxxxxxxxxxxx"); + com.stripe.param.treasury.OutboundPaymentCancelParams params = com.stripe.param.treasury.OutboundPaymentCancelParams.builder().build(); @@ -4472,6 +4603,7 @@ public void testOutboundTransferRetrieve() throws StripeException { public void testOutboundTransferCancel() throws StripeException { com.stripe.model.treasury.OutboundTransfer resource = com.stripe.model.treasury.OutboundTransfer.retrieve("obt_xxxxxxxxxxxxx"); + com.stripe.param.treasury.OutboundTransferCancelParams params = com.stripe.param.treasury.OutboundTransferCancelParams.builder().build(); @@ -4615,6 +4747,7 @@ public void testWebhookEndpointRetrieve() throws StripeException { @Test public void testWebhookEndpointUpdate() throws StripeException { WebhookEndpoint resource = WebhookEndpoint.retrieve("we_xxxxxxxxxxxxx"); + WebhookEndpointUpdateParams params = WebhookEndpointUpdateParams.builder().setUrl("https://example.com/new_endpoint").build(); @@ -4666,6 +4799,7 @@ public void testPaymentIntentCreate3() throws StripeException { @Test public void testQuoteListLineItems() throws StripeException { Quote resource = Quote.retrieve("qt_xxxxxxxxxxxxx"); + QuoteListLineItemsParams params = QuoteListLineItemsParams.builder().build(); LineItemCollection lineItems = resource.listLineItems(params);