com.stripe.model.SetupIntent Maven / Gradle / Ivy
// Generated by delombok at Wed Aug 05 16:28:32 PDT 2020
package com.stripe.model;
import com.google.gson.annotations.SerializedName;
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.SetupIntentCancelParams;
import com.stripe.param.SetupIntentConfirmParams;
import com.stripe.param.SetupIntentCreateParams;
import com.stripe.param.SetupIntentListParams;
import com.stripe.param.SetupIntentRetrieveParams;
import com.stripe.param.SetupIntentUpdateParams;
import java.util.List;
import java.util.Map;
public class SetupIntent extends ApiResource implements HasId, MetadataStore {
/**
* ID of the Connect application that created the SetupIntent.
*/
@SerializedName("application")
ExpandableField application;
/**
* Reason for cancellation of this SetupIntent, one of {@code abandoned}, {@code
* requested_by_customer}, or {@code duplicate}.
*/
@SerializedName("cancellation_reason")
String cancellationReason;
/**
* The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
*
* The client secret can be used to complete payment setup from your frontend. It should not be
* stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that
* you have TLS enabled on any page that includes the client secret.
*/
@SerializedName("client_secret")
String clientSecret;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
@SerializedName("created")
Long created;
/**
* ID of the Customer this SetupIntent belongs to, if one exists.
*
*
If present, the SetupIntent's payment method will be attached to the Customer on successful
* setup. Payment methods attached to other Customers cannot be used with this SetupIntent.
*/
@SerializedName("customer")
ExpandableField customer;
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
@SerializedName("description")
String description;
/**
* Unique identifier for the object.
*/
@SerializedName("id")
String id;
/**
* The error encountered in the previous SetupIntent confirmation.
*/
@SerializedName("last_setup_error")
StripeError lastSetupError;
/**
* 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;
/**
* ID of the multi use Mandate generated by the SetupIntent.
*/
@SerializedName("mandate")
ExpandableField mandate;
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format.
*/
@SerializedName("metadata")
Map metadata;
/**
* If present, this property tells you what actions you need to take in order for your customer to
* continue payment setup.
*/
@SerializedName("next_action")
NextAction nextAction;
/**
* String representing the object's type. Objects of the same type share the same value.
*
* Equal to {@code setup_intent}.
*/
@SerializedName("object")
String object;
/**
* The account (if any) for which the setup is intended.
*/
@SerializedName("on_behalf_of")
ExpandableField onBehalfOf;
/**
* ID of the payment method used with this SetupIntent.
*/
@SerializedName("payment_method")
ExpandableField paymentMethod;
/**
* Payment-method-specific configuration for this SetupIntent.
*/
@SerializedName("payment_method_options")
PaymentMethodOptions paymentMethodOptions;
/**
* The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
*/
@SerializedName("payment_method_types")
List paymentMethodTypes;
/**
* ID of the single_use Mandate generated by the SetupIntent.
*/
@SerializedName("single_use_mandate")
ExpandableField singleUseMandate;
/**
* Status of this
* SetupIntent, one of {@code requires_payment_method}, {@code requires_confirmation}, {@code
* requires_action}, {@code processing}, {@code canceled}, or {@code succeeded}.
*/
@SerializedName("status")
String status;
/**
* Indicates how the payment method is intended to be used in the future.
*
* Use {@code on_session} if you intend to only reuse the payment method when the customer is
* in your checkout flow. Use {@code off_session} if your customer may or may not be in your
* checkout flow. If not provided, this value defaults to {@code off_session}.
*/
@SerializedName("usage")
String usage;
/**
* Get ID of expandable {@code application} object.
*/
public String getApplication() {
return (this.application != null) ? this.application.getId() : null;
}
public void setApplication(String id) {
this.application = ApiResource.setExpandableFieldId(id, this.application);
}
/**
* Get expanded {@code application}.
*/
public Application getApplicationObject() {
return (this.application != null) ? this.application.getExpanded() : null;
}
public void setApplicationObject(Application expandableObject) {
this.application = new ExpandableField(expandableObject.getId(), expandableObject);
}
/**
* Get ID of expandable {@code customer} object.
*/
public String getCustomer() {
return (this.customer != null) ? this.customer.getId() : null;
}
public void setCustomer(String id) {
this.customer = ApiResource.setExpandableFieldId(id, this.customer);
}
/**
* Get expanded {@code customer}.
*/
public Customer getCustomerObject() {
return (this.customer != null) ? this.customer.getExpanded() : null;
}
public void setCustomerObject(Customer expandableObject) {
this.customer = new ExpandableField(expandableObject.getId(), expandableObject);
}
/**
* Get ID of expandable {@code mandate} object.
*/
public String getMandate() {
return (this.mandate != null) ? this.mandate.getId() : null;
}
public void setMandate(String id) {
this.mandate = ApiResource.setExpandableFieldId(id, this.mandate);
}
/**
* Get expanded {@code mandate}.
*/
public Mandate getMandateObject() {
return (this.mandate != null) ? this.mandate.getExpanded() : null;
}
public void setMandateObject(Mandate expandableObject) {
this.mandate = new ExpandableField(expandableObject.getId(), expandableObject);
}
/**
* Get ID of expandable {@code onBehalfOf} object.
*/
public String getOnBehalfOf() {
return (this.onBehalfOf != null) ? this.onBehalfOf.getId() : null;
}
public void setOnBehalfOf(String id) {
this.onBehalfOf = ApiResource.setExpandableFieldId(id, this.onBehalfOf);
}
/**
* Get expanded {@code onBehalfOf}.
*/
public Account getOnBehalfOfObject() {
return (this.onBehalfOf != null) ? this.onBehalfOf.getExpanded() : null;
}
public void setOnBehalfOfObject(Account expandableObject) {
this.onBehalfOf = new ExpandableField(expandableObject.getId(), expandableObject);
}
/**
* Get ID of expandable {@code paymentMethod} object.
*/
public String getPaymentMethod() {
return (this.paymentMethod != null) ? this.paymentMethod.getId() : null;
}
public void setPaymentMethod(String id) {
this.paymentMethod = ApiResource.setExpandableFieldId(id, this.paymentMethod);
}
/**
* Get expanded {@code paymentMethod}.
*/
public PaymentMethod getPaymentMethodObject() {
return (this.paymentMethod != null) ? this.paymentMethod.getExpanded() : null;
}
public void setPaymentMethodObject(PaymentMethod expandableObject) {
this.paymentMethod = new ExpandableField(expandableObject.getId(), expandableObject);
}
/**
* Get ID of expandable {@code singleUseMandate} object.
*/
public String getSingleUseMandate() {
return (this.singleUseMandate != null) ? this.singleUseMandate.getId() : null;
}
public void setSingleUseMandate(String id) {
this.singleUseMandate = ApiResource.setExpandableFieldId(id, this.singleUseMandate);
}
/**
* Get expanded {@code singleUseMandate}.
*/
public Mandate getSingleUseMandateObject() {
return (this.singleUseMandate != null) ? this.singleUseMandate.getExpanded() : null;
}
public void setSingleUseMandateObject(Mandate expandableObject) {
this.singleUseMandate = new ExpandableField(expandableObject.getId(), expandableObject);
}
/**
* Creates a SetupIntent object.
*
* After the SetupIntent is created, attach a payment method and confirm to collect any required
* permissions to charge the payment method later.
*/
public static SetupIntent create(Map params) throws StripeException {
return create(params, (RequestOptions) null);
}
/**
* Creates a SetupIntent object.
*
* After the SetupIntent is created, attach a payment method and confirm to collect any required
* permissions to charge the payment method later.
*/
public static SetupIntent create(Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents");
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options);
}
/**
* Creates a SetupIntent object.
*
* After the SetupIntent is created, attach a payment method and confirm to collect any required
* permissions to charge the payment method later.
*/
public static SetupIntent create(SetupIntentCreateParams params) throws StripeException {
return create(params, (RequestOptions) null);
}
/**
* Creates a SetupIntent object.
*
*
After the SetupIntent is created, attach a payment method and confirm to collect any required
* permissions to charge the payment method later.
*/
public static SetupIntent create(SetupIntentCreateParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents");
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options);
}
/**
* Returns a list of SetupIntents.
*/
public static SetupIntentCollection list(Map params) throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of SetupIntents.
*/
public static SetupIntentCollection list(Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents");
return ApiResource.requestCollection(url, params, SetupIntentCollection.class, options);
}
/**
* Returns a list of SetupIntents.
*/
public static SetupIntentCollection list(SetupIntentListParams params) throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of SetupIntents.
*/
public static SetupIntentCollection list(SetupIntentListParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/setup_intents");
return ApiResource.requestCollection(url, params, SetupIntentCollection.class, options);
}
/**
* Retrieves the details of a SetupIntent that has previously been created.
*
* Client-side retrieval using a publishable key is allowed when the client_secret
* is provided in the query string.
*
*
When retrieved with a publishable key, only a subset of properties will be returned. Please
* refer to the SetupIntent object
* reference for more details.
*/
public static SetupIntent retrieve(String intent) throws StripeException {
return retrieve(intent, (Map) null, (RequestOptions) null);
}
/**
* Retrieves the details of a SetupIntent that has previously been created.
*
* Client-side retrieval using a publishable key is allowed when the client_secret
* is provided in the query string.
*
*
When retrieved with a publishable key, only a subset of properties will be returned. Please
* refer to the SetupIntent object
* reference for more details.
*/
public static SetupIntent retrieve(String intent, RequestOptions options) throws StripeException {
return retrieve(intent, (Map) null, options);
}
/**
* Retrieves the details of a SetupIntent that has previously been created.
*
* Client-side retrieval using a publishable key is allowed when the client_secret
* is provided in the query string.
*
*
When retrieved with a publishable key, only a subset of properties will be returned. Please
* refer to the SetupIntent object
* reference for more details.
*/
public static SetupIntent retrieve(String intent, Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(intent)));
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, SetupIntent.class, options);
}
/**
* Retrieves the details of a SetupIntent that has previously been created.
*
* Client-side retrieval using a publishable key is allowed when the client_secret
* is provided in the query string.
*
*
When retrieved with a publishable key, only a subset of properties will be returned. Please
* refer to the SetupIntent object
* reference for more details.
*/
public static SetupIntent retrieve(String intent, SetupIntentRetrieveParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(intent)));
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, SetupIntent.class, options);
}
/**
* Updates a SetupIntent object.
*/
@Override
public SetupIntent update(Map params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Updates a SetupIntent object.
*/
@Override
public SetupIntent update(Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options);
}
/**
* Updates a SetupIntent object.
*/
public SetupIntent update(SetupIntentUpdateParams params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Updates a SetupIntent object.
*/
public SetupIntent update(SetupIntentUpdateParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options);
}
/**
* Confirm that your customer intends to set up the current or provided payment method. For
* example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
* method management page on your website.
*
* If the selected payment method does not require any additional steps from the customer, the
* SetupIntent will transition to the succeeded
status.
*
*
Otherwise, it will transition to the requires_action
status and suggest
* additional actions via next_action
. If setup fails, the SetupIntent will
* transition to the requires_payment_method
status.
*/
public SetupIntent confirm() throws StripeException {
return confirm((Map) null, (RequestOptions) null);
}
/**
* Confirm that your customer intends to set up the current or provided payment method. For
* example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
* method management page on your website.
*
* If the selected payment method does not require any additional steps from the customer, the
* SetupIntent will transition to the succeeded
status.
*
*
Otherwise, it will transition to the requires_action
status and suggest
* additional actions via next_action
. If setup fails, the SetupIntent will
* transition to the requires_payment_method
status.
*/
public SetupIntent confirm(RequestOptions options) throws StripeException {
return confirm((Map) null, options);
}
/**
* Confirm that your customer intends to set up the current or provided payment method. For
* example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
* method management page on your website.
*
* If the selected payment method does not require any additional steps from the customer, the
* SetupIntent will transition to the succeeded
status.
*
*
Otherwise, it will transition to the requires_action
status and suggest
* additional actions via next_action
. If setup fails, the SetupIntent will
* transition to the requires_payment_method
status.
*/
public SetupIntent confirm(Map params) throws StripeException {
return confirm(params, (RequestOptions) null);
}
/**
* Confirm that your customer intends to set up the current or provided payment method. For
* example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
* method management page on your website.
*
* If the selected payment method does not require any additional steps from the customer, the
* SetupIntent will transition to the succeeded
status.
*
*
Otherwise, it will transition to the requires_action
status and suggest
* additional actions via next_action
. If setup fails, the SetupIntent will
* transition to the requires_payment_method
status.
*/
public SetupIntent confirm(Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/setup_intents/%s/confirm", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options);
}
/**
* Confirm that your customer intends to set up the current or provided payment method. For
* example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
* method management page on your website.
*
* If the selected payment method does not require any additional steps from the customer, the
* SetupIntent will transition to the succeeded
status.
*
*
Otherwise, it will transition to the requires_action
status and suggest
* additional actions via next_action
. If setup fails, the SetupIntent will
* transition to the requires_payment_method
status.
*/
public SetupIntent confirm(SetupIntentConfirmParams params) throws StripeException {
return confirm(params, (RequestOptions) null);
}
/**
* Confirm that your customer intends to set up the current or provided payment method. For
* example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
* method management page on your website.
*
*
If the selected payment method does not require any additional steps from the customer, the
* SetupIntent will transition to the succeeded
status.
*
*
Otherwise, it will transition to the requires_action
status and suggest
* additional actions via next_action
. If setup fails, the SetupIntent will
* transition to the requires_payment_method
status.
*/
public SetupIntent confirm(SetupIntentConfirmParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/setup_intents/%s/confirm", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options);
}
/**
* A SetupIntent object can be canceled when it is in one of these statuses:
* requires_payment_method
, requires_confirmation
, or requires_action
*
.
*
*
Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an
* error.
*/
public SetupIntent cancel() throws StripeException {
return cancel((Map) null, (RequestOptions) null);
}
/**
* A SetupIntent object can be canceled when it is in one of these statuses:
* requires_payment_method
, requires_confirmation
, or requires_action
*
.
*
* Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an
* error.
*/
public SetupIntent cancel(RequestOptions options) throws StripeException {
return cancel((Map) null, options);
}
/**
* A SetupIntent object can be canceled when it is in one of these statuses:
* requires_payment_method
, requires_confirmation
, or requires_action
*
.
*
* Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an
* error.
*/
public SetupIntent cancel(Map params) throws StripeException {
return cancel(params, (RequestOptions) null);
}
/**
* A SetupIntent object can be canceled when it is in one of these statuses:
* requires_payment_method
, requires_confirmation
, or requires_action
*
.
*
* Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an
* error.
*/
public SetupIntent cancel(Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/setup_intents/%s/cancel", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options);
}
/**
* A SetupIntent object can be canceled when it is in one of these statuses:
* requires_payment_method
, requires_confirmation
, or requires_action
*
.
*
* Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an
* error.
*/
public SetupIntent cancel(SetupIntentCancelParams params) throws StripeException {
return cancel(params, (RequestOptions) null);
}
/**
* A SetupIntent object can be canceled when it is in one of these statuses:
* requires_payment_method
, requires_confirmation
, or requires_action
*
.
*
*
Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an
* error.
*/
public SetupIntent cancel(SetupIntentCancelParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/setup_intents/%s/cancel", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, SetupIntent.class, options);
}
public static class NextAction extends StripeObject {
@SerializedName("redirect_to_url")
NextActionRedirectToUrl redirectToUrl;
/**
* Type of the next action to perform, one of {@code redirect_to_url} or {@code use_stripe_sdk}.
*/
@SerializedName("type")
String type;
/**
* When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this
* dictionary to invoke authentication flows. The shape of the contents is subject to change and
* is only intended to be used by Stripe.js.
*/
@SerializedName("use_stripe_sdk")
Map useStripeSdk;
@java.lang.SuppressWarnings("all")
@lombok.Generated
public NextActionRedirectToUrl getRedirectToUrl() {
return this.redirectToUrl;
}
/**
* Type of the next action to perform, one of {@code redirect_to_url} or {@code use_stripe_sdk}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getType() {
return this.type;
}
/**
* When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this
* dictionary to invoke authentication flows. The shape of the contents is subject to change and
* is only intended to be used by Stripe.js.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getUseStripeSdk() {
return this.useStripeSdk;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setRedirectToUrl(final NextActionRedirectToUrl redirectToUrl) {
this.redirectToUrl = redirectToUrl;
}
/**
* Type of the next action to perform, one of {@code redirect_to_url} or {@code use_stripe_sdk}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setType(final String type) {
this.type = type;
}
/**
* When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this
* dictionary to invoke authentication flows. The shape of the contents is subject to change and
* is only intended to be used by Stripe.js.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setUseStripeSdk(final Map useStripeSdk) {
this.useStripeSdk = useStripeSdk;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof SetupIntent.NextAction)) return false;
final SetupIntent.NextAction other = (SetupIntent.NextAction) o;
if (!other.canEqual((java.lang.Object) this)) return false;
final java.lang.Object this$redirectToUrl = this.getRedirectToUrl();
final java.lang.Object other$redirectToUrl = other.getRedirectToUrl();
if (this$redirectToUrl == null ? other$redirectToUrl != null : !this$redirectToUrl.equals(other$redirectToUrl)) return false;
final java.lang.Object this$type = this.getType();
final java.lang.Object other$type = other.getType();
if (this$type == null ? other$type != null : !this$type.equals(other$type)) return false;
final java.lang.Object this$useStripeSdk = this.getUseStripeSdk();
final java.lang.Object other$useStripeSdk = other.getUseStripeSdk();
if (this$useStripeSdk == null ? other$useStripeSdk != null : !this$useStripeSdk.equals(other$useStripeSdk)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
protected boolean canEqual(final java.lang.Object other) {
return other instanceof SetupIntent.NextAction;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $redirectToUrl = this.getRedirectToUrl();
result = result * PRIME + ($redirectToUrl == null ? 43 : $redirectToUrl.hashCode());
final java.lang.Object $type = this.getType();
result = result * PRIME + ($type == null ? 43 : $type.hashCode());
final java.lang.Object $useStripeSdk = this.getUseStripeSdk();
result = result * PRIME + ($useStripeSdk == null ? 43 : $useStripeSdk.hashCode());
return result;
}
}
public static class NextActionRedirectToUrl extends StripeObject {
/**
* If the customer does not exit their browser while authenticating, they will be redirected to
* this specified URL after completion.
*/
@SerializedName("return_url")
String returnUrl;
/**
* The URL you must redirect your customer to in order to authenticate.
*/
@SerializedName("url")
String url;
/**
* If the customer does not exit their browser while authenticating, they will be redirected to
* this specified URL after completion.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getReturnUrl() {
return this.returnUrl;
}
/**
* The URL you must redirect your customer to in order to authenticate.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getUrl() {
return this.url;
}
/**
* If the customer does not exit their browser while authenticating, they will be redirected to
* this specified URL after completion.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setReturnUrl(final String returnUrl) {
this.returnUrl = returnUrl;
}
/**
* The URL you must redirect your customer to in order to authenticate.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setUrl(final String url) {
this.url = url;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof SetupIntent.NextActionRedirectToUrl)) return false;
final SetupIntent.NextActionRedirectToUrl other = (SetupIntent.NextActionRedirectToUrl) o;
if (!other.canEqual((java.lang.Object) this)) return false;
final java.lang.Object this$returnUrl = this.getReturnUrl();
final java.lang.Object other$returnUrl = other.getReturnUrl();
if (this$returnUrl == null ? other$returnUrl != null : !this$returnUrl.equals(other$returnUrl)) return false;
final java.lang.Object this$url = this.getUrl();
final java.lang.Object other$url = other.getUrl();
if (this$url == null ? other$url != null : !this$url.equals(other$url)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
protected boolean canEqual(final java.lang.Object other) {
return other instanceof SetupIntent.NextActionRedirectToUrl;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $returnUrl = this.getReturnUrl();
result = result * PRIME + ($returnUrl == null ? 43 : $returnUrl.hashCode());
final java.lang.Object $url = this.getUrl();
result = result * PRIME + ($url == null ? 43 : $url.hashCode());
return result;
}
}
public static class PaymentMethodOptions extends StripeObject {
@SerializedName("card")
Card card;
public static class Card extends StripeObject {
/**
* We strongly recommend that you rely on our SCA Engine to automatically prompt your
* customers for authentication based on risk level and other requirements.
* However, if you wish to request 3D Secure based on logic from your own fraud engine,
* provide this option. Permitted values include: {@code automatic} or {@code any}. If not
* provided, defaults to {@code automatic}. Read our guide on manually requesting 3D
* Secure for more information on how this configuration interacts with Radar and our SCA
* Engine.
*
* One of {@code any}, {@code automatic}, or {@code challenge_only}.
*/
@SerializedName("request_three_d_secure")
String requestThreeDSecure;
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getRequestThreeDSecure() {
return this.requestThreeDSecure;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setRequestThreeDSecure(final String requestThreeDSecure) {
this.requestThreeDSecure = requestThreeDSecure;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof SetupIntent.PaymentMethodOptions.Card)) return false;
final SetupIntent.PaymentMethodOptions.Card other = (SetupIntent.PaymentMethodOptions.Card) o;
if (!other.canEqual((java.lang.Object) this)) return false;
final java.lang.Object this$requestThreeDSecure = this.getRequestThreeDSecure();
final java.lang.Object other$requestThreeDSecure = other.getRequestThreeDSecure();
if (this$requestThreeDSecure == null ? other$requestThreeDSecure != null : !this$requestThreeDSecure.equals(other$requestThreeDSecure)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
protected boolean canEqual(final java.lang.Object other) {
return other instanceof SetupIntent.PaymentMethodOptions.Card;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $requestThreeDSecure = this.getRequestThreeDSecure();
result = result * PRIME + ($requestThreeDSecure == null ? 43 : $requestThreeDSecure.hashCode());
return result;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Card getCard() {
return this.card;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setCard(final Card card) {
this.card = card;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof SetupIntent.PaymentMethodOptions)) return false;
final SetupIntent.PaymentMethodOptions other = (SetupIntent.PaymentMethodOptions) o;
if (!other.canEqual((java.lang.Object) this)) return false;
final java.lang.Object this$card = this.getCard();
final java.lang.Object other$card = other.getCard();
if (this$card == null ? other$card != null : !this$card.equals(other$card)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
protected boolean canEqual(final java.lang.Object other) {
return other instanceof SetupIntent.PaymentMethodOptions;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $card = this.getCard();
result = result * PRIME + ($card == null ? 43 : $card.hashCode());
return result;
}
}
/**
* Reason for cancellation of this SetupIntent, one of {@code abandoned}, {@code
* requested_by_customer}, or {@code duplicate}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCancellationReason() {
return this.cancellationReason;
}
/**
* The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
*
*
The client secret can be used to complete payment setup from your frontend. It should not be
* stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that
* you have TLS enabled on any page that includes the client secret.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getClientSecret() {
return this.clientSecret;
}
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getCreated() {
return this.created;
}
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getDescription() {
return this.description;
}
/**
* The error encountered in the previous SetupIntent confirmation.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public StripeError getLastSetupError() {
return this.lastSetupError;
}
/**
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
* object exists in test mode.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getLivemode() {
return this.livemode;
}
/**
* If present, this property tells you what actions you need to take in order for your customer to
* continue payment setup.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public NextAction getNextAction() {
return this.nextAction;
}
/**
* String representing the object's type. Objects of the same type share the same value.
*
*
Equal to {@code setup_intent}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getObject() {
return this.object;
}
/**
* Payment-method-specific configuration for this SetupIntent.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public PaymentMethodOptions getPaymentMethodOptions() {
return this.paymentMethodOptions;
}
/**
* The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getPaymentMethodTypes() {
return this.paymentMethodTypes;
}
/**
* Status of this
* SetupIntent, one of {@code requires_payment_method}, {@code requires_confirmation}, {@code
* requires_action}, {@code processing}, {@code canceled}, or {@code succeeded}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getStatus() {
return this.status;
}
/**
* Indicates how the payment method is intended to be used in the future.
*
* Use {@code on_session} if you intend to only reuse the payment method when the customer is
* in your checkout flow. Use {@code off_session} if your customer may or may not be in your
* checkout flow. If not provided, this value defaults to {@code off_session}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getUsage() {
return this.usage;
}
/**
* Reason for cancellation of this SetupIntent, one of {@code abandoned}, {@code
* requested_by_customer}, or {@code duplicate}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setCancellationReason(final String cancellationReason) {
this.cancellationReason = cancellationReason;
}
/**
* The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
*
*
The client secret can be used to complete payment setup from your frontend. It should not be
* stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that
* you have TLS enabled on any page that includes the client secret.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setClientSecret(final String clientSecret) {
this.clientSecret = clientSecret;
}
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setCreated(final Long created) {
this.created = created;
}
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setDescription(final String description) {
this.description = description;
}
/**
* Unique identifier for the object.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setId(final String id) {
this.id = id;
}
/**
* The error encountered in the previous SetupIntent confirmation.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setLastSetupError(final StripeError lastSetupError) {
this.lastSetupError = lastSetupError;
}
/**
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
* object exists in test mode.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setLivemode(final Boolean livemode) {
this.livemode = livemode;
}
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setMetadata(final Map metadata) {
this.metadata = metadata;
}
/**
* If present, this property tells you what actions you need to take in order for your customer to
* continue payment setup.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setNextAction(final NextAction nextAction) {
this.nextAction = nextAction;
}
/**
* String representing the object's type. Objects of the same type share the same value.
*
* Equal to {@code setup_intent}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setObject(final String object) {
this.object = object;
}
/**
* Payment-method-specific configuration for this SetupIntent.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setPaymentMethodOptions(final PaymentMethodOptions paymentMethodOptions) {
this.paymentMethodOptions = paymentMethodOptions;
}
/**
* The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setPaymentMethodTypes(final List paymentMethodTypes) {
this.paymentMethodTypes = paymentMethodTypes;
}
/**
* Status of this
* SetupIntent, one of {@code requires_payment_method}, {@code requires_confirmation}, {@code
* requires_action}, {@code processing}, {@code canceled}, or {@code succeeded}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setStatus(final String status) {
this.status = status;
}
/**
* Indicates how the payment method is intended to be used in the future.
*
* Use {@code on_session} if you intend to only reuse the payment method when the customer is
* in your checkout flow. Use {@code off_session} if your customer may or may not be in your
* checkout flow. If not provided, this value defaults to {@code off_session}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setUsage(final String usage) {
this.usage = usage;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof SetupIntent)) return false;
final SetupIntent other = (SetupIntent) o;
if (!other.canEqual((java.lang.Object) this)) return false;
final java.lang.Object this$application = this.getApplication();
final java.lang.Object other$application = other.getApplication();
if (this$application == null ? other$application != null : !this$application.equals(other$application)) return false;
final java.lang.Object this$cancellationReason = this.getCancellationReason();
final java.lang.Object other$cancellationReason = other.getCancellationReason();
if (this$cancellationReason == null ? other$cancellationReason != null : !this$cancellationReason.equals(other$cancellationReason)) return false;
final java.lang.Object this$clientSecret = this.getClientSecret();
final java.lang.Object other$clientSecret = other.getClientSecret();
if (this$clientSecret == null ? other$clientSecret != null : !this$clientSecret.equals(other$clientSecret)) return false;
final java.lang.Object this$created = this.getCreated();
final java.lang.Object other$created = other.getCreated();
if (this$created == null ? other$created != null : !this$created.equals(other$created)) return false;
final java.lang.Object this$customer = this.getCustomer();
final java.lang.Object other$customer = other.getCustomer();
if (this$customer == null ? other$customer != null : !this$customer.equals(other$customer)) return false;
final java.lang.Object this$description = this.getDescription();
final java.lang.Object other$description = other.getDescription();
if (this$description == null ? other$description != null : !this$description.equals(other$description)) return false;
final java.lang.Object this$id = this.getId();
final java.lang.Object other$id = other.getId();
if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
final java.lang.Object this$lastSetupError = this.getLastSetupError();
final java.lang.Object other$lastSetupError = other.getLastSetupError();
if (this$lastSetupError == null ? other$lastSetupError != null : !this$lastSetupError.equals(other$lastSetupError)) return false;
final java.lang.Object this$livemode = this.getLivemode();
final java.lang.Object other$livemode = other.getLivemode();
if (this$livemode == null ? other$livemode != null : !this$livemode.equals(other$livemode)) return false;
final java.lang.Object this$mandate = this.getMandate();
final java.lang.Object other$mandate = other.getMandate();
if (this$mandate == null ? other$mandate != null : !this$mandate.equals(other$mandate)) return false;
final java.lang.Object this$metadata = this.getMetadata();
final java.lang.Object other$metadata = other.getMetadata();
if (this$metadata == null ? other$metadata != null : !this$metadata.equals(other$metadata)) return false;
final java.lang.Object this$nextAction = this.getNextAction();
final java.lang.Object other$nextAction = other.getNextAction();
if (this$nextAction == null ? other$nextAction != null : !this$nextAction.equals(other$nextAction)) return false;
final java.lang.Object this$object = this.getObject();
final java.lang.Object other$object = other.getObject();
if (this$object == null ? other$object != null : !this$object.equals(other$object)) return false;
final java.lang.Object this$onBehalfOf = this.getOnBehalfOf();
final java.lang.Object other$onBehalfOf = other.getOnBehalfOf();
if (this$onBehalfOf == null ? other$onBehalfOf != null : !this$onBehalfOf.equals(other$onBehalfOf)) return false;
final java.lang.Object this$paymentMethod = this.getPaymentMethod();
final java.lang.Object other$paymentMethod = other.getPaymentMethod();
if (this$paymentMethod == null ? other$paymentMethod != null : !this$paymentMethod.equals(other$paymentMethod)) return false;
final java.lang.Object this$paymentMethodOptions = this.getPaymentMethodOptions();
final java.lang.Object other$paymentMethodOptions = other.getPaymentMethodOptions();
if (this$paymentMethodOptions == null ? other$paymentMethodOptions != null : !this$paymentMethodOptions.equals(other$paymentMethodOptions)) return false;
final java.lang.Object this$paymentMethodTypes = this.getPaymentMethodTypes();
final java.lang.Object other$paymentMethodTypes = other.getPaymentMethodTypes();
if (this$paymentMethodTypes == null ? other$paymentMethodTypes != null : !this$paymentMethodTypes.equals(other$paymentMethodTypes)) return false;
final java.lang.Object this$singleUseMandate = this.getSingleUseMandate();
final java.lang.Object other$singleUseMandate = other.getSingleUseMandate();
if (this$singleUseMandate == null ? other$singleUseMandate != null : !this$singleUseMandate.equals(other$singleUseMandate)) return false;
final java.lang.Object this$status = this.getStatus();
final java.lang.Object other$status = other.getStatus();
if (this$status == null ? other$status != null : !this$status.equals(other$status)) return false;
final java.lang.Object this$usage = this.getUsage();
final java.lang.Object other$usage = other.getUsage();
if (this$usage == null ? other$usage != null : !this$usage.equals(other$usage)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
protected boolean canEqual(final java.lang.Object other) {
return other instanceof SetupIntent;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $application = this.getApplication();
result = result * PRIME + ($application == null ? 43 : $application.hashCode());
final java.lang.Object $cancellationReason = this.getCancellationReason();
result = result * PRIME + ($cancellationReason == null ? 43 : $cancellationReason.hashCode());
final java.lang.Object $clientSecret = this.getClientSecret();
result = result * PRIME + ($clientSecret == null ? 43 : $clientSecret.hashCode());
final java.lang.Object $created = this.getCreated();
result = result * PRIME + ($created == null ? 43 : $created.hashCode());
final java.lang.Object $customer = this.getCustomer();
result = result * PRIME + ($customer == null ? 43 : $customer.hashCode());
final java.lang.Object $description = this.getDescription();
result = result * PRIME + ($description == null ? 43 : $description.hashCode());
final java.lang.Object $id = this.getId();
result = result * PRIME + ($id == null ? 43 : $id.hashCode());
final java.lang.Object $lastSetupError = this.getLastSetupError();
result = result * PRIME + ($lastSetupError == null ? 43 : $lastSetupError.hashCode());
final java.lang.Object $livemode = this.getLivemode();
result = result * PRIME + ($livemode == null ? 43 : $livemode.hashCode());
final java.lang.Object $mandate = this.getMandate();
result = result * PRIME + ($mandate == null ? 43 : $mandate.hashCode());
final java.lang.Object $metadata = this.getMetadata();
result = result * PRIME + ($metadata == null ? 43 : $metadata.hashCode());
final java.lang.Object $nextAction = this.getNextAction();
result = result * PRIME + ($nextAction == null ? 43 : $nextAction.hashCode());
final java.lang.Object $object = this.getObject();
result = result * PRIME + ($object == null ? 43 : $object.hashCode());
final java.lang.Object $onBehalfOf = this.getOnBehalfOf();
result = result * PRIME + ($onBehalfOf == null ? 43 : $onBehalfOf.hashCode());
final java.lang.Object $paymentMethod = this.getPaymentMethod();
result = result * PRIME + ($paymentMethod == null ? 43 : $paymentMethod.hashCode());
final java.lang.Object $paymentMethodOptions = this.getPaymentMethodOptions();
result = result * PRIME + ($paymentMethodOptions == null ? 43 : $paymentMethodOptions.hashCode());
final java.lang.Object $paymentMethodTypes = this.getPaymentMethodTypes();
result = result * PRIME + ($paymentMethodTypes == null ? 43 : $paymentMethodTypes.hashCode());
final java.lang.Object $singleUseMandate = this.getSingleUseMandate();
result = result * PRIME + ($singleUseMandate == null ? 43 : $singleUseMandate.hashCode());
final java.lang.Object $status = this.getStatus();
result = result * PRIME + ($status == null ? 43 : $status.hashCode());
final java.lang.Object $usage = this.getUsage();
result = result * PRIME + ($usage == null ? 43 : $usage.hashCode());
return result;
}
/**
* Unique identifier for the object.
*/
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getId() {
return this.id;
}
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format.
*/
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getMetadata() {
return this.metadata;
}
}