From 7ef2118114a37a08a819da6945ac508d23ba9ad7 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:42:02 -0700 Subject: [PATCH] Update generated code (#1835) * Update generated code for v1117 * Update generated code for v1118 * Update generated code for v1120 * Update generated code for v1121 * Update generated code for v1123 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- .../com/stripe/model/ConfirmationToken.java | 25 + .../com/stripe/model/CustomerSession.java | 102 +++ .../java/com/stripe/model/StripeError.java | 9 +- .../java/com/stripe/model/Subscription.java | 32 +- .../stripe/model/billingportal/Session.java | 4 +- .../java/com/stripe/model/issuing/Card.java | 31 + .../param/CustomerSessionCreateParams.java | 464 ++++++++++++- .../param/issuing/CardCreateParams.java | 104 +++ .../param/issuing/CardUpdateParams.java | 609 ++++++++++++++++++ .../stripe/service/SubscriptionService.java | 32 +- 11 files changed, 1378 insertions(+), 36 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index dbdf3c1cbaa..af6e3683894 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1116 \ No newline at end of file +v1123 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/ConfirmationToken.java b/src/main/java/com/stripe/model/ConfirmationToken.java index 9c44b46fead..59c82af2303 100644 --- a/src/main/java/com/stripe/model/ConfirmationToken.java +++ b/src/main/java/com/stripe/model/ConfirmationToken.java @@ -74,6 +74,10 @@ public class ConfirmationToken extends ApiResource implements HasId { @SerializedName("payment_intent") String paymentIntent; + /** Payment-method-specific configuration for this ConfirmationToken. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + /** * Payment details collected by the Payment Element, used to create a PaymentMethod when a * PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. @@ -198,6 +202,26 @@ public static class Online extends StripeObject { } } + /** Payment-method-specific configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodOptions extends StripeObject { + /** This hash contains the card payment method options. */ + @SerializedName("card") + Card card; + + /** This hash contains the card payment method options. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** The {@code cvc_update} Token collected from the Payment Element. */ + @SerializedName("cvc_token") + String cvcToken; + } + } + /** Details of the PaymentMethod collected by Payment Element. */ @Getter @Setter @@ -1738,6 +1762,7 @@ public static ConfirmationToken create( public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(mandateData, responseGetter); + trySetResponseGetter(paymentMethodOptions, responseGetter); trySetResponseGetter(paymentMethodPreview, responseGetter); trySetResponseGetter(shipping, responseGetter); } diff --git a/src/main/java/com/stripe/model/CustomerSession.java b/src/main/java/com/stripe/model/CustomerSession.java index 027e7561f05..5fe077f89ad 100644 --- a/src/main/java/com/stripe/model/CustomerSession.java +++ b/src/main/java/com/stripe/model/CustomerSession.java @@ -11,6 +11,7 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.CustomerSessionCreateParams; +import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -143,6 +144,10 @@ public static class Components extends StripeObject { @SerializedName("buy_button") BuyButton buyButton; + /** This hash contains whether the Payment Element is enabled and the features it supports. */ + @SerializedName("payment_element") + PaymentElement paymentElement; + /** This hash contains whether the pricing table is enabled. */ @SerializedName("pricing_table") PricingTable pricingTable; @@ -157,6 +162,103 @@ public static class BuyButton extends StripeObject { Boolean enabled; } + /** This hash contains whether the Payment Element is enabled and the features it supports. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentElement extends StripeObject { + /** Whether the Payment Element is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** This hash defines whether the Payment Element supports certain features. */ + @SerializedName("features") + Features features; + + /** This hash contains the features the Payment Element supports. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Features extends StripeObject { + /** + * A list of {@code + * allow_redisplay} values that controls which saved payment methods the Payment Element + * displays by filtering to only show payment methods with an {@code allow_redisplay} value + * that is present in this list. + * + *

If not specified, defaults to ["always"]. In order to display all saved + * payment methods, specify ["always", "limited", + * "unspecified"]. + */ + @SerializedName("payment_method_allow_redisplay_filters") + List paymentMethodAllowRedisplayFilters; + + /** + * Controls whether or not the Payment Element shows saved payment methods. This parameter + * defaults to {@code disabled}. + * + *

One of {@code disabled}, or {@code enabled}. + */ + @SerializedName("payment_method_redisplay") + String paymentMethodRedisplay; + + /** + * Determines the max number of saved payment methods for the Payment Element to display. + * This parameter defaults to {@code 10}. + */ + @SerializedName("payment_method_redisplay_limit") + Long paymentMethodRedisplayLimit; + + /** + * Controls whether the Payment Element displays the option to remove a saved payment + * method. This parameter defaults to {@code disabled}. + * + *

Allowing buyers to remove their saved payment methods impacts subscriptions that + * depend on that payment method. Removing the payment method detaches the {@code + * customer} object from that PaymentMethod. + * + *

One of {@code disabled}, or {@code enabled}. + */ + @SerializedName("payment_method_remove") + String paymentMethodRemove; + + /** + * Controls whether the Payment Element displays a checkbox offering to save a new payment + * method. This parameter defaults to {@code disabled}. + * + *

If a customer checks the box, the {@code + * allow_redisplay} value on the PaymentMethod is set to {@code 'always'} at + * confirmation time. For PaymentIntents, the {@code + * setup_future_usage} value is also set to the value defined in {@code + * payment_method_save_usage}. + * + *

One of {@code disabled}, or {@code enabled}. + */ + @SerializedName("payment_method_save") + String paymentMethodSave; + + /** + * When using PaymentIntents and the customer checks the save checkbox, this field + * determines the {@code + * setup_future_usage} value used to confirm the PaymentIntent. + * + *

When using SetupIntents, directly configure the {@code + * usage} value on SetupIntent creation. + * + *

One of {@code off_session}, or {@code on_session}. + */ + @SerializedName("payment_method_save_usage") + String paymentMethodSaveUsage; + } + } + /** This hash contains whether the pricing table is enabled. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/StripeError.java b/src/main/java/com/stripe/model/StripeError.java index 44b63d7b428..8015a29e871 100644 --- a/src/main/java/com/stripe/model/StripeError.java +++ b/src/main/java/com/stripe/model/StripeError.java @@ -27,10 +27,7 @@ public class StripeError extends StripeObject { * bank_account_bad_routing_numbers}, {@code bank_account_declined}, {@code bank_account_exists}, * {@code bank_account_restricted}, {@code bank_account_unusable}, {@code * bank_account_unverified}, {@code bank_account_verification_failed}, {@code - * billing_invalid_mandate}, {@code billing_policy_remote_function_response_invalid}, {@code - * billing_policy_remote_function_timeout}, {@code - * billing_policy_remote_function_unexpected_status_code}, {@code - * billing_policy_remote_function_unreachable}, {@code bitcoin_upgrade_required}, {@code + * billing_invalid_mandate}, {@code bitcoin_upgrade_required}, {@code * capture_charge_authorization_expired}, {@code capture_unauthorized_payment}, {@code * card_decline_rate_limit_exceeded}, {@code card_declined}, {@code * cardholder_phone_number_required}, {@code charge_already_captured}, {@code @@ -60,8 +57,8 @@ public class StripeError extends StripeObject { * parameter_invalid_integer}, {@code parameter_invalid_string_blank}, {@code * parameter_invalid_string_empty}, {@code parameter_missing}, {@code parameter_unknown}, {@code * parameters_exclusive}, {@code payment_intent_action_required}, {@code - * payment_intent_authentication_failure}, {@code payment_intent_fx_quote_invalid}, {@code - * payment_intent_incompatible_payment_method}, {@code payment_intent_invalid_parameter}, {@code + * payment_intent_authentication_failure}, {@code payment_intent_incompatible_payment_method}, + * {@code payment_intent_invalid_parameter}, {@code * payment_intent_konbini_rejected_confirmation_number}, {@code payment_intent_mandate_invalid}, * {@code payment_intent_payment_attempt_expired}, {@code payment_intent_payment_attempt_failed}, * {@code payment_intent_unexpected_state}, {@code payment_method_bank_account_already_verified}, diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index 844c8d60aac..12170567036 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -1064,7 +1064,7 @@ public static SubscriptionSearchResult search( * Updates an existing subscription to match the specified parameters. When changing prices or * quantities, we optionally prorate the price we charge next month to make up for any price * changes. To preview how the proration is calculated, use the upcoming invoice endpoint. + * href="https://stripe.com/docs/api/invoices/create_preview">create preview endpoint. * *

By default, we prorate subscription changes. For example, if a customer signs up on May 1 * for a 100 price, they’ll be billed 100 immediately. If on May 15 they switch to a 200 price, @@ -1080,12 +1080,14 @@ public static SubscriptionSearchResult search( * *

* *

In these cases, we apply a credit for the unused time on the previous price, immediately - * charge the customer using the new price, and reset the billing date. + * charge the customer using the new price, and reset the billing date. Learn about how Stripe + * immediately attempts payment for subscription changes. * *

If you want to charge for an upgrade immediately, pass {@code proration_behavior} as {@code * always_invoice} to create prorations, automatically invoice the customer for those proration @@ -1115,7 +1117,7 @@ public Subscription update(Map params) throws StripeException { * Updates an existing subscription to match the specified parameters. When changing prices or * quantities, we optionally prorate the price we charge next month to make up for any price * changes. To preview how the proration is calculated, use the upcoming invoice endpoint. + * href="https://stripe.com/docs/api/invoices/create_preview">create preview endpoint. * *

By default, we prorate subscription changes. For example, if a customer signs up on May 1 * for a 100 price, they’ll be billed 100 immediately. If on May 15 they switch to a 200 price, @@ -1131,12 +1133,14 @@ public Subscription update(Map params) throws StripeException { * *

* *

In these cases, we apply a credit for the unused time on the previous price, immediately - * charge the customer using the new price, and reset the billing date. + * charge the customer using the new price, and reset the billing date. Learn about how Stripe + * immediately attempts payment for subscription changes. * *

If you want to charge for an upgrade immediately, pass {@code proration_behavior} as {@code * always_invoice} to create prorations, automatically invoice the customer for those proration @@ -1171,7 +1175,7 @@ public Subscription update(Map params, RequestOptions options) * Updates an existing subscription to match the specified parameters. When changing prices or * quantities, we optionally prorate the price we charge next month to make up for any price * changes. To preview how the proration is calculated, use the upcoming invoice endpoint. + * href="https://stripe.com/docs/api/invoices/create_preview">create preview endpoint. * *

By default, we prorate subscription changes. For example, if a customer signs up on May 1 * for a 100 price, they’ll be billed 100 immediately. If on May 15 they switch to a 200 price, @@ -1187,12 +1191,14 @@ public Subscription update(Map params, RequestOptions options) * *

* *

In these cases, we apply a credit for the unused time on the previous price, immediately - * charge the customer using the new price, and reset the billing date. + * charge the customer using the new price, and reset the billing date. Learn about how Stripe + * immediately attempts payment for subscription changes. * *

If you want to charge for an upgrade immediately, pass {@code proration_behavior} as {@code * always_invoice} to create prorations, automatically invoice the customer for those proration @@ -1221,7 +1227,7 @@ public Subscription update(SubscriptionUpdateParams params) throws StripeExcepti * Updates an existing subscription to match the specified parameters. When changing prices or * quantities, we optionally prorate the price we charge next month to make up for any price * changes. To preview how the proration is calculated, use the upcoming invoice endpoint. + * href="https://stripe.com/docs/api/invoices/create_preview">create preview endpoint. * *

By default, we prorate subscription changes. For example, if a customer signs up on May 1 * for a 100 price, they’ll be billed 100 immediately. If on May 15 they switch to a 200 price, @@ -1237,12 +1243,14 @@ public Subscription update(SubscriptionUpdateParams params) throws StripeExcepti * *

* *

In these cases, we apply a credit for the unused time on the previous price, immediately - * charge the customer using the new price, and reset the billing date. + * charge the customer using the new price, and reset the billing date. Learn about how Stripe + * immediately attempts payment for subscription changes. * *

If you want to charge for an upgrade immediately, pass {@code proration_behavior} as {@code * always_invoice} to create prorations, automatically invoice the customer for those proration diff --git a/src/main/java/com/stripe/model/billingportal/Session.java b/src/main/java/com/stripe/model/billingportal/Session.java index 2cf4596b9c5..a7806c45a4d 100644 --- a/src/main/java/com/stripe/model/billingportal/Session.java +++ b/src/main/java/com/stripe/model/billingportal/Session.java @@ -32,9 +32,7 @@ * URL. Create sessions on-demand when customers intend to manage their subscriptions and billing * details. * - *

Learn more in the integration - * guide. + *

Related guide: Customer management */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/issuing/Card.java b/src/main/java/com/stripe/model/issuing/Card.java index 340fb52ff41..3c4e86a2460 100644 --- a/src/main/java/com/stripe/model/issuing/Card.java +++ b/src/main/java/com/stripe/model/issuing/Card.java @@ -422,6 +422,10 @@ public static class Shipping extends StripeObject { @SerializedName("address") Address address; + /** Address validation details for the shipment. */ + @SerializedName("address_validation") + AddressValidation addressValidation; + /** * The delivery company that shipped a card. * @@ -495,6 +499,33 @@ public static class Shipping extends StripeObject { @SerializedName("type") String type; + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AddressValidation extends StripeObject { + /** + * The address validation capabilities to use. + * + *

One of {@code disabled}, {@code normalization_only}, or {@code + * validation_and_normalization}. + */ + @SerializedName("mode") + String mode; + + /** The normalized shipping address. */ + @SerializedName("normalized_address") + Address normalizedAddress; + + /** + * The validation result for the shipping address. + * + *

One of {@code indeterminate}, {@code likely_deliverable}, or {@code + * likely_undeliverable}. + */ + @SerializedName("result") + String result; + } + @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/param/CustomerSessionCreateParams.java b/src/main/java/com/stripe/param/CustomerSessionCreateParams.java index ce92a07bfeb..0d6e393f76b 100644 --- a/src/main/java/com/stripe/param/CustomerSessionCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerSessionCreateParams.java @@ -154,14 +154,22 @@ public static class Components { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Configuration for the Payment Element. */ + @SerializedName("payment_element") + PaymentElement paymentElement; + /** Configuration for the pricing table. */ @SerializedName("pricing_table") PricingTable pricingTable; private Components( - BuyButton buyButton, Map extraParams, PricingTable pricingTable) { + BuyButton buyButton, + Map extraParams, + PaymentElement paymentElement, + PricingTable pricingTable) { this.buyButton = buyButton; this.extraParams = extraParams; + this.paymentElement = paymentElement; this.pricingTable = pricingTable; } @@ -174,12 +182,14 @@ public static class Builder { private Map extraParams; + private PaymentElement paymentElement; + private PricingTable pricingTable; /** Finalize and obtain parameter instance from this builder. */ public CustomerSessionCreateParams.Components build() { return new CustomerSessionCreateParams.Components( - this.buyButton, this.extraParams, this.pricingTable); + this.buyButton, this.extraParams, this.paymentElement, this.pricingTable); } /** Configuration for buy button. */ @@ -214,6 +224,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Configuration for the Payment Element. */ + public Builder setPaymentElement( + CustomerSessionCreateParams.Components.PaymentElement paymentElement) { + this.paymentElement = paymentElement; + return this; + } + /** Configuration for the pricing table. */ public Builder setPricingTable( CustomerSessionCreateParams.Components.PricingTable pricingTable) { @@ -293,6 +310,449 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class PaymentElement { + /** Required. Whether the Payment Element is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * 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; + + /** This hash defines whether the Payment Element supports certain features. */ + @SerializedName("features") + Features features; + + private PaymentElement(Boolean enabled, Map extraParams, Features features) { + this.enabled = enabled; + this.extraParams = extraParams; + this.features = features; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Features features; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerSessionCreateParams.Components.PaymentElement build() { + return new CustomerSessionCreateParams.Components.PaymentElement( + this.enabled, this.extraParams, this.features); + } + + /** Required. Whether the Payment Element is enabled. */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + 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 CustomerSessionCreateParams.Components.PaymentElement#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 CustomerSessionCreateParams.Components.PaymentElement#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** This hash defines whether the Payment Element supports certain features. */ + public Builder setFeatures( + CustomerSessionCreateParams.Components.PaymentElement.Features features) { + this.features = features; + return this; + } + } + + @Getter + public static class Features { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A list of {@code + * allow_redisplay} values that controls which saved payment methods the Payment Element + * displays by filtering to only show payment methods with an {@code allow_redisplay} value + * that is present in this list. + * + *

If not specified, defaults to ["always"]. In order to display all saved + * payment methods, specify ["always", "limited", + * "unspecified"]. + */ + @SerializedName("payment_method_allow_redisplay_filters") + List< + CustomerSessionCreateParams.Components.PaymentElement.Features + .PaymentMethodAllowRedisplayFilter> + paymentMethodAllowRedisplayFilters; + + /** + * Controls whether or not the Payment Element shows saved payment methods. This parameter + * defaults to {@code disabled}. + */ + @SerializedName("payment_method_redisplay") + PaymentMethodRedisplay paymentMethodRedisplay; + + /** + * Determines the max number of saved payment methods for the Payment Element to display. + * This parameter defaults to {@code 10}. + */ + @SerializedName("payment_method_redisplay_limit") + Long paymentMethodRedisplayLimit; + + /** + * Controls whether the Payment Element displays the option to remove a saved payment + * method. This parameter defaults to {@code disabled}. + * + *

Allowing buyers to remove their saved payment methods impacts subscriptions that + * depend on that payment method. Removing the payment method detaches the {@code + * customer} object from that PaymentMethod. + */ + @SerializedName("payment_method_remove") + PaymentMethodRemove paymentMethodRemove; + + /** + * Controls whether the Payment Element displays a checkbox offering to save a new payment + * method. This parameter defaults to {@code disabled}. + * + *

If a customer checks the box, the {@code + * allow_redisplay} value on the PaymentMethod is set to {@code 'always'} at + * confirmation time. For PaymentIntents, the {@code + * setup_future_usage} value is also set to the value defined in {@code + * payment_method_save_usage}. + */ + @SerializedName("payment_method_save") + PaymentMethodSave paymentMethodSave; + + /** + * When using PaymentIntents and the customer checks the save checkbox, this field + * determines the {@code + * setup_future_usage} value used to confirm the PaymentIntent. + * + *

When using SetupIntents, directly configure the {@code + * usage} value on SetupIntent creation. + */ + @SerializedName("payment_method_save_usage") + PaymentMethodSaveUsage paymentMethodSaveUsage; + + private Features( + Map extraParams, + List< + CustomerSessionCreateParams.Components.PaymentElement.Features + .PaymentMethodAllowRedisplayFilter> + paymentMethodAllowRedisplayFilters, + PaymentMethodRedisplay paymentMethodRedisplay, + Long paymentMethodRedisplayLimit, + PaymentMethodRemove paymentMethodRemove, + PaymentMethodSave paymentMethodSave, + PaymentMethodSaveUsage paymentMethodSaveUsage) { + this.extraParams = extraParams; + this.paymentMethodAllowRedisplayFilters = paymentMethodAllowRedisplayFilters; + this.paymentMethodRedisplay = paymentMethodRedisplay; + this.paymentMethodRedisplayLimit = paymentMethodRedisplayLimit; + this.paymentMethodRemove = paymentMethodRemove; + this.paymentMethodSave = paymentMethodSave; + this.paymentMethodSaveUsage = paymentMethodSaveUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List< + CustomerSessionCreateParams.Components.PaymentElement.Features + .PaymentMethodAllowRedisplayFilter> + paymentMethodAllowRedisplayFilters; + + private PaymentMethodRedisplay paymentMethodRedisplay; + + private Long paymentMethodRedisplayLimit; + + private PaymentMethodRemove paymentMethodRemove; + + private PaymentMethodSave paymentMethodSave; + + private PaymentMethodSaveUsage paymentMethodSaveUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerSessionCreateParams.Components.PaymentElement.Features build() { + return new CustomerSessionCreateParams.Components.PaymentElement.Features( + this.extraParams, + this.paymentMethodAllowRedisplayFilters, + this.paymentMethodRedisplay, + this.paymentMethodRedisplayLimit, + this.paymentMethodRemove, + this.paymentMethodSave, + this.paymentMethodSaveUsage); + } + + /** + * 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 + * CustomerSessionCreateParams.Components.PaymentElement.Features#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 + * CustomerSessionCreateParams.Components.PaymentElement.Features#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `paymentMethodAllowRedisplayFilters` list. A list is initialized for + * the first `add/addAll` call, and subsequent calls adds additional elements to the + * original list. See {@link + * CustomerSessionCreateParams.Components.PaymentElement.Features#paymentMethodAllowRedisplayFilters} + * for the field documentation. + */ + public Builder addPaymentMethodAllowRedisplayFilter( + CustomerSessionCreateParams.Components.PaymentElement.Features + .PaymentMethodAllowRedisplayFilter + element) { + if (this.paymentMethodAllowRedisplayFilters == null) { + this.paymentMethodAllowRedisplayFilters = new ArrayList<>(); + } + this.paymentMethodAllowRedisplayFilters.add(element); + return this; + } + + /** + * Add all elements to `paymentMethodAllowRedisplayFilters` list. A list is initialized + * for the first `add/addAll` call, and subsequent calls adds additional elements to the + * original list. See {@link + * CustomerSessionCreateParams.Components.PaymentElement.Features#paymentMethodAllowRedisplayFilters} + * for the field documentation. + */ + public Builder addAllPaymentMethodAllowRedisplayFilter( + List< + CustomerSessionCreateParams.Components.PaymentElement.Features + .PaymentMethodAllowRedisplayFilter> + elements) { + if (this.paymentMethodAllowRedisplayFilters == null) { + this.paymentMethodAllowRedisplayFilters = new ArrayList<>(); + } + this.paymentMethodAllowRedisplayFilters.addAll(elements); + return this; + } + + /** + * Controls whether or not the Payment Element shows saved payment methods. This parameter + * defaults to {@code disabled}. + */ + public Builder setPaymentMethodRedisplay( + CustomerSessionCreateParams.Components.PaymentElement.Features.PaymentMethodRedisplay + paymentMethodRedisplay) { + this.paymentMethodRedisplay = paymentMethodRedisplay; + return this; + } + + /** + * Determines the max number of saved payment methods for the Payment Element to display. + * This parameter defaults to {@code 10}. + */ + public Builder setPaymentMethodRedisplayLimit(Long paymentMethodRedisplayLimit) { + this.paymentMethodRedisplayLimit = paymentMethodRedisplayLimit; + return this; + } + + /** + * Controls whether the Payment Element displays the option to remove a saved payment + * method. This parameter defaults to {@code disabled}. + * + *

Allowing buyers to remove their saved payment methods impacts subscriptions that + * depend on that payment method. Removing the payment method detaches the {@code + * customer} object from that PaymentMethod. + */ + public Builder setPaymentMethodRemove( + CustomerSessionCreateParams.Components.PaymentElement.Features.PaymentMethodRemove + paymentMethodRemove) { + this.paymentMethodRemove = paymentMethodRemove; + return this; + } + + /** + * Controls whether the Payment Element displays a checkbox offering to save a new payment + * method. This parameter defaults to {@code disabled}. + * + *

If a customer checks the box, the {@code + * allow_redisplay} value on the PaymentMethod is set to {@code 'always'} at + * confirmation time. For PaymentIntents, the {@code + * setup_future_usage} value is also set to the value defined in {@code + * payment_method_save_usage}. + */ + public Builder setPaymentMethodSave( + CustomerSessionCreateParams.Components.PaymentElement.Features.PaymentMethodSave + paymentMethodSave) { + this.paymentMethodSave = paymentMethodSave; + return this; + } + + /** + * When using PaymentIntents and the customer checks the save checkbox, this field + * determines the {@code + * setup_future_usage} value used to confirm the PaymentIntent. + * + *

When using SetupIntents, directly configure the {@code + * usage} value on SetupIntent creation. + */ + public Builder setPaymentMethodSaveUsage( + CustomerSessionCreateParams.Components.PaymentElement.Features.PaymentMethodSaveUsage + paymentMethodSaveUsage) { + this.paymentMethodSaveUsage = paymentMethodSaveUsage; + return this; + } + } + + public enum PaymentMethodAllowRedisplayFilter implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("limited") + LIMITED("limited"), + + @SerializedName("unspecified") + UNSPECIFIED("unspecified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodAllowRedisplayFilter(String value) { + this.value = value; + } + } + + public enum PaymentMethodRedisplay implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodRedisplay(String value) { + this.value = value; + } + } + + public enum PaymentMethodRemove implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodRemove(String value) { + this.value = value; + } + } + + public enum PaymentMethodSave implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodSave(String value) { + this.value = value; + } + } + + public enum PaymentMethodSaveUsage implements ApiRequestParams.EnumParam { + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodSaveUsage(String value) { + this.value = value; + } + } + } + } + @Getter public static class PricingTable { /** Required. Whether the pricing table is enabled. */ diff --git a/src/main/java/com/stripe/param/issuing/CardCreateParams.java b/src/main/java/com/stripe/param/issuing/CardCreateParams.java index cf156bde2aa..05255297042 100644 --- a/src/main/java/com/stripe/param/issuing/CardCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardCreateParams.java @@ -430,6 +430,10 @@ public static class Shipping { @SerializedName("address") Address address; + /** Address validation settings. */ + @SerializedName("address_validation") + AddressValidation addressValidation; + /** Customs information for the shipment. */ @SerializedName("customs") Customs customs; @@ -465,6 +469,7 @@ public static class Shipping { private Shipping( Address address, + AddressValidation addressValidation, Customs customs, Map extraParams, String name, @@ -473,6 +478,7 @@ private Shipping( Service service, Type type) { this.address = address; + this.addressValidation = addressValidation; this.customs = customs; this.extraParams = extraParams; this.name = name; @@ -489,6 +495,8 @@ public static Builder builder() { public static class Builder { private Address address; + private AddressValidation addressValidation; + private Customs customs; private Map extraParams; @@ -507,6 +515,7 @@ public static class Builder { public CardCreateParams.Shipping build() { return new CardCreateParams.Shipping( this.address, + this.addressValidation, this.customs, this.extraParams, this.name, @@ -522,6 +531,13 @@ public Builder setAddress(CardCreateParams.Shipping.Address address) { return this; } + /** Address validation settings. */ + public Builder setAddressValidation( + CardCreateParams.Shipping.AddressValidation addressValidation) { + this.addressValidation = addressValidation; + return this; + } + /** Customs information for the shipment. */ public Builder setCustoms(CardCreateParams.Shipping.Customs customs) { this.customs = customs; @@ -742,6 +758,94 @@ public Builder setState(String state) { } } + @Getter + public static class AddressValidation { + /** + * 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; + + /** Required. The address validation capabilities to use. */ + @SerializedName("mode") + Mode mode; + + private AddressValidation(Map extraParams, Mode mode) { + this.extraParams = extraParams; + this.mode = mode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Mode mode; + + /** Finalize and obtain parameter instance from this builder. */ + public CardCreateParams.Shipping.AddressValidation build() { + return new CardCreateParams.Shipping.AddressValidation(this.extraParams, this.mode); + } + + /** + * 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 CardCreateParams.Shipping.AddressValidation#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 CardCreateParams.Shipping.AddressValidation#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The address validation capabilities to use. */ + public Builder setMode(CardCreateParams.Shipping.AddressValidation.Mode mode) { + this.mode = mode; + return this; + } + } + + public enum Mode implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("normalization_only") + NORMALIZATION_ONLY("normalization_only"), + + @SerializedName("validation_and_normalization") + VALIDATION_AND_NORMALIZATION("validation_and_normalization"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Mode(String value) { + this.value = value; + } + } + } + @Getter public static class Customs { /** diff --git a/src/main/java/com/stripe/param/issuing/CardUpdateParams.java b/src/main/java/com/stripe/param/issuing/CardUpdateParams.java index 7579c1cc6b0..aa34c449777 100644 --- a/src/main/java/com/stripe/param/issuing/CardUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardUpdateParams.java @@ -45,6 +45,10 @@ public class CardUpdateParams extends ApiRequestParams { @SerializedName("pin") Pin pin; + /** Updated shipping information for the card. */ + @SerializedName("shipping") + Shipping shipping; + /** * Rules that control spending for this card. Refer to our documentation for more @@ -69,6 +73,7 @@ private CardUpdateParams( Object metadata, Object personalizationDesign, Pin pin, + Shipping shipping, SpendingControls spendingControls, Status status) { this.cancellationReason = cancellationReason; @@ -77,6 +82,7 @@ private CardUpdateParams( this.metadata = metadata; this.personalizationDesign = personalizationDesign; this.pin = pin; + this.shipping = shipping; this.spendingControls = spendingControls; this.status = status; } @@ -98,6 +104,8 @@ public static class Builder { private Pin pin; + private Shipping shipping; + private SpendingControls spendingControls; private Status status; @@ -111,6 +119,7 @@ public CardUpdateParams build() { this.metadata, this.personalizationDesign, this.pin, + this.shipping, this.spendingControls, this.status); } @@ -239,6 +248,12 @@ public Builder setPin(CardUpdateParams.Pin pin) { return this; } + /** Updated shipping information for the card. */ + public Builder setShipping(CardUpdateParams.Shipping shipping) { + this.shipping = shipping; + return this; + } + /** * Rules that control spending for this card. Refer to our documentation for more @@ -335,6 +350,600 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class Shipping { + /** Required. The address that the card is shipped to. */ + @SerializedName("address") + Address address; + + /** Address validation settings. */ + @SerializedName("address_validation") + AddressValidation addressValidation; + + /** Customs information for the shipment. */ + @SerializedName("customs") + Customs customs; + + /** + * 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; + + /** Required. The name printed on the shipping label when shipping the card. */ + @SerializedName("name") + Object name; + + /** Phone number of the recipient of the shipment. */ + @SerializedName("phone_number") + Object phoneNumber; + + /** Whether a signature is required for card delivery. */ + @SerializedName("require_signature") + Boolean requireSignature; + + /** Shipment service. */ + @SerializedName("service") + Service service; + + /** Packaging options. */ + @SerializedName("type") + Type type; + + private Shipping( + Address address, + AddressValidation addressValidation, + Customs customs, + Map extraParams, + Object name, + Object phoneNumber, + Boolean requireSignature, + Service service, + Type type) { + this.address = address; + this.addressValidation = addressValidation; + this.customs = customs; + this.extraParams = extraParams; + this.name = name; + this.phoneNumber = phoneNumber; + this.requireSignature = requireSignature; + this.service = service; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private AddressValidation addressValidation; + + private Customs customs; + + private Map extraParams; + + private Object name; + + private Object phoneNumber; + + private Boolean requireSignature; + + private Service service; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public CardUpdateParams.Shipping build() { + return new CardUpdateParams.Shipping( + this.address, + this.addressValidation, + this.customs, + this.extraParams, + this.name, + this.phoneNumber, + this.requireSignature, + this.service, + this.type); + } + + /** Required. The address that the card is shipped to. */ + public Builder setAddress(CardUpdateParams.Shipping.Address address) { + this.address = address; + return this; + } + + /** Address validation settings. */ + public Builder setAddressValidation( + CardUpdateParams.Shipping.AddressValidation addressValidation) { + this.addressValidation = addressValidation; + return this; + } + + /** Customs information for the shipment. */ + public Builder setCustoms(CardUpdateParams.Shipping.Customs customs) { + this.customs = customs; + 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 + * CardUpdateParams.Shipping#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link CardUpdateParams.Shipping#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. The name printed on the shipping label when shipping the card. + */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** + * Required. The name printed on the shipping label when shipping the card. + */ + public Builder setName(EmptyParam name) { + this.name = name; + return this; + } + + /** Phone number of the recipient of the shipment. */ + public Builder setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** Phone number of the recipient of the shipment. */ + public Builder setPhoneNumber(EmptyParam phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** Whether a signature is required for card delivery. */ + public Builder setRequireSignature(Boolean requireSignature) { + this.requireSignature = requireSignature; + return this; + } + + /** Shipment service. */ + public Builder setService(CardUpdateParams.Shipping.Service service) { + this.service = service; + return this; + } + + /** Packaging options. */ + public Builder setType(CardUpdateParams.Shipping.Type type) { + this.type = type; + return this; + } + } + + @Getter + public static class Address { + /** Required. City, district, suburb, town, or village. */ + @SerializedName("city") + Object city; + + /** + * Required. 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; + + /** Required. 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; + + /** Required. ZIP or postal code. */ + @SerializedName("postal_code") + Object postalCode; + + /** State, county, province, or region. */ + @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 CardUpdateParams.Shipping.Address build() { + return new CardUpdateParams.Shipping.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** Required. City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** Required. City, district, suburb, town, or village. */ + public Builder setCity(EmptyParam city) { + this.city = city; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + return this; + } + + /** + * Required. 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 CardUpdateParams.Shipping.Address#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CardUpdateParams.Shipping.Address#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. Address line 1 (e.g., street, PO Box, or company name). */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Required. 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; + } + + /** Required. ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** Required. ZIP or postal code. */ + public Builder setPostalCode(EmptyParam postalCode) { + this.postalCode = postalCode; + return this; + } + + /** State, county, province, or region. */ + public Builder setState(String state) { + this.state = state; + return this; + } + + /** State, county, province, or region. */ + public Builder setState(EmptyParam state) { + this.state = state; + return this; + } + } + } + + @Getter + public static class AddressValidation { + /** + * 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; + + /** Required. The address validation capabilities to use. */ + @SerializedName("mode") + Mode mode; + + private AddressValidation(Map extraParams, Mode mode) { + this.extraParams = extraParams; + this.mode = mode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Mode mode; + + /** Finalize and obtain parameter instance from this builder. */ + public CardUpdateParams.Shipping.AddressValidation build() { + return new CardUpdateParams.Shipping.AddressValidation(this.extraParams, this.mode); + } + + /** + * 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 CardUpdateParams.Shipping.AddressValidation#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 CardUpdateParams.Shipping.AddressValidation#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The address validation capabilities to use. */ + public Builder setMode(CardUpdateParams.Shipping.AddressValidation.Mode mode) { + this.mode = mode; + return this; + } + } + + public enum Mode implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("normalization_only") + NORMALIZATION_ONLY("normalization_only"), + + @SerializedName("validation_and_normalization") + VALIDATION_AND_NORMALIZATION("validation_and_normalization"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Mode(String value) { + this.value = value; + } + } + } + + @Getter + public static class Customs { + /** + * The Economic Operators Registration and Identification (EORI) number to use for Customs. + * Required for bulk shipments to Europe. + */ + @SerializedName("eori_number") + Object eoriNumber; + + /** + * 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 Customs(Object eoriNumber, Map extraParams) { + this.eoriNumber = eoriNumber; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object eoriNumber; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CardUpdateParams.Shipping.Customs build() { + return new CardUpdateParams.Shipping.Customs(this.eoriNumber, this.extraParams); + } + + /** + * The Economic Operators Registration and Identification (EORI) number to use for Customs. + * Required for bulk shipments to Europe. + */ + public Builder setEoriNumber(String eoriNumber) { + this.eoriNumber = eoriNumber; + return this; + } + + /** + * The Economic Operators Registration and Identification (EORI) number to use for Customs. + * Required for bulk shipments to Europe. + */ + public Builder setEoriNumber(EmptyParam eoriNumber) { + this.eoriNumber = eoriNumber; + 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 CardUpdateParams.Shipping.Customs#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 CardUpdateParams.Shipping.Customs#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 Service implements ApiRequestParams.EnumParam { + @SerializedName("express") + EXPRESS("express"), + + @SerializedName("priority") + PRIORITY("priority"), + + @SerializedName("standard") + STANDARD("standard"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Service(String value) { + this.value = value; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("bulk") + BULK("bulk"), + + @SerializedName("individual") + INDIVIDUAL("individual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + @Getter public static class SpendingControls { /** diff --git a/src/main/java/com/stripe/service/SubscriptionService.java b/src/main/java/com/stripe/service/SubscriptionService.java index b617186299d..d20eab1c674 100644 --- a/src/main/java/com/stripe/service/SubscriptionService.java +++ b/src/main/java/com/stripe/service/SubscriptionService.java @@ -157,7 +157,7 @@ public Subscription retrieve( * Updates an existing subscription to match the specified parameters. When changing prices or * quantities, we optionally prorate the price we charge next month to make up for any price * changes. To preview how the proration is calculated, use the upcoming invoice endpoint. + * href="https://stripe.com/docs/api/invoices/create_preview">create preview endpoint. * *

By default, we prorate subscription changes. For example, if a customer signs up on May 1 * for a 100 price, they’ll be billed 100 immediately. If on May 15 they switch to a 200 price, @@ -173,12 +173,14 @@ public Subscription retrieve( * *

* *

In these cases, we apply a credit for the unused time on the previous price, immediately - * charge the customer using the new price, and reset the billing date. + * charge the customer using the new price, and reset the billing date. Learn about how Stripe + * immediately attempts payment for subscription changes. * *

If you want to charge for an upgrade immediately, pass {@code proration_behavior} as {@code * always_invoice} to create prorations, automatically invoice the customer for those proration @@ -207,7 +209,7 @@ public Subscription update(String subscriptionExposedId, SubscriptionUpdateParam * Updates an existing subscription to match the specified parameters. When changing prices or * quantities, we optionally prorate the price we charge next month to make up for any price * changes. To preview how the proration is calculated, use the upcoming invoice endpoint. + * href="https://stripe.com/docs/api/invoices/create_preview">create preview endpoint. * *

By default, we prorate subscription changes. For example, if a customer signs up on May 1 * for a 100 price, they’ll be billed 100 immediately. If on May 15 they switch to a 200 price, @@ -223,12 +225,14 @@ public Subscription update(String subscriptionExposedId, SubscriptionUpdateParam * *

* *

In these cases, we apply a credit for the unused time on the previous price, immediately - * charge the customer using the new price, and reset the billing date. + * charge the customer using the new price, and reset the billing date. Learn about how Stripe + * immediately attempts payment for subscription changes. * *

If you want to charge for an upgrade immediately, pass {@code proration_behavior} as {@code * always_invoice} to create prorations, automatically invoice the customer for those proration @@ -257,7 +261,7 @@ public Subscription update(String subscriptionExposedId, RequestOptions options) * Updates an existing subscription to match the specified parameters. When changing prices or * quantities, we optionally prorate the price we charge next month to make up for any price * changes. To preview how the proration is calculated, use the upcoming invoice endpoint. + * href="https://stripe.com/docs/api/invoices/create_preview">create preview endpoint. * *

By default, we prorate subscription changes. For example, if a customer signs up on May 1 * for a 100 price, they’ll be billed 100 immediately. If on May 15 they switch to a 200 price, @@ -273,12 +277,14 @@ public Subscription update(String subscriptionExposedId, RequestOptions options) * *

* *

In these cases, we apply a credit for the unused time on the previous price, immediately - * charge the customer using the new price, and reset the billing date. + * charge the customer using the new price, and reset the billing date. Learn about how Stripe + * immediately attempts payment for subscription changes. * *

If you want to charge for an upgrade immediately, pass {@code proration_behavior} as {@code * always_invoice} to create prorations, automatically invoice the customer for those proration @@ -306,7 +312,7 @@ public Subscription update(String subscriptionExposedId) throws StripeException * Updates an existing subscription to match the specified parameters. When changing prices or * quantities, we optionally prorate the price we charge next month to make up for any price * changes. To preview how the proration is calculated, use the upcoming invoice endpoint. + * href="https://stripe.com/docs/api/invoices/create_preview">create preview endpoint. * *

By default, we prorate subscription changes. For example, if a customer signs up on May 1 * for a 100 price, they’ll be billed 100 immediately. If on May 15 they switch to a 200 price, @@ -322,12 +328,14 @@ public Subscription update(String subscriptionExposedId) throws StripeException * *

* *

In these cases, we apply a credit for the unused time on the previous price, immediately - * charge the customer using the new price, and reset the billing date. + * charge the customer using the new price, and reset the billing date. Learn about how Stripe + * immediately attempts payment for subscription changes. * *

If you want to charge for an upgrade immediately, pass {@code proration_behavior} as {@code * always_invoice} to create prorations, automatically invoice the customer for those proration