diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index c99d4272fbb..92d73382fd6 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -e10daa4ed23a4fe87d6ea60836226446e042fdd3 \ No newline at end of file +b51a9d09327603fa3a61d076f4bf7f07b43e1659 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 58dae793582..4ec501ea29c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2186 \ No newline at end of file +v2205 \ No newline at end of file diff --git a/src/main/java/com/stripe/ApiVersion.java b/src/main/java/com/stripe/ApiVersion.java index 634aa9faaa3..8b6152d7509 100644 --- a/src/main/java/com/stripe/ApiVersion.java +++ b/src/main/java/com/stripe/ApiVersion.java @@ -2,5 +2,5 @@ package com.stripe; final class ApiVersion { - public static final String CURRENT = "2026-02-25.preview"; + public static final String CURRENT = "2026-03-25.preview"; } diff --git a/src/main/java/com/stripe/StripeClient.java b/src/main/java/com/stripe/StripeClient.java index 53f139fb0a3..1d059464fef 100644 --- a/src/main/java/com/stripe/StripeClient.java +++ b/src/main/java/com/stripe/StripeClient.java @@ -794,6 +794,18 @@ public com.stripe.service.PrivacyService privacy() { return new com.stripe.service.PrivacyService(this.getResponseGetter()); } + /** + * @deprecated StripeClient.productCatalog() is deprecated, use StripeClient.v1().productCatalog() + * instead. All functionality under it has been copied over to + * StripeClient.v1().productCatalog(). See migration + * guide for more on this and tips on migrating to the new v1 namespace. + */ + @Deprecated + public com.stripe.service.ProductCatalogService productCatalog() { + return new com.stripe.service.ProductCatalogService(this.getResponseGetter()); + } + /** * @deprecated StripeClient.products() is deprecated, use StripeClient.v1().products() instead. * All functionality under it has been copied over to StripeClient.v1().products(). See callback) { + this.register("v2.core.batch_job.batch_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobCanceled( + Callback callback) { + this.register("v2.core.batch_job.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobCompleted( + Callback callback) { + this.register("v2.core.batch_job.completed", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobCreated( + Callback callback) { + this.register("v2.core.batch_job.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobReadyForUpload( + Callback callback) { + this.register("v2.core.batch_job.ready_for_upload", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobTimeout( + Callback callback) { + this.register("v2.core.batch_job.timeout", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobUpdated( + Callback callback) { + this.register("v2.core.batch_job.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobUploadTimeout( + Callback callback) { + this.register("v2.core.batch_job.upload_timeout", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobValidating( + Callback callback) { + this.register("v2.core.batch_job.validating", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobValidationFailed( + Callback callback) { + this.register("v2.core.batch_job.validation_failed", callback); + return this; + } + public StripeEventNotificationHandler onV2CoreEventDestinationPing( Callback callback) { this.register("v2.core.event_destination.ping", callback); diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEvent.java new file mode 100644 index 00000000000..01b73e46355 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobBatchFailedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEventNotification.java new file mode 100644 index 00000000000..43fd75ea458 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobBatchFailedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobBatchFailedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobBatchFailedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEvent.java new file mode 100644 index 00000000000..dbc844ac9cc --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCanceledEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEventNotification.java new file mode 100644 index 00000000000..f6822dfddc2 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCanceledEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobCanceledEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobCanceledEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEvent.java new file mode 100644 index 00000000000..0631ef3db37 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCompletedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEventNotification.java new file mode 100644 index 00000000000..3d000c119d2 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCompletedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobCompletedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobCompletedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEvent.java new file mode 100644 index 00000000000..b12abcecf09 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCreatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEventNotification.java new file mode 100644 index 00000000000..1b5e934daae --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCreatedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobCreatedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobCreatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEvent.java new file mode 100644 index 00000000000..e82c35c9005 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobReadyForUploadEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEventNotification.java new file mode 100644 index 00000000000..74f5acae6be --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobReadyForUploadEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobReadyForUploadEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobReadyForUploadEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEvent.java new file mode 100644 index 00000000000..8f9ac367539 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobTimeoutEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEventNotification.java new file mode 100644 index 00000000000..53a6bbe5cdb --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobTimeoutEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobTimeoutEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobTimeoutEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEvent.java new file mode 100644 index 00000000000..1406fe05335 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUpdatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEventNotification.java new file mode 100644 index 00000000000..b5a6ad485bc --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUpdatedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobUpdatedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEvent.java new file mode 100644 index 00000000000..dbc64ad541c --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUploadTimeoutEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEventNotification.java new file mode 100644 index 00000000000..ba3dbeadee7 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUploadTimeoutEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobUploadTimeoutEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobUploadTimeoutEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEvent.java new file mode 100644 index 00000000000..c382cf6c2af --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidatingEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEventNotification.java new file mode 100644 index 00000000000..4b8a29dd0a7 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidatingEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobValidatingEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobValidatingEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEvent.java new file mode 100644 index 00000000000..29ea687b803 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidationFailedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEventNotification.java new file mode 100644 index 00000000000..35088400687 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidationFailedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobValidationFailedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobValidationFailedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/model/Account.java b/src/main/java/com/stripe/model/Account.java index 3a46a62dde7..1d77458fb4b 100644 --- a/src/main/java/com/stripe/model/Account.java +++ b/src/main/java/com/stripe/model/Account.java @@ -24,7 +24,11 @@ import lombok.Setter; /** - * This is an object representing a Stripe account. You can retrieve it to see properties on the + * For new integrations, we recommend using the Accounts v2 API, in place of /v1/accounts and + * /v1/customers to represent a user. + * + *

This is an object representing a Stripe account. You can retrieve it to see properties on the * account like its current requirements or if the account is enabled to make live charges or * receive payouts. * @@ -1497,6 +1501,15 @@ public static class Capabilities extends StripeObject { @SerializedName("twint_payments") String twintPayments; + /** + * The status of the upi payments capability of the account, or whether the account can directly + * process upi charges. + * + *

One of {@code active}, {@code inactive}, or {@code pending}. + */ + @SerializedName("upi_payments") + String upiPayments; + /** * The status of the US bank account ACH payments capability of the account, or whether the * account can directly process US bank account charges. @@ -3076,7 +3089,8 @@ public static class PaypayPayments extends StripeObject { List additionalFiles; /** - * Whether your business sells digital content or not. + * The type of goods your business sells. Use {@code digital_content} if you sell digital + * content. Use {@code other} for all other types of goods or services. * *

One of {@code digital_content}, or {@code other}. */ diff --git a/src/main/java/com/stripe/model/AccountNotice.java b/src/main/java/com/stripe/model/AccountNotice.java index 133a770235d..07ed992706a 100644 --- a/src/main/java/com/stripe/model/AccountNotice.java +++ b/src/main/java/com/stripe/model/AccountNotice.java @@ -51,8 +51,8 @@ public class AccountNotice extends ApiResource implements HasId, MetadataStoreAPI Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RiskReserved extends StripeObject { + /** Funds that are available for use. */ + @SerializedName("available") + List available; + + /** Funds that are pending. */ + @SerializedName("pending") + List pending; + + /** + * For more details about Available, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Available extends StripeObject { + /** Balance amount. */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + @SerializedName("source_types") + SourceTypes sourceTypes; + + /** + * For more details about SourceTypes, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SourceTypes extends StripeObject { + /** + * Amount coming from legacy US ACH + * payments. + */ + @SerializedName("bank_account") + Long bankAccount; + + /** + * Amount coming from most payment methods, including cards as well as non-legacy bank debits. + */ + @SerializedName("card") + Long card; + + /** + * Amount coming from FPX, a Malaysian + * payment method. + */ + @SerializedName("fpx") + Long fpx; + } + } + + /** + * For more details about Pending, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Pending extends StripeObject { + /** Balance amount. */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + @SerializedName("source_types") + SourceTypes sourceTypes; + + /** + * For more details about SourceTypes, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SourceTypes extends StripeObject { + /** + * Amount coming from legacy US ACH + * payments. + */ + @SerializedName("bank_account") + Long bankAccount; + + /** + * Amount coming from most payment methods, including cards as well as non-legacy bank debits. + */ + @SerializedName("card") + Long card; + + /** + * Amount coming from FPX, a Malaysian + * payment method. + */ + @SerializedName("fpx") + Long fpx; + } + } + } + @Override public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(issuing, responseGetter); trySetResponseGetter(refundAndDisputePrefunding, responseGetter); + trySetResponseGetter(riskReserved, responseGetter); } } diff --git a/src/main/java/com/stripe/model/CashBalance.java b/src/main/java/com/stripe/model/CashBalance.java index 1421ac2af88..333fb8d9120 100644 --- a/src/main/java/com/stripe/model/CashBalance.java +++ b/src/main/java/com/stripe/model/CashBalance.java @@ -42,8 +42,8 @@ public class CashBalance extends ApiResource { String customerAccount; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index f58823360e4..9ae13340b13 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -171,8 +171,8 @@ public class Charge extends ApiResource implements MetadataStore, Balanc Level3 level3; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -1340,6 +1340,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -2800,7 +2803,8 @@ public static class Crypto extends StripeObject { /** * The blockchain network that the transaction was sent on. * - *

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. + *

One of {@code base}, {@code ethereum}, {@code polygon}, {@code solana}, or {@code + * tempo}. */ @SerializedName("network") String network; @@ -4179,16 +4183,6 @@ public static class StripeBalance extends StripeObject { /** The connected account ID whose Stripe balance to use as the source of payment. */ @SerializedName("account") String account; - - /** - * The source_type - * of the balance - * - *

One of {@code bank_account}, {@code card}, or {@code fpx}. - */ - @SerializedName("source_type") - String sourceType; } /** @@ -4224,6 +4218,19 @@ public static class Swish extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Twint extends StripeObject {} + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Customer's unique Virtual Payment Address. */ + @SerializedName("vpa") + String vpa; + } + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/ConfirmationToken.java b/src/main/java/com/stripe/model/ConfirmationToken.java index d58581acd8e..976f31e24b4 100644 --- a/src/main/java/com/stripe/model/ConfirmationToken.java +++ b/src/main/java/com/stripe/model/ConfirmationToken.java @@ -48,8 +48,8 @@ public class ConfirmationToken extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -477,12 +477,15 @@ public static class PaymentMethodPreview extends StripeObject { * pay_by_bank}, {@code payco}, {@code paynow}, {@code paypal}, {@code paypay}, {@code payto}, * {@code pix}, {@code promptpay}, {@code qris}, {@code rechnung}, {@code revolut_pay}, {@code * samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code shopeepay}, {@code sofort}, {@code - * stripe_balance}, {@code swish}, {@code twint}, {@code us_bank_account}, {@code wechat_pay}, - * or {@code zip}. + * stripe_balance}, {@code swish}, {@code twint}, {@code upi}, {@code us_bank_account}, {@code + * wechat_pay}, or {@code zip}. */ @SerializedName("type") String type; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -2413,16 +2416,6 @@ public static class StripeBalance extends StripeObject { /** The connected account ID whose Stripe balance to use as the source of payment. */ @SerializedName("account") String account; - - /** - * The source_type - * of the balance - * - *

One of {@code bank_account}, {@code card}, or {@code fpx}. - */ - @SerializedName("source_type") - String sourceType; } /** @@ -2443,6 +2436,19 @@ public static class Swish extends StripeObject {} @EqualsAndHashCode(callSuper = false) public static class Twint extends StripeObject {} + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Customer's unique Virtual Payment Address. */ + @SerializedName("vpa") + String vpa; + } + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/ConnectCollectionTransfer.java b/src/main/java/com/stripe/model/ConnectCollectionTransfer.java index ad68da667ee..b0db6fbf75e 100644 --- a/src/main/java/com/stripe/model/ConnectCollectionTransfer.java +++ b/src/main/java/com/stripe/model/ConnectCollectionTransfer.java @@ -34,8 +34,8 @@ public class ConnectCollectionTransfer extends StripeObject implements BalanceTr String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Coupon.java b/src/main/java/com/stripe/model/Coupon.java index 7429253ab83..49fcdc55b5e 100644 --- a/src/main/java/com/stripe/model/Coupon.java +++ b/src/main/java/com/stripe/model/Coupon.java @@ -27,7 +27,7 @@ * href="https://api.stripe.com#invoices">invoices, checkout sessions, quotes, and more. Coupons do not work with conventional - * one-off charges or charges or payment intents. */ @Getter @@ -88,8 +88,8 @@ public class Coupon extends ApiResource implements HasId, MetadataStore String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/CreditNote.java b/src/main/java/com/stripe/model/CreditNote.java index a1394ad15cd..15de92bdeec 100644 --- a/src/main/java/com/stripe/model/CreditNote.java +++ b/src/main/java/com/stripe/model/CreditNote.java @@ -105,8 +105,8 @@ public class CreditNote extends ApiResource implements HasId, MetadataStorekey-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; + /** * String representing the object's type. Objects of the same type share the same value. * diff --git a/src/main/java/com/stripe/model/Customer.java b/src/main/java/com/stripe/model/Customer.java index 309c0dadb5d..73e5995eba7 100644 --- a/src/main/java/com/stripe/model/Customer.java +++ b/src/main/java/com/stripe/model/Customer.java @@ -157,8 +157,8 @@ public class Customer extends ApiResource implements HasId, MetadataStore invoice; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java b/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java index e2f606bfa66..a5dae90649f 100644 --- a/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java +++ b/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java @@ -65,8 +65,8 @@ public class CustomerCashBalanceTransaction extends StripeObject String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/CustomerSession.java b/src/main/java/com/stripe/model/CustomerSession.java index 4659789cdb3..b97b87338b0 100644 --- a/src/main/java/com/stripe/model/CustomerSession.java +++ b/src/main/java/com/stripe/model/CustomerSession.java @@ -66,8 +66,8 @@ public class CustomerSession extends ApiResource { Long expiresAt; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Dispute.java b/src/main/java/com/stripe/model/Dispute.java index f5960a8e47b..11e3a365109 100644 --- a/src/main/java/com/stripe/model/Dispute.java +++ b/src/main/java/com/stripe/model/Dispute.java @@ -94,8 +94,8 @@ public class Dispute extends ApiResource Boolean isChargeRefundable; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/EphemeralKey.java b/src/main/java/com/stripe/model/EphemeralKey.java index 4c08df80bbb..15f830e636c 100644 --- a/src/main/java/com/stripe/model/EphemeralKey.java +++ b/src/main/java/com/stripe/model/EphemeralKey.java @@ -33,8 +33,8 @@ public class EphemeralKey extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Event.java b/src/main/java/com/stripe/model/Event.java index f5fa1c82625..79bfe107227 100644 --- a/src/main/java/com/stripe/model/Event.java +++ b/src/main/java/com/stripe/model/Event.java @@ -72,8 +72,8 @@ public class Event extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index e5aec3c5114..d77d48fc40b 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -208,6 +208,9 @@ public final class EventDataClassLookup { "privacy.redaction_job_validation_error", com.stripe.model.privacy.RedactionJobValidationError.class); + classLookup.put( + "product_catalog.trial_offer", com.stripe.model.productcatalog.TrialOffer.class); + classLookup.put("radar.early_fraud_warning", com.stripe.model.radar.EarlyFraudWarning.class); classLookup.put("radar.payment_evaluation", com.stripe.model.radar.PaymentEvaluation.class); classLookup.put("radar.value_list", com.stripe.model.radar.ValueList.class); @@ -226,6 +229,7 @@ public final class EventDataClassLookup { classLookup.put("tax.calculation", com.stripe.model.tax.Calculation.class); classLookup.put("tax.calculation_line_item", com.stripe.model.tax.CalculationLineItem.class); classLookup.put("tax.form", com.stripe.model.tax.Form.class); + classLookup.put("tax.location", com.stripe.model.tax.Location.class); classLookup.put("tax.registration", com.stripe.model.tax.Registration.class); classLookup.put("tax.settings", com.stripe.model.tax.Settings.class); classLookup.put("tax.transaction", com.stripe.model.tax.Transaction.class); diff --git a/src/main/java/com/stripe/model/FileLink.java b/src/main/java/com/stripe/model/FileLink.java index 91bb8e94440..af577446b2d 100644 --- a/src/main/java/com/stripe/model/FileLink.java +++ b/src/main/java/com/stripe/model/FileLink.java @@ -51,8 +51,8 @@ public class FileLink extends ApiResource implements HasId, MetadataStorefinalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public static Invoice create(Map params) throws StripeException { @@ -1050,8 +1050,8 @@ public static Invoice create(Map params) throws StripeException /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public static Invoice create(Map params, RequestOptions options) @@ -1064,8 +1064,8 @@ public static Invoice create(Map params, RequestOptions options) /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public static Invoice create(InvoiceCreateParams params) throws StripeException { @@ -1074,8 +1074,8 @@ public static Invoice create(InvoiceCreateParams params) throws StripeException /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public static Invoice create(InvoiceCreateParams params, RequestOptions options) @@ -1278,7 +1278,7 @@ public static Invoice createPreview(InvoiceCreatePreviewParams params, RequestOp * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete() throws StripeException { return delete((Map) null, (RequestOptions) null); @@ -1288,7 +1288,7 @@ public Invoice delete() throws StripeException { * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete(RequestOptions options) throws StripeException { return delete((Map) null, options); @@ -1298,7 +1298,7 @@ public Invoice delete(RequestOptions options) throws StripeException { * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete(Map params) throws StripeException { return delete(params, (RequestOptions) null); @@ -1308,7 +1308,7 @@ public Invoice delete(Map params) throws StripeException { * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete(Map params, RequestOptions options) throws StripeException { String path = String.format("/v1/invoices/%s", ApiResource.urlEncodeId(this.getId())); @@ -1975,14 +1975,14 @@ public Invoice updateLines(InvoiceUpdateLinesParams params, RequestOptions optio /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice() throws StripeException { return voidInvoice((Map) null, (RequestOptions) null); @@ -1990,14 +1990,14 @@ public Invoice voidInvoice() throws StripeException { /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(RequestOptions options) throws StripeException { return voidInvoice((Map) null, options); @@ -2005,14 +2005,14 @@ public Invoice voidInvoice(RequestOptions options) throws StripeException { /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(Map params) throws StripeException { return voidInvoice(params, (RequestOptions) null); @@ -2020,14 +2020,14 @@ public Invoice voidInvoice(Map params) throws StripeException { /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(Map params, RequestOptions options) throws StripeException { @@ -2039,14 +2039,14 @@ public Invoice voidInvoice(Map params, RequestOptions options) /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(InvoiceVoidInvoiceParams params) throws StripeException { return voidInvoice(params, (RequestOptions) null); @@ -2054,14 +2054,14 @@ public Invoice voidInvoice(InvoiceVoidInvoiceParams params) throws StripeExcepti /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(InvoiceVoidInvoiceParams params, RequestOptions options) throws StripeException { @@ -2466,8 +2466,9 @@ public void setSubscriptionObject(Subscription expandableObject) { @EqualsAndHashCode(callSuper = false) public static class PauseCollection extends StripeObject { /** - * The payment collection behavior for this subscription while paused. One of {@code - * keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * The payment collection behavior for this subscription while paused. + * + *

One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. */ @SerializedName("behavior") String behavior; @@ -2605,7 +2606,7 @@ public static class AcssDebit extends StripeObject { MandateOptions mandateOptions; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -2827,6 +2828,13 @@ public static class Pix extends StripeObject { */ @SerializedName("amount_includes_iof") String amountIncludesIof; + + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; } /** @@ -2894,7 +2902,7 @@ public static class UsBankAccount extends StripeObject { FinancialConnections financialConnections; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ diff --git a/src/main/java/com/stripe/model/InvoiceItem.java b/src/main/java/com/stripe/model/InvoiceItem.java index be8a5a97fc2..46d123f002d 100644 --- a/src/main/java/com/stripe/model/InvoiceItem.java +++ b/src/main/java/com/stripe/model/InvoiceItem.java @@ -104,8 +104,8 @@ public class InvoiceItem extends ApiResource implements HasId, MetadataStore invoice; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -163,12 +163,21 @@ public class InvoiceItem extends ApiResource implements HasId, MetadataStoreAPI + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param refers + * to the exact amount to be charged in future payments. If {@code maximum}, the amount + * charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + String amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + } + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/Margin.java b/src/main/java/com/stripe/model/Margin.java index ef61b44fe6f..17897bbb0ab 100644 --- a/src/main/java/com/stripe/model/Margin.java +++ b/src/main/java/com/stripe/model/Margin.java @@ -43,8 +43,8 @@ public class Margin extends ApiResource implements HasId, MetadataStore String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Order.java b/src/main/java/com/stripe/model/Order.java index 697bfc8e578..28370921721 100644 --- a/src/main/java/com/stripe/model/Order.java +++ b/src/main/java/com/stripe/model/Order.java @@ -120,8 +120,8 @@ public class Order extends ApiResource implements HasId, MetadataStore { LineItemCollection lineItems; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -742,7 +742,7 @@ public static class AcssDebit extends StripeObject { String targetDate; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ diff --git a/src/main/java/com/stripe/model/PaymentAttemptRecord.java b/src/main/java/com/stripe/model/PaymentAttemptRecord.java index 77bbfeed573..ec56f61a6e0 100644 --- a/src/main/java/com/stripe/model/PaymentAttemptRecord.java +++ b/src/main/java/com/stripe/model/PaymentAttemptRecord.java @@ -85,8 +85,8 @@ public class PaymentAttemptRecord extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -591,6 +591,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -1394,6 +1397,38 @@ public static class ThreeDSecure extends StripeObject { @SerializedName("authentication_flow") String authenticationFlow; + /** + * The 3D Secure cryptogram, also known as the "authentication value" (AAV, CAVV + * or AEVV). + */ + @SerializedName("cryptogram") + String cryptogram; + + /** + * The Electronic Commerce Indicator (ECI). A protocol-level field indicating what degree of + * authentication was performed. + * + *

One of {@code 01}, {@code 02}, {@code 03}, {@code 04}, {@code 05}, {@code 06}, or + * {@code 07}. + */ + @SerializedName("electronic_commerce_indicator") + String electronicCommerceIndicator; + + /** + * The exemption requested via 3DS and accepted by the issuer at authentication time. + * + *

One of {@code low_risk}, or {@code none}. + */ + @SerializedName("exemption_indicator") + String exemptionIndicator; + + /** + * Whether Stripe requested the value of {@code exemption_indicator} in the transaction. + * This will depend on the outcome of Stripe's internal risk assessment. + */ + @SerializedName("exemption_indicator_applied") + Boolean exemptionIndicatorApplied; + /** * Indicates the outcome of 3D Secure authentication. * @@ -1809,7 +1844,8 @@ public static class Crypto extends StripeObject { /** * The blockchain network that the transaction was sent on. * - *

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. + *

One of {@code base}, {@code ethereum}, {@code polygon}, {@code solana}, or {@code + * tempo}. */ @SerializedName("network") String network; @@ -3209,16 +3245,6 @@ public static class StripeBalance extends StripeObject { /** The connected account ID whose Stripe balance to use as the source of payment. */ @SerializedName("account") String account; - - /** - * The source_type - * of the balance - * - *

One of {@code bank_account}, {@code card}, or {@code fpx}. - */ - @SerializedName("source_type") - String sourceType; } /** @@ -3254,6 +3280,19 @@ public static class Swish extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Twint extends StripeObject {} + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Customer's unique Virtual Payment Address. */ + @SerializedName("vpa") + String vpa; + } + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index e4f25675a60..590e4249a49 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -231,8 +231,8 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore

latestCharge; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -609,9 +609,9 @@ public PaymentIntent applyCustomerBalance( * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel() throws StripeException { return cancel((Map) null, (RequestOptions) null); @@ -627,9 +627,9 @@ public PaymentIntent cancel() throws StripeException { * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(RequestOptions options) throws StripeException { return cancel((Map) null, options); @@ -645,9 +645,9 @@ public PaymentIntent cancel(RequestOptions options) throws StripeException { * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(Map params) throws StripeException { return cancel(params, (RequestOptions) null); @@ -663,9 +663,9 @@ public PaymentIntent cancel(Map params) throws StripeException { * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(Map params, RequestOptions options) throws StripeException { @@ -686,9 +686,9 @@ public PaymentIntent cancel(Map params, RequestOptions options) * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(PaymentIntentCancelParams params) throws StripeException { return cancel(params, (RequestOptions) null); @@ -704,9 +704,9 @@ public PaymentIntent cancel(PaymentIntentCancelParams params) throws StripeExcep * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(PaymentIntentCancelParams params, RequestOptions options) throws StripeException { @@ -1741,6 +1741,9 @@ public static class AmountDetails extends StripeObject { @SerializedName("shipping") Shipping shipping; + @SerializedName("surcharge") + Surcharge surcharge; + @SerializedName("tax") Tax tax; @@ -1800,6 +1803,35 @@ public static class Shipping extends StripeObject { String toPostalCode; } + /** + * For more details about Surcharge, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Surcharge extends StripeObject { + /** Portion of the amount that corresponds to a surcharge. */ + @SerializedName("amount") + Long amount; + + /** + * Indicate whether to enforce validations on the surcharge amount. + * + *

One of {@code automatic}, {@code disabled}, or {@code enabled}. + */ + @SerializedName("enforce_validation") + String enforceValidation; + + /** The maximum amount allowed for the surcharge. */ + @SerializedName("maximum_amount") + Long maximumAmount; + + /** The status of the surcharge. */ + @SerializedName("status") + String status; + } + /** * For more details about Tax, please refer to the API * Reference. @@ -2008,6 +2040,9 @@ public static class NextAction extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi_handle_redirect_or_display_qr_code") + UpiHandleRedirectOrDisplayQrCode upiHandleRedirectOrDisplayQrCode; + /** * When confirming a PaymentIntent 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 @@ -2767,6 +2802,45 @@ public static class QrCode extends StripeObject { } } + /** + * For more details about UpiHandleRedirectOrDisplayQrCode, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UpiHandleRedirectOrDisplayQrCode extends StripeObject { + /** + * The URL to the hosted UPI instructions page, which allows customers to view the QR code. + */ + @SerializedName("hosted_instructions_url") + String hostedInstructionsUrl; + + @SerializedName("qr_code") + QrCode qrCode; + + /** + * For more details about QrCode, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class QrCode extends StripeObject { + /** The date (unix timestamp) when the QR code expires. */ + @SerializedName("expires_at") + Long expiresAt; + + /** The image_url_png string used to render QR code. */ + @SerializedName("image_url_png") + String imageUrlPng; + + /** The image_url_svg string used to render QR code. */ + @SerializedName("image_url_svg") + String imageUrlSvg; + } + } + /** * For more details about VerifyWithMicrodeposits, please refer to the API Reference. @@ -2925,10 +2999,6 @@ public static class PaymentDetails extends StripeObject { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -4543,6 +4613,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("twint") Twint twint; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -4596,7 +4669,7 @@ public static class AcssDebit extends StripeObject { String targetDate; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -5310,7 +5383,7 @@ public static class Plan extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class MandateOptions extends StripeObject { - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ @SerializedName("amount") Long amount; @@ -7119,6 +7192,9 @@ public static class Sofort extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class StripeBalance extends StripeObject { + @SerializedName("mandate_options") + MandateOptions mandateOptions; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -7142,6 +7218,19 @@ public static class StripeBalance extends StripeObject { */ @SerializedName("setup_future_usage") String setupFutureUsage; + + /** + * For more details about MandateOptions, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** The ID of the Stripe Balance Debit Agreement used for this mandate. */ + @SerializedName("stripe_balance_debit_agreement") + String stripeBalanceDebitAgreement; + } } /** @@ -7214,6 +7303,39 @@ public static class Twint extends StripeObject { String setupFutureUsage; } + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

If you provide a Customer with the PaymentIntent, you can use this parameter to attach the payment method to the + * Customer after the PaymentIntent is confirmed and the customer completes any required + * actions. If you don't provide a Customer, you can still attach the payment method to a + * Customer after the transaction completes. + * + *

If the payment method is {@code card_present} and isn't a digital wallet, Stripe creates + * and attaches a generated_card + * payment method representing the card to the Customer instead. + * + *

When processing card payments, Stripe uses {@code setup_future_usage} to help you comply + * with regional legislation and network rules, such as SCA. + * + *

One of {@code off_session}, or {@code on_session}. + */ + @SerializedName("setup_future_usage") + String setupFutureUsage; + } + /** * For more details about UsBankAccount, please refer to the API Reference. @@ -7228,14 +7350,6 @@ public static class UsBankAccount extends StripeObject { @SerializedName("mandate_options") MandateOptions mandateOptions; - /** - * Preferred transaction settlement speed - * - *

One of {@code fastest}, or {@code standard}. - */ - @SerializedName("preferred_settlement_speed") - String preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -7277,7 +7391,7 @@ public static class UsBankAccount extends StripeObject { String transactionPurpose; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ diff --git a/src/main/java/com/stripe/model/PaymentLink.java b/src/main/java/com/stripe/model/PaymentLink.java index d6282f9987d..0128d02b34a 100644 --- a/src/main/java/com/stripe/model/PaymentLink.java +++ b/src/main/java/com/stripe/model/PaymentLink.java @@ -130,12 +130,22 @@ public class PaymentLink extends ApiResource implements HasId, MetadataStoreCheckoutSessions, PaymentIntents, Invoices, and Subscriptions. + */ + @SerializedName("managed_payments") + ManagedPayments managedPayments; + /** * 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 @@ -1043,6 +1053,23 @@ public static class RenderingOptions extends StripeObject { } } + /** + * For more details about ManagedPayments, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ManagedPayments extends StripeObject { + /** + * Set to {@code true} to enable Managed Payments, Stripe's + * merchant of record solution, for this session. + */ + @SerializedName("enabled") + Boolean enabled; + } + /** * For more details about NameCollection, please refer to the API Reference. @@ -1491,6 +1518,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(customText, responseGetter); trySetResponseGetter(invoiceCreation, responseGetter); trySetResponseGetter(lineItems, responseGetter); + trySetResponseGetter(managedPayments, responseGetter); trySetResponseGetter(nameCollection, responseGetter); trySetResponseGetter(onBehalfOf, responseGetter); trySetResponseGetter(paymentIntentData, responseGetter); diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 64813a63582..19fd1e33b53 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -168,8 +168,8 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore

source_type - * of the balance - * - *

One of {@code bank_account}, {@code card}, or {@code fpx}. - */ - @SerializedName("source_type") - String sourceType; } /** @@ -2717,6 +2710,19 @@ public static class Swish extends StripeObject {} @EqualsAndHashCode(callSuper = false) public static class Twint extends StripeObject {} + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Customer's unique Virtual Payment Address. */ + @SerializedName("vpa") + String vpa; + } + /** * For more details about UsBankAccount, please refer to the API Reference. @@ -2917,6 +2923,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(stripeBalance, responseGetter); trySetResponseGetter(swish, responseGetter); trySetResponseGetter(twint, responseGetter); + trySetResponseGetter(upi, responseGetter); trySetResponseGetter(usBankAccount, responseGetter); trySetResponseGetter(wechatPay, responseGetter); trySetResponseGetter(zip, responseGetter); diff --git a/src/main/java/com/stripe/model/PaymentMethodConfiguration.java b/src/main/java/com/stripe/model/PaymentMethodConfiguration.java index 0da6fc839cc..664a2223199 100644 --- a/src/main/java/com/stripe/model/PaymentMethodConfiguration.java +++ b/src/main/java/com/stripe/model/PaymentMethodConfiguration.java @@ -166,8 +166,8 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId { Link link; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -260,6 +260,9 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId { @SerializedName("twint") Twint twint; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -3279,6 +3282,57 @@ public static class DisplayPreference extends StripeObject { } } + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** + * Whether this payment method may be offered at checkout. True if {@code display_preference} is + * {@code on} and the payment method's capability is active. + */ + @SerializedName("available") + Boolean available; + + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * For more details about DisplayPreference, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference extends StripeObject { + /** + * For child configs, whether or not the account's preference will be observed. If {@code + * false}, the parent configuration's default is used. + */ + @SerializedName("overridable") + Boolean overridable; + + /** + * The account's display preference. + * + *

One of {@code none}, {@code off}, or {@code on}. + */ + @SerializedName("preference") + String preference; + + /** + * The effective display preference value. + * + *

One of {@code off}, or {@code on}. + */ + @SerializedName("value") + String value; + } + } + /** * For more details about UsBankAccount, please refer to the API Reference. @@ -3491,6 +3545,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(sofort, responseGetter); trySetResponseGetter(swish, responseGetter); trySetResponseGetter(twint, responseGetter); + trySetResponseGetter(upi, responseGetter); trySetResponseGetter(usBankAccount, responseGetter); trySetResponseGetter(wechatPay, responseGetter); trySetResponseGetter(zip, responseGetter); diff --git a/src/main/java/com/stripe/model/PaymentMethodDomain.java b/src/main/java/com/stripe/model/PaymentMethodDomain.java index 9343eb0023a..cd7a01b69b1 100644 --- a/src/main/java/com/stripe/model/PaymentMethodDomain.java +++ b/src/main/java/com/stripe/model/PaymentMethodDomain.java @@ -73,8 +73,8 @@ public class PaymentMethodDomain extends ApiResource implements HasId { Link link; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/PaymentRecord.java b/src/main/java/com/stripe/model/PaymentRecord.java index eaf85f30009..d8300894e48 100644 --- a/src/main/java/com/stripe/model/PaymentRecord.java +++ b/src/main/java/com/stripe/model/PaymentRecord.java @@ -96,8 +96,8 @@ public class PaymentRecord extends ApiResource implements HasId { String latestPaymentAttemptRecord; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -893,6 +893,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -1696,6 +1699,38 @@ public static class ThreeDSecure extends StripeObject { @SerializedName("authentication_flow") String authenticationFlow; + /** + * The 3D Secure cryptogram, also known as the "authentication value" (AAV, CAVV + * or AEVV). + */ + @SerializedName("cryptogram") + String cryptogram; + + /** + * The Electronic Commerce Indicator (ECI). A protocol-level field indicating what degree of + * authentication was performed. + * + *

One of {@code 01}, {@code 02}, {@code 03}, {@code 04}, {@code 05}, {@code 06}, or + * {@code 07}. + */ + @SerializedName("electronic_commerce_indicator") + String electronicCommerceIndicator; + + /** + * The exemption requested via 3DS and accepted by the issuer at authentication time. + * + *

One of {@code low_risk}, or {@code none}. + */ + @SerializedName("exemption_indicator") + String exemptionIndicator; + + /** + * Whether Stripe requested the value of {@code exemption_indicator} in the transaction. + * This will depend on the outcome of Stripe's internal risk assessment. + */ + @SerializedName("exemption_indicator_applied") + Boolean exemptionIndicatorApplied; + /** * Indicates the outcome of 3D Secure authentication. * @@ -2111,7 +2146,8 @@ public static class Crypto extends StripeObject { /** * The blockchain network that the transaction was sent on. * - *

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. + *

One of {@code base}, {@code ethereum}, {@code polygon}, {@code solana}, or {@code + * tempo}. */ @SerializedName("network") String network; @@ -3510,16 +3546,6 @@ public static class StripeBalance extends StripeObject { /** The connected account ID whose Stripe balance to use as the source of payment. */ @SerializedName("account") String account; - - /** - * The source_type - * of the balance - * - *

One of {@code bank_account}, {@code card}, or {@code fpx}. - */ - @SerializedName("source_type") - String sourceType; } /** @@ -3555,6 +3581,19 @@ public static class Swish extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Twint extends StripeObject {} + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + /** Customer's unique Virtual Payment Address. */ + @SerializedName("vpa") + String vpa; + } + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/PaymentSourceCollection.java b/src/main/java/com/stripe/model/PaymentSourceCollection.java index 7976909856a..f651147d3ae 100644 --- a/src/main/java/com/stripe/model/PaymentSourceCollection.java +++ b/src/main/java/com/stripe/model/PaymentSourceCollection.java @@ -19,8 +19,8 @@ public class PaymentSourceCollection extends StripeCollection { * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -32,8 +32,8 @@ public PaymentSource create(Map params) throws StripeException { * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create(Map params, RequestOptions options) throws StripeException { @@ -49,8 +49,8 @@ public PaymentSource create(Map params, RequestOptions options) * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create(PaymentSourceCollectionCreateParams params) throws StripeException { return create(params, (RequestOptions) null); @@ -62,8 +62,8 @@ public PaymentSource create(PaymentSourceCollectionCreateParams params) throws S * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create(PaymentSourceCollectionCreateParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/model/Payout.java b/src/main/java/com/stripe/model/Payout.java index a7015e9eefc..9aded0baefb 100644 --- a/src/main/java/com/stripe/model/Payout.java +++ b/src/main/java/com/stripe/model/Payout.java @@ -128,8 +128,8 @@ public class Payout extends ApiResource implements MetadataStore, Balanc String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -403,8 +403,8 @@ public Payout cancel(PayoutCancelParams params, RequestOptions options) throws S * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public static Payout create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -420,8 +420,8 @@ public static Payout create(Map params) throws StripeException { * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public static Payout create(Map params, RequestOptions options) throws StripeException { @@ -441,8 +441,8 @@ public static Payout create(Map params, RequestOptions options) * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public static Payout create(PayoutCreateParams params) throws StripeException { return create(params, (RequestOptions) null); @@ -458,8 +458,8 @@ public static Payout create(PayoutCreateParams params) throws StripeException { * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public static Payout create(PayoutCreateParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/model/Plan.java b/src/main/java/com/stripe/model/Plan.java index 99a23a59c21..3276b347c69 100644 --- a/src/main/java/com/stripe/model/Plan.java +++ b/src/main/java/com/stripe/model/Plan.java @@ -110,8 +110,8 @@ public class Plan extends ApiResource implements HasId, MetadataStore { Long intervalCount; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Price.java b/src/main/java/com/stripe/model/Price.java index 3441e837841..93179bbd85e 100644 --- a/src/main/java/com/stripe/model/Price.java +++ b/src/main/java/com/stripe/model/Price.java @@ -95,8 +95,8 @@ public class Price extends ApiResource implements HasId, MetadataStore { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Product.java b/src/main/java/com/stripe/model/Product.java index 62d297b6471..1981d9a2989 100644 --- a/src/main/java/com/stripe/model/Product.java +++ b/src/main/java/com/stripe/model/Product.java @@ -78,8 +78,8 @@ public class Product extends ApiResource implements HasId, MetadataStore images; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/ProductFeature.java b/src/main/java/com/stripe/model/ProductFeature.java index 5a28860688b..25e208389ce 100644 --- a/src/main/java/com/stripe/model/ProductFeature.java +++ b/src/main/java/com/stripe/model/ProductFeature.java @@ -45,8 +45,8 @@ public class ProductFeature extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/PromotionCode.java b/src/main/java/com/stripe/model/PromotionCode.java index 07257537e10..1dc8bc05a09 100644 --- a/src/main/java/com/stripe/model/PromotionCode.java +++ b/src/main/java/com/stripe/model/PromotionCode.java @@ -71,8 +71,8 @@ public class PromotionCode extends ApiResource implements HasId, MetadataStore

{ List lines; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/QuoteLine.java b/src/main/java/com/stripe/model/QuoteLine.java index 371937fbd56..6425e8e4b11 100644 --- a/src/main/java/com/stripe/model/QuoteLine.java +++ b/src/main/java/com/stripe/model/QuoteLine.java @@ -308,6 +308,10 @@ public static class AddItem extends StripeObject { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + /** Get ID of expandable {@code price} object. */ public String getPrice() { return (this.price != null) ? this.price.getId() : null; @@ -755,6 +759,10 @@ public static class SetItem extends StripeObject { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + /** Get ID of expandable {@code price} object. */ public String getPrice() { return (this.price != null) ? this.price.getId() : null; @@ -1077,8 +1085,9 @@ public static class SetPauseCollection extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Set extends StripeObject { /** - * The payment collection behavior for this subscription while paused. One of {@code - * keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * The payment collection behavior for this subscription while paused. + * + *

One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. */ @SerializedName("behavior") String behavior; diff --git a/src/main/java/com/stripe/model/QuotePreviewInvoice.java b/src/main/java/com/stripe/model/QuotePreviewInvoice.java index 5d211ea36ca..6e4b93cd64d 100644 --- a/src/main/java/com/stripe/model/QuotePreviewInvoice.java +++ b/src/main/java/com/stripe/model/QuotePreviewInvoice.java @@ -374,8 +374,8 @@ public class QuotePreviewInvoice extends ApiResource implements HasId { InvoiceLineItemCollection lines; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -1287,8 +1287,9 @@ public void setSubscriptionObject(Subscription expandableObject) { @EqualsAndHashCode(callSuper = false) public static class PauseCollection extends StripeObject { /** - * The payment collection behavior for this subscription while paused. One of {@code - * keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * The payment collection behavior for this subscription while paused. + * + *

One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. */ @SerializedName("behavior") String behavior; @@ -1426,7 +1427,7 @@ public static class AcssDebit extends StripeObject { MandateOptions mandateOptions; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -1648,6 +1649,13 @@ public static class Pix extends StripeObject { */ @SerializedName("amount_includes_iof") String amountIncludesIof; + + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; } /** @@ -1715,7 +1723,7 @@ public static class UsBankAccount extends StripeObject { FinancialConnections financialConnections; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ diff --git a/src/main/java/com/stripe/model/QuotePreviewSubscriptionSchedule.java b/src/main/java/com/stripe/model/QuotePreviewSubscriptionSchedule.java index 07c337d4798..2e948fb2913 100644 --- a/src/main/java/com/stripe/model/QuotePreviewSubscriptionSchedule.java +++ b/src/main/java/com/stripe/model/QuotePreviewSubscriptionSchedule.java @@ -106,8 +106,8 @@ public class QuotePreviewSubscriptionSchedule extends ApiResource implements Has LastPriceMigrationError lastPriceMigrationError; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -1599,6 +1599,10 @@ public static class Item extends StripeObject { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + /** Get ID of expandable {@code plan} object. */ public String getPlan() { return (this.plan != null) ? this.plan.getId() : null; @@ -1791,8 +1795,9 @@ public static class Trial extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class PauseCollection extends StripeObject { /** - * The payment collection behavior for this subscription while paused. One of {@code - * keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * The payment collection behavior for this subscription while paused. + * + *

One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. */ @SerializedName("behavior") String behavior; diff --git a/src/main/java/com/stripe/model/Review.java b/src/main/java/com/stripe/model/Review.java index c3487280d94..ec652c28ac5 100644 --- a/src/main/java/com/stripe/model/Review.java +++ b/src/main/java/com/stripe/model/Review.java @@ -68,8 +68,8 @@ public class Review extends ApiResource implements HasId { IpAddressLocation ipAddressLocation; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/SetupAttempt.java b/src/main/java/com/stripe/model/SetupAttempt.java index acda61f4b9d..d5e48d50c94 100644 --- a/src/main/java/com/stripe/model/SetupAttempt.java +++ b/src/main/java/com/stripe/model/SetupAttempt.java @@ -84,8 +84,8 @@ public class SetupAttempt extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -356,6 +356,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -1142,6 +1145,15 @@ public void setGeneratedSepaDebitMandateObject(Mandate expandableObject) { @EqualsAndHashCode(callSuper = false) public static class StripeBalance extends StripeObject {} + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject {} + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/SetupIntent.java b/src/main/java/com/stripe/model/SetupIntent.java index 1d03f94012c..995dcfd7ae9 100644 --- a/src/main/java/com/stripe/model/SetupIntent.java +++ b/src/main/java/com/stripe/model/SetupIntent.java @@ -151,8 +151,8 @@ public class SetupIntent extends ApiResource implements HasId, MetadataStore latestAttempt; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -910,6 +910,9 @@ public static class NextAction extends StripeObject { @SerializedName("type") String type; + @SerializedName("upi_handle_redirect_or_display_qr_code") + UpiHandleRedirectOrDisplayQrCode upiHandleRedirectOrDisplayQrCode; + /** * 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 @@ -1020,6 +1023,45 @@ public static class RedirectToUrl extends StripeObject { String url; } + /** + * For more details about UpiHandleRedirectOrDisplayQrCode, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UpiHandleRedirectOrDisplayQrCode extends StripeObject { + /** + * The URL to the hosted UPI instructions page, which allows customers to view the QR code. + */ + @SerializedName("hosted_instructions_url") + String hostedInstructionsUrl; + + @SerializedName("qr_code") + QrCode qrCode; + + /** + * For more details about QrCode, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class QrCode extends StripeObject { + /** The date (unix timestamp) when the QR code expires. */ + @SerializedName("expires_at") + Long expiresAt; + + /** The image_url_png string used to render QR code. */ + @SerializedName("image_url_png") + String imageUrlPng; + + /** The image_url_svg string used to render QR code. */ + @SerializedName("image_url_svg") + String imageUrlSvg; + } + } + /** * For more details about VerifyWithMicrodeposits, please refer to the API Reference. @@ -1109,6 +1151,12 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("sepa_debit") SepaDebit sepaDebit; + @SerializedName("stripe_balance") + StripeBalance stripeBalance; + + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -1132,7 +1180,7 @@ public static class AcssDebit extends StripeObject { MandateOptions mandateOptions; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -1261,7 +1309,7 @@ public static class Card extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class MandateOptions extends StripeObject { - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ @SerializedName("amount") Long amount; @@ -1581,6 +1629,75 @@ public static class MandateOptions extends StripeObject { } } + /** + * For more details about StripeBalance, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StripeBalance extends StripeObject { + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * For more details about MandateOptions, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** The ID of the Stripe Balance Debit Agreement used for this mandate. */ + @SerializedName("stripe_balance_debit_agreement") + String stripeBalanceDebitAgreement; + } + } + + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * For more details about MandateOptions, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + String amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + } + } + /** * For more details about UsBankAccount, please refer to the API Reference. @@ -1596,7 +1713,7 @@ public static class UsBankAccount extends StripeObject { MandateOptions mandateOptions; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ diff --git a/src/main/java/com/stripe/model/ShippingRate.java b/src/main/java/com/stripe/model/ShippingRate.java index 4615d03b48a..e3fa070698f 100644 --- a/src/main/java/com/stripe/model/ShippingRate.java +++ b/src/main/java/com/stripe/model/ShippingRate.java @@ -58,8 +58,8 @@ public class ShippingRate extends ApiResource implements HasId, MetadataStore, Paymen Klarna klarna; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/SourceMandateNotification.java b/src/main/java/com/stripe/model/SourceMandateNotification.java index 6a1c794cbb3..47cf5d94eac 100644 --- a/src/main/java/com/stripe/model/SourceMandateNotification.java +++ b/src/main/java/com/stripe/model/SourceMandateNotification.java @@ -39,8 +39,8 @@ public class SourceMandateNotification extends StripeObject implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/SourceTransaction.java b/src/main/java/com/stripe/model/SourceTransaction.java index 9d6a74069e8..01b1a8dd349 100644 --- a/src/main/java/com/stripe/model/SourceTransaction.java +++ b/src/main/java/com/stripe/model/SourceTransaction.java @@ -49,8 +49,8 @@ public class SourceTransaction extends StripeObject implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/StripeError.java b/src/main/java/com/stripe/model/StripeError.java index a8cb06991f0..e3e7ce268bb 100644 --- a/src/main/java/com/stripe/model/StripeError.java +++ b/src/main/java/com/stripe/model/StripeError.java @@ -96,7 +96,8 @@ public class StripeError extends StripeObject { * refer_to_customer}, {@code refund_disputed_payment}, {@code request_blocked}, {@code * resource_already_exists}, {@code resource_missing}, {@code return_intent_already_processed}, * {@code routing_number_invalid}, {@code secret_key_required}, {@code - * sensitive_data_access_expired}, {@code sepa_unsupported_account}, {@code setup_attempt_failed}, + * sensitive_data_access_expired}, {@code sepa_unsupported_account}, {@code + * service_period_coupon_with_metered_tiered_item_unsupported}, {@code setup_attempt_failed}, * {@code setup_intent_authentication_failure}, {@code setup_intent_invalid_parameter}, {@code * setup_intent_mandate_invalid}, {@code setup_intent_mobile_wallet_unsupported}, {@code * setup_intent_setup_attempt_expired}, {@code setup_intent_unexpected_state}, {@code diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index f912e581ced..e6c7e18685e 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -224,8 +224,8 @@ public class Subscription extends ApiResource implements HasId, MetadataStore latestInvoice; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -288,8 +288,8 @@ public class Subscription extends ApiResource implements HasId, MetadataStoreCreate an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ @SerializedName("pending_invoice_item_interval") PendingInvoiceItemInterval pendingInvoiceItemInterval; @@ -319,6 +319,9 @@ public class Subscription extends ApiResource implements HasId, MetadataStore objs) { * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -632,9 +635,9 @@ public Subscription cancel() throws StripeException { * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -654,9 +657,9 @@ public Subscription cancel(Map params) throws StripeException { * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -680,9 +683,9 @@ public Subscription cancel(Map params, RequestOptions options) * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -702,9 +705,9 @@ public Subscription cancel(SubscriptionCancelParams params) throws StripeExcepti * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -1618,8 +1621,8 @@ public static class CancellationDetails extends StripeObject { /** * Why this subscription was canceled. * - *

One of {@code cancellation_requested}, {@code payment_disputed}, or {@code - * payment_failed}. + *

One of {@code canceled_by_retention_policy}, {@code cancellation_requested}, {@code + * payment_disputed}, or {@code payment_failed}. */ @SerializedName("reason") String reason; @@ -1797,8 +1800,9 @@ public static class ManagedPayments extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class PauseCollection extends StripeObject { /** - * The payment collection behavior for this subscription while paused. One of {@code - * keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * The payment collection behavior for this subscription while paused. + * + *

One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. */ @SerializedName("behavior") String behavior; @@ -1936,7 +1940,7 @@ public static class AcssDebit extends StripeObject { MandateOptions mandateOptions; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -2020,7 +2024,7 @@ public static class Card extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class MandateOptions extends StripeObject { - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ @SerializedName("amount") Long amount; @@ -2173,6 +2177,13 @@ public static class MandateOptions extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Pix extends StripeObject { + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + @SerializedName("mandate_options") MandateOptions mandateOptions; @@ -2279,7 +2290,7 @@ public static class UsBankAccount extends StripeObject { FinancialConnections financialConnections; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -2457,6 +2468,19 @@ public void setInvoiceObject(Invoice expandableObject) { } } + /** + * For more details about PresentmentDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PresentmentDetails extends StripeObject { + /** Currency used for customer payments. */ + @SerializedName("presentment_currency") + String presentmentCurrency; + } + /** * For more details about TransferData, please refer to the API Reference. @@ -2512,6 +2536,15 @@ public static class TrialSettings extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class EndBehavior extends StripeObject { + /** + * Indicates how the subscription's billing cycle anchor is reset when a trial ends. If not + * set, the default is {@code now}. + * + *

One of {@code now}, or {@code unchanged}. + */ + @SerializedName("billing_cycle_anchor") + String billingCycleAnchor; + /** * Indicates how the subscription should change when the trial ends if the user did not * provide a payment method. @@ -2547,6 +2580,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(pendingSetupIntent, responseGetter); trySetResponseGetter(pendingUpdate, responseGetter); trySetResponseGetter(prebilling, responseGetter); + trySetResponseGetter(presentmentDetails, responseGetter); trySetResponseGetter(schedule, responseGetter); trySetResponseGetter(testClock, responseGetter); trySetResponseGetter(transferData, responseGetter); diff --git a/src/main/java/com/stripe/model/SubscriptionItem.java b/src/main/java/com/stripe/model/SubscriptionItem.java index 93d42eac77e..553863129f2 100644 --- a/src/main/java/com/stripe/model/SubscriptionItem.java +++ b/src/main/java/com/stripe/model/SubscriptionItem.java @@ -53,6 +53,10 @@ public class SubscriptionItem extends ApiResource @SerializedName("current_period_start") Long currentPeriodStart; + /** The current trial that is applied to this subscription item. */ + @SerializedName("current_trial") + CurrentTrial currentTrial; + /** Always true for a deleted object. */ @SerializedName("deleted") Boolean deleted; @@ -408,6 +412,21 @@ public static class BillingThresholds extends StripeObject { Long usageGte; } + /** The current trial attached to the subscription item. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CurrentTrial extends StripeObject { + @SerializedName("end_date") + Long endDate; + + @SerializedName("start_date") + Long startDate; + + @SerializedName("trial_offer") + String trialOffer; + } + /** * For more details about Trial, please refer to the API * Reference. @@ -436,6 +455,7 @@ public static class Trial extends StripeObject { public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(billingThresholds, responseGetter); + trySetResponseGetter(currentTrial, responseGetter); trySetResponseGetter(plan, responseGetter); trySetResponseGetter(price, responseGetter); trySetResponseGetter(trial, responseGetter); diff --git a/src/main/java/com/stripe/model/SubscriptionSchedule.java b/src/main/java/com/stripe/model/SubscriptionSchedule.java index 38ef2cbdb2f..5ae0076faf9 100644 --- a/src/main/java/com/stripe/model/SubscriptionSchedule.java +++ b/src/main/java/com/stripe/model/SubscriptionSchedule.java @@ -118,8 +118,8 @@ public class SubscriptionSchedule extends ApiResource LastPriceMigrationError lastPriceMigrationError; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -1913,6 +1913,10 @@ public static class Item extends StripeObject { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + /** Get ID of expandable {@code plan} object. */ public String getPlan() { return (this.plan != null) ? this.plan.getId() : null; @@ -2105,8 +2109,9 @@ public static class Trial extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class PauseCollection extends StripeObject { /** - * The payment collection behavior for this subscription while paused. One of {@code - * keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * The payment collection behavior for this subscription while paused. + * + *

One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. */ @SerializedName("behavior") String behavior; diff --git a/src/main/java/com/stripe/model/TaxCode.java b/src/main/java/com/stripe/model/TaxCode.java index 0d2f8b945f6..8bd65c97281 100644 --- a/src/main/java/com/stripe/model/TaxCode.java +++ b/src/main/java/com/stripe/model/TaxCode.java @@ -8,6 +8,7 @@ import com.stripe.net.ApiResource; import com.stripe.net.BaseAddress; import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; import com.stripe.param.TaxCodeListParams; import com.stripe.param.TaxCodeRetrieveParams; import java.util.Map; @@ -44,6 +45,14 @@ public class TaxCode extends ApiResource implements HasId { @SerializedName("object") String object; + /** + * An object that describes more information about the tax location required for this tax code. + * Some tax + * codes require a tax location of type {@code performance} to calculate tax correctly. + */ + @SerializedName("requirements") + Requirements requirements; + /** * A list of all tax codes available to * add to Products in order to allow specific tax calculations. @@ -135,4 +144,28 @@ public static TaxCode retrieve(String id, TaxCodeRetrieveParams params, RequestO options); return getGlobalResponseGetter().request(request, TaxCode.class); } + + /** + * For more details about Requirements, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Requirements extends StripeObject { + /** + * Describes whether a performance location is required for a successful tax calculation with a + * tax code. + * + *

One of {@code optional}, or {@code required}. + */ + @SerializedName("performance_location") + String performanceLocation; + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(requirements, responseGetter); + } } diff --git a/src/main/java/com/stripe/model/TaxId.java b/src/main/java/com/stripe/model/TaxId.java index 7dbecfd4452..d21285fdced 100644 --- a/src/main/java/com/stripe/model/TaxId.java +++ b/src/main/java/com/stripe/model/TaxId.java @@ -58,8 +58,8 @@ public class TaxId extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/TaxRate.java b/src/main/java/com/stripe/model/TaxRate.java index af094958079..72799fe33e5 100644 --- a/src/main/java/com/stripe/model/TaxRate.java +++ b/src/main/java/com/stripe/model/TaxRate.java @@ -108,8 +108,8 @@ public class TaxRate extends ApiResource implements HasId, MetadataStore, BalanceT /** * Error code explaining reason for top-up failure if available (see the errors section for a list of codes). + * href="https://stripe.com/api/errors">the errors section for a list of codes). */ @SerializedName("failure_code") String failureCode; @@ -82,8 +82,8 @@ public class Topup extends ApiResource implements MetadataStore, BalanceT String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/Transfer.java b/src/main/java/com/stripe/model/Transfer.java index 466c0690a81..5ef61c6eb30 100644 --- a/src/main/java/com/stripe/model/Transfer.java +++ b/src/main/java/com/stripe/model/Transfer.java @@ -94,8 +94,8 @@ public class Transfer extends ApiResource String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/WebhookEndpoint.java b/src/main/java/com/stripe/model/WebhookEndpoint.java index 71157bb11f3..4ae148715a9 100644 --- a/src/main/java/com/stripe/model/WebhookEndpoint.java +++ b/src/main/java/com/stripe/model/WebhookEndpoint.java @@ -65,8 +65,8 @@ public class WebhookEndpoint extends ApiResource implements HasId, MetadataStore String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/apps/Secret.java b/src/main/java/com/stripe/model/apps/Secret.java index 66e91925646..72a3e98dc19 100644 --- a/src/main/java/com/stripe/model/apps/Secret.java +++ b/src/main/java/com/stripe/model/apps/Secret.java @@ -60,8 +60,8 @@ public class Secret extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/billing/Alert.java b/src/main/java/com/stripe/model/billing/Alert.java index 437bee7c5a4..ec0f04e7b9e 100644 --- a/src/main/java/com/stripe/model/billing/Alert.java +++ b/src/main/java/com/stripe/model/billing/Alert.java @@ -48,8 +48,8 @@ public class Alert extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/billing/AlertTriggered.java b/src/main/java/com/stripe/model/billing/AlertTriggered.java index b7475411035..a2f4b736a66 100644 --- a/src/main/java/com/stripe/model/billing/AlertTriggered.java +++ b/src/main/java/com/stripe/model/billing/AlertTriggered.java @@ -29,8 +29,8 @@ public class AlertTriggered extends StripeObject { String customer; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/billing/CreditBalanceSummary.java b/src/main/java/com/stripe/model/billing/CreditBalanceSummary.java index 3a6ba11a814..a4639382c79 100644 --- a/src/main/java/com/stripe/model/billing/CreditBalanceSummary.java +++ b/src/main/java/com/stripe/model/billing/CreditBalanceSummary.java @@ -42,8 +42,8 @@ public class CreditBalanceSummary extends ApiResource { String customerAccount; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/billing/CreditBalanceTransaction.java b/src/main/java/com/stripe/model/billing/CreditBalanceTransaction.java index 03364483471..dff06b1f5ee 100644 --- a/src/main/java/com/stripe/model/billing/CreditBalanceTransaction.java +++ b/src/main/java/com/stripe/model/billing/CreditBalanceTransaction.java @@ -57,8 +57,8 @@ public class CreditBalanceTransaction extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/billing/CreditGrant.java b/src/main/java/com/stripe/model/billing/CreditGrant.java index f7475e96231..383ceb6d43c 100644 --- a/src/main/java/com/stripe/model/billing/CreditGrant.java +++ b/src/main/java/com/stripe/model/billing/CreditGrant.java @@ -82,8 +82,8 @@ public class CreditGrant extends ApiResource implements HasId, MetadataStoreOne of {@code custom}, {@code embedded}, or {@code hosted}. + *

One of {@code elements}, {@code embedded_page}, {@code form}, or {@code hosted_page}. */ @SerializedName("ui_mode") String uiMode; @@ -2170,6 +2177,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("twint") Twint twint; + @SerializedName("upi") + Upi upi; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -2225,7 +2235,7 @@ public static class AcssDebit extends StripeObject { String targetDate; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, {@code instant}, or {@code microdeposits}. */ @@ -4038,6 +4048,74 @@ public static class Twint extends StripeObject { String setupFutureUsage; } + /** + * For more details about Upi, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Upi extends StripeObject { + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

If you provide a Customer with the PaymentIntent, you can use this parameter to attach the payment method to the + * Customer after the PaymentIntent is confirmed and the customer completes any required + * actions. If you don't provide a Customer, you can still attach the payment method to a + * Customer after the transaction completes. + * + *

If the payment method is {@code card_present} and isn't a digital wallet, Stripe creates + * and attaches a generated_card + * payment method representing the card to the Customer instead. + * + *

When processing card payments, Stripe uses {@code setup_future_usage} to help you comply + * with regional legislation and network rules, such as SCA. + * + *

One of {@code none}, {@code off_session}, or {@code on_session}. + */ + @SerializedName("setup_future_usage") + String setupFutureUsage; + + /** + * For more details about MandateOptions, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + String amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + } + } + /** * For more details about UsBankAccount, please refer to the API Reference. @@ -4082,7 +4160,7 @@ public static class UsBankAccount extends StripeObject { String targetDate; /** - * Bank account verification method. + * Bank account verification method. The default value is {@code automatic}. * *

One of {@code automatic}, or {@code instant}. */ diff --git a/src/main/java/com/stripe/model/climate/Supplier.java b/src/main/java/com/stripe/model/climate/Supplier.java index c83382ccbf1..2403d5ad3ca 100644 --- a/src/main/java/com/stripe/model/climate/Supplier.java +++ b/src/main/java/com/stripe/model/climate/Supplier.java @@ -59,8 +59,8 @@ public class Supplier extends ApiResource implements HasId { /** * The scientific pathway used for carbon removal. * - *

One of {@code biomass_carbon_removal_and_storage}, {@code direct_air_capture}, or {@code - * enhanced_weathering}. + *

One of {@code biomass_carbon_removal_and_storage}, {@code direct_air_capture}, {@code + * enhanced_weathering}, or {@code marine_carbon_removal}. */ @SerializedName("removal_pathway") String removalPathway; diff --git a/src/main/java/com/stripe/model/entitlements/ActiveEntitlement.java b/src/main/java/com/stripe/model/entitlements/ActiveEntitlement.java index c8a5182648e..818cc808316 100644 --- a/src/main/java/com/stripe/model/entitlements/ActiveEntitlement.java +++ b/src/main/java/com/stripe/model/entitlements/ActiveEntitlement.java @@ -38,8 +38,8 @@ public class ActiveEntitlement extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/entitlements/ActiveEntitlementSummary.java b/src/main/java/com/stripe/model/entitlements/ActiveEntitlementSummary.java index ea98118e538..111f2efad8b 100644 --- a/src/main/java/com/stripe/model/entitlements/ActiveEntitlementSummary.java +++ b/src/main/java/com/stripe/model/entitlements/ActiveEntitlementSummary.java @@ -21,8 +21,8 @@ public class ActiveEntitlementSummary extends StripeObject { ActiveEntitlementCollection entitlements; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/entitlements/Feature.java b/src/main/java/com/stripe/model/entitlements/Feature.java index b6caf0e5936..4abcd771a4c 100644 --- a/src/main/java/com/stripe/model/entitlements/Feature.java +++ b/src/main/java/com/stripe/model/entitlements/Feature.java @@ -41,8 +41,8 @@ public class Feature extends ApiResource implements HasId, MetadataStoreOne of {@code hosted}, or {@code modal}. + */ + @SerializedName("ui_mode") + String uiMode; + + /** + * The hosted URL for this Session. Redirect customers to this URL to take them to the hosted + * authentication flow. This value is only present when the Session is active and the {@code + * ui_mode} is {@code hosted}. + */ + @SerializedName("url") + String url; + /** * To launch the Financial Connections authorization flow, create a {@code Session}. The session’s * {@code client_secret} can be used to launch the flow using Stripe.js. @@ -284,6 +304,31 @@ public static class Filters extends StripeObject { String institution; } + /** + * For more details about Hosted, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Hosted extends StripeObject { + /** + * How the user enters the hosted flow. You can only use the values {@code email} and {@code + * url} if you provide {@code relink_options}. + * + *

One of {@code email}, or {@code url}. + */ + @SerializedName("delivery_method") + String deliveryMethod; + + /** + * The URL to redirect your customer back to after they link their accounts or cancel this + * Session. This parameter is required if {@code ui_mode} is {@code hosted}. + */ + @SerializedName("return_url") + String returnUrl; + } + /** * For more details about Limits, please refer to the API * Reference. @@ -388,6 +433,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(accountHolder, responseGetter); trySetResponseGetter(accounts, responseGetter); trySetResponseGetter(filters, responseGetter); + trySetResponseGetter(hosted, responseGetter); trySetResponseGetter(limits, responseGetter); trySetResponseGetter(manualEntry, responseGetter); trySetResponseGetter(relinkOptions, responseGetter); diff --git a/src/main/java/com/stripe/model/financialconnections/Transaction.java b/src/main/java/com/stripe/model/financialconnections/Transaction.java index 0a32c7602cf..42003552cc8 100644 --- a/src/main/java/com/stripe/model/financialconnections/Transaction.java +++ b/src/main/java/com/stripe/model/financialconnections/Transaction.java @@ -50,8 +50,8 @@ public class Transaction extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/forwarding/Request.java b/src/main/java/com/stripe/model/forwarding/Request.java index 383e5b894b3..c11e24fef09 100644 --- a/src/main/java/com/stripe/model/forwarding/Request.java +++ b/src/main/java/com/stripe/model/forwarding/Request.java @@ -53,8 +53,8 @@ public class Request extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/identity/VerificationReport.java b/src/main/java/com/stripe/model/identity/VerificationReport.java index 229981621fb..d4137fffd35 100644 --- a/src/main/java/com/stripe/model/identity/VerificationReport.java +++ b/src/main/java/com/stripe/model/identity/VerificationReport.java @@ -69,8 +69,8 @@ public class VerificationReport extends ApiResource implements HasId { IdNumber idNumber; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/identity/VerificationSession.java b/src/main/java/com/stripe/model/identity/VerificationSession.java index c685348a47c..78e04f1cb34 100644 --- a/src/main/java/com/stripe/model/identity/VerificationSession.java +++ b/src/main/java/com/stripe/model/identity/VerificationSession.java @@ -91,8 +91,8 @@ public class VerificationSession extends ApiResource ExpandableField lastVerificationReport; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/Authorization.java b/src/main/java/com/stripe/model/issuing/Authorization.java index 80c1efef7f7..de680af9e89 100644 --- a/src/main/java/com/stripe/model/issuing/Authorization.java +++ b/src/main/java/com/stripe/model/issuing/Authorization.java @@ -130,8 +130,8 @@ public class Authorization extends ApiResource String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/Card.java b/src/main/java/com/stripe/model/issuing/Card.java index 0b4eca67064..e66d781f222 100644 --- a/src/main/java/com/stripe/model/issuing/Card.java +++ b/src/main/java/com/stripe/model/issuing/Card.java @@ -112,8 +112,16 @@ public class Card extends ApiResource implements HasId, MetadataStore { LatestFraudWarning latestFraudWarning; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * Rules that control the lifecycle of this card, such as automatic cancellation. Refer to our documentation for more + * details. + */ + @SerializedName("lifecycle_controls") + LifecycleControls lifecycleControls; + + /** + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -443,6 +451,35 @@ public static class LatestFraudWarning extends StripeObject { String type; } + /** + * For more details about LifecycleControls, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LifecycleControls extends StripeObject { + @SerializedName("cancel_after") + CancelAfter cancelAfter; + + /** + * For more details about CancelAfter, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CancelAfter extends StripeObject { + /** + * The card is automatically cancelled when it makes this number of non-zero payment + * authorizations and transactions. The count includes penny authorizations, but doesn't + * include non-payment actions, such as authorization advice. + */ + @SerializedName("payment_count") + Long paymentCount; + } + } + /** * For more details about Shipping, please refer to the API * Reference. @@ -1073,6 +1110,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(cardholder, responseGetter); trySetResponseGetter(latestFraudWarning, responseGetter); + trySetResponseGetter(lifecycleControls, responseGetter); trySetResponseGetter(personalizationDesign, responseGetter); trySetResponseGetter(replacedBy, responseGetter); trySetResponseGetter(replacementFor, responseGetter); diff --git a/src/main/java/com/stripe/model/issuing/Cardholder.java b/src/main/java/com/stripe/model/issuing/Cardholder.java index 6c0c016ee23..d7890fa03ba 100644 --- a/src/main/java/com/stripe/model/issuing/Cardholder.java +++ b/src/main/java/com/stripe/model/issuing/Cardholder.java @@ -62,8 +62,8 @@ public class Cardholder extends ApiResource implements HasId, MetadataStore3D Secure flow and one-time password - * messages sent to the cardholder. + * da}, {@code de}, {@code en}, {@code es}, {@code fr}, {@code it}, {@code pl}, or {@code sv}. + * This changes the language of the 3D Secure + * flow and one-time password messages sent to the cardholder. */ @SerializedName("preferred_locales") List preferredLocales; diff --git a/src/main/java/com/stripe/model/issuing/CreditUnderwritingRecord.java b/src/main/java/com/stripe/model/issuing/CreditUnderwritingRecord.java index 7391e4a1c7e..52cc3473e87 100644 --- a/src/main/java/com/stripe/model/issuing/CreditUnderwritingRecord.java +++ b/src/main/java/com/stripe/model/issuing/CreditUnderwritingRecord.java @@ -77,8 +77,8 @@ public class CreditUnderwritingRecord extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/Dispute.java b/src/main/java/com/stripe/model/issuing/Dispute.java index bc636afb9f9..af54b62f4d1 100644 --- a/src/main/java/com/stripe/model/issuing/Dispute.java +++ b/src/main/java/com/stripe/model/issuing/Dispute.java @@ -67,8 +67,8 @@ public class Dispute extends ApiResource String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/DisputeSettlementDetail.java b/src/main/java/com/stripe/model/issuing/DisputeSettlementDetail.java index e4a07cdf8c4..601422aee02 100644 --- a/src/main/java/com/stripe/model/issuing/DisputeSettlementDetail.java +++ b/src/main/java/com/stripe/model/issuing/DisputeSettlementDetail.java @@ -69,8 +69,8 @@ public class DisputeSettlementDetail extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/FraudLiabilityDebit.java b/src/main/java/com/stripe/model/issuing/FraudLiabilityDebit.java index f9ecf08114e..3c642e8b52f 100644 --- a/src/main/java/com/stripe/model/issuing/FraudLiabilityDebit.java +++ b/src/main/java/com/stripe/model/issuing/FraudLiabilityDebit.java @@ -65,8 +65,8 @@ public class FraudLiabilityDebit extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/PersonalizationDesign.java b/src/main/java/com/stripe/model/issuing/PersonalizationDesign.java index ae1297192a1..a0c46dd064d 100644 --- a/src/main/java/com/stripe/model/issuing/PersonalizationDesign.java +++ b/src/main/java/com/stripe/model/issuing/PersonalizationDesign.java @@ -59,8 +59,8 @@ public class PersonalizationDesign extends ApiResource String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/PhysicalBundle.java b/src/main/java/com/stripe/model/issuing/PhysicalBundle.java index 221a45dc9cf..3bbc262500b 100644 --- a/src/main/java/com/stripe/model/issuing/PhysicalBundle.java +++ b/src/main/java/com/stripe/model/issuing/PhysicalBundle.java @@ -35,8 +35,8 @@ public class PhysicalBundle extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/Settlement.java b/src/main/java/com/stripe/model/issuing/Settlement.java index c08c585ce15..45753911501 100644 --- a/src/main/java/com/stripe/model/issuing/Settlement.java +++ b/src/main/java/com/stripe/model/issuing/Settlement.java @@ -47,8 +47,8 @@ public class Settlement extends StripeObject implements HasId { Long interchangeFeesAmount; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/Token.java b/src/main/java/com/stripe/model/issuing/Token.java index 6dee449d600..a81c6e63a62 100644 --- a/src/main/java/com/stripe/model/issuing/Token.java +++ b/src/main/java/com/stripe/model/issuing/Token.java @@ -55,8 +55,8 @@ public class Token extends ApiResource implements HasId { String last4; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/issuing/Transaction.java b/src/main/java/com/stripe/model/issuing/Transaction.java index f998985c23b..1b0011a27a6 100644 --- a/src/main/java/com/stripe/model/issuing/Transaction.java +++ b/src/main/java/com/stripe/model/issuing/Transaction.java @@ -105,8 +105,8 @@ public class Transaction extends ApiResource String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/privacy/RedactionJob.java b/src/main/java/com/stripe/model/privacy/RedactionJob.java index 3377a36e1c4..d9cfd6f547e 100644 --- a/src/main/java/com/stripe/model/privacy/RedactionJob.java +++ b/src/main/java/com/stripe/model/privacy/RedactionJob.java @@ -43,8 +43,8 @@ public class RedactionJob extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/productcatalog/TrialOffer.java b/src/main/java/com/stripe/model/productcatalog/TrialOffer.java new file mode 100644 index 00000000000..1c6a9403b53 --- /dev/null +++ b/src/main/java/com/stripe/model/productcatalog/TrialOffer.java @@ -0,0 +1,191 @@ +// File generated from our OpenAPI spec +package com.stripe.model.productcatalog; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.ExpandableField; +import com.stripe.model.HasId; +import com.stripe.model.Price; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.productcatalog.TrialOfferCreateParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * Resource for the TrialOffer API, used to describe a subscription item's trial period settings. + * Renders a TrialOffer object that describes the price, duration, end_behavior of a trial offer. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class TrialOffer extends ApiResource implements HasId { + @SerializedName("duration") + Duration duration; + + @SerializedName("end_behavior") + EndBehavior endBehavior; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. + */ + @SerializedName("livemode") + Boolean livemode; + + /** A brief, user-friendly name for the trial offer-for identification purposes. */ + @SerializedName("name") + String name; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code product_catalog.trial_offer}. + */ + @SerializedName("object") + String object; + + /** The price during the trial offer. */ + @SerializedName("price") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField price; + + /** Get ID of expandable {@code price} object. */ + public String getPrice() { + return (this.price != null) ? this.price.getId() : null; + } + + public void setPrice(String id) { + this.price = ApiResource.setExpandableFieldId(id, this.price); + } + + /** Get expanded {@code price}. */ + public Price getPriceObject() { + return (this.price != null) ? this.price.getExpanded() : null; + } + + public void setPriceObject(Price expandableObject) { + this.price = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Creates a trial offer. */ + public static TrialOffer create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a trial offer. */ + public static TrialOffer create(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/product_catalog/trial_offers"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getGlobalResponseGetter().request(request, TrialOffer.class); + } + + /** Creates a trial offer. */ + public static TrialOffer create(TrialOfferCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a trial offer. */ + public static TrialOffer create(TrialOfferCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/product_catalog/trial_offers"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, TrialOffer.class); + } + + /** + * For more details about Duration, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Duration extends StripeObject { + @SerializedName("relative") + Relative relative; + + /** + * The type of trial offer duration. + * + *

One of {@code relative}, or {@code timestamp}. + */ + @SerializedName("type") + String type; + + /** + * For more details about Relative, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Relative extends StripeObject { + /** The number of iterations of the price's interval for this trial offer. */ + @SerializedName("iterations") + Long iterations; + } + } + + /** + * For more details about EndBehavior, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EndBehavior extends StripeObject { + @SerializedName("transition") + Transition transition; + + /** + * The type of behavior when the trial offer ends. + * + *

Equal to {@code transition}. + */ + @SerializedName("type") + String type; + + /** + * For more details about Transition, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Transition extends StripeObject { + /** The new price to use at the end of the trial offer period. */ + @SerializedName("price") + String price; + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(duration, responseGetter); + trySetResponseGetter(endBehavior, responseGetter); + trySetResponseGetter(price, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java b/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java index 1ab2f5c3742..97999d7a9ce 100644 --- a/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java +++ b/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java @@ -63,8 +63,8 @@ public class EarlyFraudWarning extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/radar/PaymentEvaluation.java b/src/main/java/com/stripe/model/radar/PaymentEvaluation.java index a6ce1803aee..bc881239003 100644 --- a/src/main/java/com/stripe/model/radar/PaymentEvaluation.java +++ b/src/main/java/com/stripe/model/radar/PaymentEvaluation.java @@ -14,6 +14,7 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.radar.PaymentEvaluationCreateParams; +import java.math.BigDecimal; import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; @@ -54,13 +55,9 @@ public class PaymentEvaluation extends ApiResource implements HasId { @SerializedName("id") String id; - /** Collection of scores and insights for this payment evaluation. */ - @SerializedName("insights") - Insights insights; - /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -89,6 +86,19 @@ public class PaymentEvaluation extends ApiResource implements HasId { @SerializedName("payment_details") PaymentDetails paymentDetails; + /** + * Recommended action based on the score of the fraudulent_payment signal. Possible values are + * {@code block} and {@code continue}. + * + *

One of {@code block}, or {@code continue}. + */ + @SerializedName("recommended_action") + String recommendedAction; + + /** Collection of signals for this payment evaluation. */ + @SerializedName("signals") + Signals signals; + /** * Request a Radar API fraud risk score from Stripe for a payment before sending it for external * processor authorization. @@ -349,42 +359,6 @@ public static class UserInterventionResolved extends StripeObject { } } - /** Collection of scores and insights for this payment evaluation. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Insights extends StripeObject { - /** The timestamp when the evaluation was performed. */ - @SerializedName("evaluated_at") - Long evaluatedAt; - - /** Scores, insights and recommended action for one scorer for this PaymentEvaluation. */ - @SerializedName("fraudulent_dispute") - FraudulentDispute fraudulentDispute; - - /** Scores, insights and recommended action for one scorer for this PaymentEvaluation. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class FraudulentDispute extends StripeObject { - /** - * Recommended action based on the risk score. Possible values are {@code block} and {@code - * continue}. - * - *

One of {@code block}, or {@code continue}. - */ - @SerializedName("recommended_action") - String recommendedAction; - - /** - * Stripe Radar’s evaluation of the risk level of the payment. Possible values for evaluated - * payments are between 0 and 100, with higher scores indicating higher risk. - */ - @SerializedName("risk_score") - Long riskScore; - } - } - /** Outcome details for this payment evaluation. */ @Getter @Setter @@ -757,13 +731,49 @@ public static class Address extends StripeObject { } } + /** Collection of signals for this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Signals extends StripeObject { + /** A payment evaluation signal with evaluated_at, risk_level, and score fields. */ + @SerializedName("fraudulent_payment") + FraudulentPayment fraudulentPayment; + + /** A payment evaluation signal with evaluated_at, risk_level, and score fields. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FraudulentPayment extends StripeObject { + /** The time when this signal was evaluated. */ + @SerializedName("evaluated_at") + Long evaluatedAt; + + /** + * Risk level of this signal, based on the score. + * + *

One of {@code elevated}, {@code highest}, or {@code normal}. + */ + @SerializedName("risk_level") + String riskLevel; + + /** + * Score for this insight. Possible values for evaluated payments are -1 and any value between + * 0 and 100. The value is returned with two decimal places. A score of -1 indicates a test + * integration and higher scores indicate a higher likelihood of the signal being true. + */ + @SerializedName("score") + BigDecimal score; + } + } + @Override public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(clientDeviceMetadataDetails, responseGetter); trySetResponseGetter(customerDetails, responseGetter); - trySetResponseGetter(insights, responseGetter); trySetResponseGetter(outcome, responseGetter); trySetResponseGetter(paymentDetails, responseGetter); + trySetResponseGetter(signals, responseGetter); } } diff --git a/src/main/java/com/stripe/model/radar/ValueList.java b/src/main/java/com/stripe/model/radar/ValueList.java index cc1ad900b1c..0e560494d20 100644 --- a/src/main/java/com/stripe/model/radar/ValueList.java +++ b/src/main/java/com/stripe/model/radar/ValueList.java @@ -53,8 +53,9 @@ public class ValueList extends ApiResource implements HasId, MetadataStoresmallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("amount_total") Long amountTotal; @@ -68,8 +68,8 @@ public class Calculation extends ApiResource implements HasId { CalculationLineItemCollection lineItems; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -411,7 +411,7 @@ public static class Address extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class ShippingCost extends StripeObject { /** - * The shipping amount in the smallest + * The shipping amount in the smallest * currency unit. If {@code tax_behavior=inclusive}, then this amount includes taxes. * Otherwise, taxes were calculated on top of this amount. */ @@ -420,7 +420,7 @@ public static class ShippingCost extends StripeObject { /** * The amount of tax calculated for shipping, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("amount_tax") Long amountTax; @@ -460,8 +460,8 @@ public static class ShippingCost extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class TaxBreakdown extends StripeObject { /** - * The amount of tax, in the smallest currency unit. + * The amount of tax, in the smallest + * currency unit. */ @SerializedName("amount") Long amount; @@ -473,7 +473,7 @@ public static class TaxBreakdown extends StripeObject { * Indicates whether the jurisdiction was determined by the origin (merchant's address) or * destination (customer's address). * - *

One of {@code destination}, or {@code origin}. + *

One of {@code destination}, {@code origin}, or {@code performance}. */ @SerializedName("sourcing") String sourcing; @@ -500,7 +500,7 @@ public static class TaxBreakdown extends StripeObject { /** * The amount on which tax is calculated, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("taxable_amount") Long taxableAmount; @@ -566,10 +566,12 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

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

One of {@code admissions_tax}, {@code amusement_tax}, {@code attendance_tax}, {@code + * communications_tax}, {@code entertainment_tax}, {@code gross_receipts_tax}, {@code gst}, + * {@code hospitality_tax}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, + * {@code luxury_tax}, {@code pst}, {@code qst}, {@code resort_tax}, {@code + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, {@code + * tourism_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; @@ -586,7 +588,7 @@ public static class TaxRateDetails extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class TaxBreakdown extends StripeObject { /** - * The amount of tax, in the smallest + * The amount of tax, in the smallest * currency unit. */ @SerializedName("amount") @@ -614,7 +616,7 @@ public static class TaxBreakdown extends StripeObject { /** * The amount on which tax is calculated, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("taxable_amount") Long taxableAmount; @@ -667,9 +669,11 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

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

One of {@code admissions_tax}, {@code amusement_tax}, {@code attendance_tax}, {@code + * communications_tax}, {@code entertainment_tax}, {@code gross_receipts_tax}, {@code gst}, + * {@code hospitality_tax}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code + * luxury_tax}, {@code pst}, {@code qst}, {@code resort_tax}, {@code retail_delivery_fee}, + * {@code rst}, {@code sales_tax}, {@code service_tax}, {@code tourism_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/CalculationLineItem.java b/src/main/java/com/stripe/model/tax/CalculationLineItem.java index fc64b94fa46..16feb83432d 100644 --- a/src/main/java/com/stripe/model/tax/CalculationLineItem.java +++ b/src/main/java/com/stripe/model/tax/CalculationLineItem.java @@ -15,7 +15,7 @@ @EqualsAndHashCode(callSuper = false) public class CalculationLineItem extends StripeObject implements HasId { /** - * The line item amount in the smallest + * The line item amount in the smallest * currency unit. If {@code tax_behavior=inclusive}, then this amount includes taxes. * Otherwise, taxes were calculated on top of this amount. */ @@ -24,7 +24,7 @@ public class CalculationLineItem extends StripeObject implements HasId { /** * The amount of tax calculated for this line item, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("amount_tax") Long amountTax; @@ -35,8 +35,8 @@ public class CalculationLineItem extends StripeObject implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -57,6 +57,15 @@ public class CalculationLineItem extends StripeObject implements HasId { @SerializedName("object") String object; + /** + * Indicates the line item represents a performance where the venue location might determine the + * tax, not the customer address. Leave empty if the tax code doesn't require a tax location. If + * you provide this value for tax codes with an {@code optional} location requirement, it + * overrides the customer address. + */ + @SerializedName("performance_location") + String performanceLocation; + /** The ID of an existing Product. */ @SerializedName("product") String product; @@ -100,7 +109,7 @@ public class CalculationLineItem extends StripeObject implements HasId { @EqualsAndHashCode(callSuper = false) public static class TaxBreakdown extends StripeObject { /** - * The amount of tax, in the smallest + * The amount of tax, in the smallest * currency unit. */ @SerializedName("amount") @@ -113,7 +122,7 @@ public static class TaxBreakdown extends StripeObject { * Indicates whether the jurisdiction was determined by the origin (merchant's address) or * destination (customer's address). * - *

One of {@code destination}, or {@code origin}. + *

One of {@code destination}, {@code origin}, or {@code performance}. */ @SerializedName("sourcing") String sourcing; @@ -140,7 +149,7 @@ public static class TaxBreakdown extends StripeObject { /** * The amount on which tax is calculated, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("taxable_amount") Long taxableAmount; @@ -206,9 +215,11 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

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

One of {@code admissions_tax}, {@code amusement_tax}, {@code attendance_tax}, {@code + * communications_tax}, {@code entertainment_tax}, {@code gross_receipts_tax}, {@code gst}, + * {@code hospitality_tax}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, {@code + * luxury_tax}, {@code pst}, {@code qst}, {@code resort_tax}, {@code retail_delivery_fee}, + * {@code rst}, {@code sales_tax}, {@code service_tax}, {@code tourism_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/Form.java b/src/main/java/com/stripe/model/tax/Form.java index b9473a782f7..22a1989149c 100644 --- a/src/main/java/com/stripe/model/tax/Form.java +++ b/src/main/java/com/stripe/model/tax/Form.java @@ -69,8 +69,8 @@ public class Form extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/tax/Location.java b/src/main/java/com/stripe/model/tax/Location.java new file mode 100644 index 00000000000..e303834a2c9 --- /dev/null +++ b/src/main/java/com/stripe/model/tax/Location.java @@ -0,0 +1,240 @@ +// File generated from our OpenAPI spec +package com.stripe.model.tax; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.Address; +import com.stripe.model.HasId; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.tax.LocationCreateParams; +import com.stripe.param.tax.LocationListParams; +import com.stripe.param.tax.LocationRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** Tax locations represent venues for services, tickets, or other product types. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Location extends ApiResource implements HasId { + @SerializedName("address") + Address address; + + /** + * A descriptive text providing additional context about the tax location. This can include + * information about the venue, types of events held, services available, or any relevant details + * for better identification (e.g., "A spacious auditorium suitable for large concerts and + * events."). + */ + @SerializedName("description") + String description; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code tax.location}. + */ + @SerializedName("object") + String object; + + /** + * The type of tax location to be defined. Currently the only option is {@code performance}. + * + *

Equal to {@code performance}. + */ + @SerializedName("type") + String type; + + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public static Location create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public static Location create(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getGlobalResponseGetter().request(request, Location.class); + } + + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public static Location create(LocationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public static Location create(LocationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, Location.class); + } + + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public static LocationCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public static LocationCollection list(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, LocationCollection.class); + } + + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public static LocationCollection list(LocationListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public static LocationCollection list(LocationListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, LocationCollection.class); + } + + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public static Location retrieve(String location) throws StripeException { + return retrieve(location, (Map) null, (RequestOptions) null); + } + + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public static Location retrieve(String location, RequestOptions options) throws StripeException { + return retrieve(location, (Map) null, options); + } + + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public static Location retrieve( + String location, Map params, RequestOptions options) throws StripeException { + String path = String.format("/v1/tax/locations/%s", ApiResource.urlEncodeId(location)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, Location.class); + } + + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public static Location retrieve( + String location, LocationRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/tax/locations/%s", ApiResource.urlEncodeId(location)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, Location.class); + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(address, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/tax/LocationCollection.java b/src/main/java/com/stripe/model/tax/LocationCollection.java new file mode 100644 index 00000000000..ae8112a39fb --- /dev/null +++ b/src/main/java/com/stripe/model/tax/LocationCollection.java @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec +package com.stripe.model.tax; + +import com.stripe.model.StripeCollection; + +public class LocationCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/tax/Registration.java b/src/main/java/com/stripe/model/tax/Registration.java index f7056acdd51..8fbdc2444ab 100644 --- a/src/main/java/com/stripe/model/tax/Registration.java +++ b/src/main/java/com/stripe/model/tax/Registration.java @@ -68,8 +68,8 @@ public class Registration extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -2883,12 +2883,33 @@ public static class Ug extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Us extends StripeObject { + @SerializedName("admissions_tax") + AdmissionsTax admissionsTax; + + @SerializedName("attendance_tax") + AttendanceTax attendanceTax; + + @SerializedName("entertainment_tax") + EntertainmentTax entertainmentTax; + + @SerializedName("gross_receipts_tax") + GrossReceiptsTax grossReceiptsTax; + + @SerializedName("hospitality_tax") + HospitalityTax hospitalityTax; + @SerializedName("local_amusement_tax") LocalAmusementTax localAmusementTax; @SerializedName("local_lease_tax") LocalLeaseTax localLeaseTax; + @SerializedName("luxury_tax") + LuxuryTax luxuryTax; + + @SerializedName("resort_tax") + ResortTax resortTax; + /** * Two-letter US state code (ISO * 3166-2). @@ -2899,15 +2920,105 @@ public static class Us extends StripeObject { @SerializedName("state_sales_tax") StateSalesTax stateSalesTax; + @SerializedName("tourism_tax") + TourismTax tourismTax; + /** * Type of registration in the US. * - *

One of {@code local_amusement_tax}, {@code local_lease_tax}, {@code - * state_communications_tax}, {@code state_retail_delivery_fee}, or {@code state_sales_tax}. + *

One of {@code admissions_tax}, {@code attendance_tax}, {@code entertainment_tax}, {@code + * gross_receipts_tax}, {@code hospitality_tax}, {@code local_amusement_tax}, {@code + * local_lease_tax}, {@code luxury_tax}, {@code resort_tax}, {@code state_communications_tax}, + * {@code state_retail_delivery_fee}, {@code state_sales_tax}, or {@code tourism_tax}. */ @SerializedName("type") String type; + /** + * For more details about AdmissionsTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AdmissionsTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + + /** + * For more details about AttendanceTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AttendanceTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + + /** + * For more details about EntertainmentTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EntertainmentTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + + /** + * For more details about GrossReceiptsTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class GrossReceiptsTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + + /** + * For more details about HospitalityTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class HospitalityTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + /** * For more details about LocalAmusementTax, please refer to the API Reference. @@ -2940,6 +3051,40 @@ public static class LocalLeaseTax extends StripeObject { String jurisdiction; } + /** + * For more details about LuxuryTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LuxuryTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + + /** + * For more details about ResortTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ResortTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + /** * For more details about StateSalesTax, please refer to the API Reference. @@ -2977,6 +3122,23 @@ public static class Election extends StripeObject { String type; } } + + /** + * For more details about TourismTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class TourismTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } } /** diff --git a/src/main/java/com/stripe/model/tax/Settings.java b/src/main/java/com/stripe/model/tax/Settings.java index 49b8a683e4d..fdca9592eaf 100644 --- a/src/main/java/com/stripe/model/tax/Settings.java +++ b/src/main/java/com/stripe/model/tax/Settings.java @@ -36,8 +36,8 @@ public class Settings extends ApiResource { HeadOffice headOffice; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/tax/Transaction.java b/src/main/java/com/stripe/model/tax/Transaction.java index b36a3d110f7..97f8e51c840 100644 --- a/src/main/java/com/stripe/model/tax/Transaction.java +++ b/src/main/java/com/stripe/model/tax/Transaction.java @@ -62,8 +62,8 @@ public class Transaction extends ApiResource implements HasId { TransactionLineItemCollection lineItems; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; @@ -469,7 +469,7 @@ public static class Address extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class ShippingCost extends StripeObject { /** - * The shipping amount in the smallest + * The shipping amount in the smallest * currency unit. If {@code tax_behavior=inclusive}, then this amount includes taxes. * Otherwise, taxes were calculated on top of this amount. */ @@ -478,7 +478,7 @@ public static class ShippingCost extends StripeObject { /** * The amount of tax calculated for shipping, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("amount_tax") Long amountTax; @@ -521,8 +521,8 @@ public static class ShippingCost extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class TaxBreakdown extends StripeObject { /** - * The amount of tax, in the smallest currency unit. + * The amount of tax, in the smallest + * currency unit. */ @SerializedName("amount") Long amount; @@ -534,7 +534,7 @@ public static class TaxBreakdown extends StripeObject { * Indicates whether the jurisdiction was determined by the origin (merchant's address) or * destination (customer's address). * - *

One of {@code destination}, or {@code origin}. + *

One of {@code destination}, {@code origin}, or {@code performance}. */ @SerializedName("sourcing") String sourcing; @@ -561,7 +561,7 @@ public static class TaxBreakdown extends StripeObject { /** * The amount on which tax is calculated, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("taxable_amount") Long taxableAmount; @@ -627,10 +627,12 @@ public static class TaxRateDetails extends StripeObject { /** * The tax type, such as {@code vat} or {@code sales_tax}. * - *

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

One of {@code admissions_tax}, {@code amusement_tax}, {@code attendance_tax}, {@code + * communications_tax}, {@code entertainment_tax}, {@code gross_receipts_tax}, {@code gst}, + * {@code hospitality_tax}, {@code hst}, {@code igst}, {@code jct}, {@code lease_tax}, + * {@code luxury_tax}, {@code pst}, {@code qst}, {@code resort_tax}, {@code + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, {@code + * tourism_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/TransactionLineItem.java b/src/main/java/com/stripe/model/tax/TransactionLineItem.java index a6fb325ff88..8f1bd4781bf 100644 --- a/src/main/java/com/stripe/model/tax/TransactionLineItem.java +++ b/src/main/java/com/stripe/model/tax/TransactionLineItem.java @@ -14,7 +14,7 @@ @EqualsAndHashCode(callSuper = false) public class TransactionLineItem extends StripeObject implements HasId { /** - * The line item amount in the smallest + * The line item amount in the smallest * currency unit. If {@code tax_behavior=inclusive}, then this amount includes taxes. * Otherwise, taxes were calculated on top of this amount. */ @@ -23,7 +23,7 @@ public class TransactionLineItem extends StripeObject implements HasId { /** * The amount of tax calculated for this line item, in the smallest currency unit. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit. */ @SerializedName("amount_tax") Long amountTax; @@ -34,8 +34,8 @@ public class TransactionLineItem extends StripeObject implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/terminal/Configuration.java b/src/main/java/com/stripe/model/terminal/Configuration.java index ac484af5dd7..ae34fc60f2e 100644 --- a/src/main/java/com/stripe/model/terminal/Configuration.java +++ b/src/main/java/com/stripe/model/terminal/Configuration.java @@ -56,8 +56,8 @@ public class Configuration extends ApiResource implements HasId { Boolean isAccountDefault; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/terminal/Location.java b/src/main/java/com/stripe/model/terminal/Location.java index d8e2ec39dd6..79964b5d293 100644 --- a/src/main/java/com/stripe/model/terminal/Location.java +++ b/src/main/java/com/stripe/model/terminal/Location.java @@ -66,8 +66,8 @@ public class Location extends ApiResource implements HasId, MetadataStore Long lastSeenAt; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/terminal/ReaderCollectedData.java b/src/main/java/com/stripe/model/terminal/ReaderCollectedData.java index 6b7fa4a69b7..997c315c9da 100644 --- a/src/main/java/com/stripe/model/terminal/ReaderCollectedData.java +++ b/src/main/java/com/stripe/model/terminal/ReaderCollectedData.java @@ -32,8 +32,8 @@ public class ReaderCollectedData extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/testhelpers/TestClock.java b/src/main/java/com/stripe/model/testhelpers/TestClock.java index e4648007508..278be69db50 100644 --- a/src/main/java/com/stripe/model/testhelpers/TestClock.java +++ b/src/main/java/com/stripe/model/testhelpers/TestClock.java @@ -53,8 +53,8 @@ public class TestClock extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/CreditReversal.java b/src/main/java/com/stripe/model/treasury/CreditReversal.java index 2ce933d3fc0..b39e71e1b68 100644 --- a/src/main/java/com/stripe/model/treasury/CreditReversal.java +++ b/src/main/java/com/stripe/model/treasury/CreditReversal.java @@ -62,8 +62,8 @@ public class CreditReversal extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/DebitReversal.java b/src/main/java/com/stripe/model/treasury/DebitReversal.java index f8792d561d6..fc15606863c 100644 --- a/src/main/java/com/stripe/model/treasury/DebitReversal.java +++ b/src/main/java/com/stripe/model/treasury/DebitReversal.java @@ -66,8 +66,8 @@ public class DebitReversal extends ApiResource implements HasId { LinkedFlows linkedFlows; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/FinancialAccount.java b/src/main/java/com/stripe/model/treasury/FinancialAccount.java index d32775069d0..663fff6f770 100644 --- a/src/main/java/com/stripe/model/treasury/FinancialAccount.java +++ b/src/main/java/com/stripe/model/treasury/FinancialAccount.java @@ -83,8 +83,8 @@ public class FinancialAccount extends ApiResource Boolean isDefault; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/InboundTransfer.java b/src/main/java/com/stripe/model/treasury/InboundTransfer.java index 12823ff7cf0..716e1fc50f3 100644 --- a/src/main/java/com/stripe/model/treasury/InboundTransfer.java +++ b/src/main/java/com/stripe/model/treasury/InboundTransfer.java @@ -88,8 +88,8 @@ public class InboundTransfer extends ApiResource implements HasId { LinkedFlows linkedFlows; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/OutboundPayment.java b/src/main/java/com/stripe/model/treasury/OutboundPayment.java index f70ee34eda2..d8ec5fb816c 100644 --- a/src/main/java/com/stripe/model/treasury/OutboundPayment.java +++ b/src/main/java/com/stripe/model/treasury/OutboundPayment.java @@ -114,8 +114,8 @@ public class OutboundPayment extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/OutboundTransfer.java b/src/main/java/com/stripe/model/treasury/OutboundTransfer.java index 39e7b4ada5e..31ad82cf774 100644 --- a/src/main/java/com/stripe/model/treasury/OutboundTransfer.java +++ b/src/main/java/com/stripe/model/treasury/OutboundTransfer.java @@ -99,8 +99,8 @@ public class OutboundTransfer extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/ReceivedCredit.java b/src/main/java/com/stripe/model/treasury/ReceivedCredit.java index 717ef6341e1..6cacbb911fd 100644 --- a/src/main/java/com/stripe/model/treasury/ReceivedCredit.java +++ b/src/main/java/com/stripe/model/treasury/ReceivedCredit.java @@ -84,8 +84,8 @@ public class ReceivedCredit extends ApiResource implements HasId { LinkedFlows linkedFlows; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java index b603e094ec0..97a258f8044 100644 --- a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java +++ b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java @@ -83,8 +83,8 @@ public class ReceivedDebit extends ApiResource implements HasId { LinkedFlows linkedFlows; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/Transaction.java b/src/main/java/com/stripe/model/treasury/Transaction.java index 155204693f2..6d113d57931 100644 --- a/src/main/java/com/stripe/model/treasury/Transaction.java +++ b/src/main/java/com/stripe/model/treasury/Transaction.java @@ -85,8 +85,8 @@ public class Transaction extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/treasury/TransactionEntry.java b/src/main/java/com/stripe/model/treasury/TransactionEntry.java index aa06ab900fc..64a439da80b 100644 --- a/src/main/java/com/stripe/model/treasury/TransactionEntry.java +++ b/src/main/java/com/stripe/model/treasury/TransactionEntry.java @@ -75,8 +75,8 @@ public class TransactionEntry extends ApiResource implements HasId { String id; /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. */ @SerializedName("livemode") Boolean livemode; diff --git a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java index 54d186d5969..102f426ca4a 100644 --- a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java @@ -49,6 +49,7 @@ public final class EventDataClassLookup { classLookup.put( "v2.core.account_person_token", com.stripe.model.v2.core.AccountPersonToken.class); classLookup.put("v2.core.account_token", com.stripe.model.v2.core.AccountToken.class); + classLookup.put("v2.core.batch_job", com.stripe.model.v2.core.BatchJob.class); classLookup.put("v2.core.event", com.stripe.model.v2.core.Event.class); classLookup.put("v2.core.event_destination", com.stripe.model.v2.core.EventDestination.class); @@ -157,6 +158,29 @@ public final class EventDataClassLookup { "v2.core.account_person.deleted", com.stripe.events.V2CoreAccountPersonDeletedEvent.class); eventClassLookup.put( "v2.core.account_person.updated", com.stripe.events.V2CoreAccountPersonUpdatedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.batch_failed", com.stripe.events.V2CoreBatchJobBatchFailedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.canceled", com.stripe.events.V2CoreBatchJobCanceledEvent.class); + eventClassLookup.put( + "v2.core.batch_job.completed", com.stripe.events.V2CoreBatchJobCompletedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.created", com.stripe.events.V2CoreBatchJobCreatedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.ready_for_upload", + com.stripe.events.V2CoreBatchJobReadyForUploadEvent.class); + eventClassLookup.put( + "v2.core.batch_job.timeout", com.stripe.events.V2CoreBatchJobTimeoutEvent.class); + eventClassLookup.put( + "v2.core.batch_job.updated", com.stripe.events.V2CoreBatchJobUpdatedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.upload_timeout", + com.stripe.events.V2CoreBatchJobUploadTimeoutEvent.class); + eventClassLookup.put( + "v2.core.batch_job.validating", com.stripe.events.V2CoreBatchJobValidatingEvent.class); + eventClassLookup.put( + "v2.core.batch_job.validation_failed", + com.stripe.events.V2CoreBatchJobValidationFailedEvent.class); eventClassLookup.put( "v2.core.event_destination.ping", com.stripe.events.V2CoreEventDestinationPingEvent.class); eventClassLookup.put( diff --git a/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java b/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java index 88a228d73b3..9100e44b428 100644 --- a/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java @@ -87,6 +87,36 @@ public final class EventNotificationClassLookup { eventClassLookup.put( "v2.core.account_person.updated", com.stripe.events.V2CoreAccountPersonUpdatedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.batch_failed", + com.stripe.events.V2CoreBatchJobBatchFailedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.canceled", + com.stripe.events.V2CoreBatchJobCanceledEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.completed", + com.stripe.events.V2CoreBatchJobCompletedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.created", + com.stripe.events.V2CoreBatchJobCreatedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.ready_for_upload", + com.stripe.events.V2CoreBatchJobReadyForUploadEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.timeout", + com.stripe.events.V2CoreBatchJobTimeoutEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.updated", + com.stripe.events.V2CoreBatchJobUpdatedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.upload_timeout", + com.stripe.events.V2CoreBatchJobUploadTimeoutEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.validating", + com.stripe.events.V2CoreBatchJobValidatingEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.validation_failed", + com.stripe.events.V2CoreBatchJobValidationFailedEventNotification.class); eventClassLookup.put( "v2.core.event_destination.ping", com.stripe.events.V2CoreEventDestinationPingEventNotification.class); diff --git a/src/main/java/com/stripe/model/v2/FinancialAddressGeneratedMicrodeposits.java b/src/main/java/com/stripe/model/v2/FinancialAddressGeneratedMicrodeposits.java index 621a62e20f3..1405406e3ee 100644 --- a/src/main/java/com/stripe/model/v2/FinancialAddressGeneratedMicrodeposits.java +++ b/src/main/java/com/stripe/model/v2/FinancialAddressGeneratedMicrodeposits.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.util.List; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -18,7 +19,7 @@ public class FinancialAddressGeneratedMicrodeposits extends StripeObject { /** The amounts of the microdeposits that were generated. */ @SerializedName("amounts") - List amounts; + List amounts; /** * Has the value {@code true} if the object exists in live mode or the value {@code false} if the @@ -43,28 +44,4 @@ public class FinancialAddressGeneratedMicrodeposits extends StripeObject { */ @SerializedName("status") String status; - - /** - * For more details about Amount, please refer to the API - * Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } diff --git a/src/main/java/com/stripe/model/v2/billing/Cadence.java b/src/main/java/com/stripe/model/v2/billing/Cadence.java index db207c2b954..99ebfc469d1 100644 --- a/src/main/java/com/stripe/model/v2/billing/Cadence.java +++ b/src/main/java/com/stripe/model/v2/billing/Cadence.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.time.Instant; import java.util.List; @@ -661,6 +663,7 @@ public static class Card extends StripeObject { public static class MandateOptions extends StripeObject { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java b/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java index 4a9be6c5836..146ebdd6e6c 100644 --- a/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.time.Instant; import java.util.List; @@ -247,6 +249,7 @@ public static class Card extends StripeObject { public static class MandateOptions extends StripeObject { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java b/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java index fb3cbd49a15..2035073002d 100644 --- a/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.time.Instant; import java.util.List; @@ -226,6 +228,7 @@ public static class Card extends StripeObject { public static class MandateOptions extends StripeObject { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/model/v2/core/Account.java b/src/main/java/com/stripe/model/v2/core/Account.java index 464a21c8888..102ddd8da2d 100644 --- a/src/main/java/com/stripe/model/v2/core/Account.java +++ b/src/main/java/com/stripe/model/v2/core/Account.java @@ -4,6 +4,8 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import java.util.Map; @@ -3737,15 +3739,16 @@ public static class DefaultOutboundDestination extends StripeObject implements H * Closed Enum. The payout method type of the default outbound destination. * *

One of {@code ae_bank_account}, {@code ag_bank_account}, {@code al_bank_account}, - * {@code am_bank_account}, {@code at_bank_account}, {@code au_bank_account}, {@code - * ba_bank_account}, {@code be_bank_account}, {@code bg_bank_account}, {@code - * bh_bank_account}, {@code bj_bank_account}, {@code bn_bank_account}, {@code - * bs_bank_account}, {@code bt_bank_account}, {@code bw_bank_account}, {@code card}, {@code - * ca_bank_account}, {@code ch_bank_account}, {@code ci_bank_account}, {@code - * crypto_wallet}, {@code cr_bank_account}, {@code cy_bank_account}, {@code - * cz_bank_account}, {@code de_bank_account}, {@code dk_bank_account}, {@code - * do_bank_account}, {@code dz_bank_account}, {@code ec_bank_account}, {@code - * ee_bank_account}, {@code es_bank_account}, {@code et_bank_account}, {@code + * {@code am_bank_account}, {@code ar_bank_account}, {@code at_bank_account}, {@code + * au_bank_account}, {@code ba_bank_account}, {@code be_bank_account}, {@code + * bg_bank_account}, {@code bh_bank_account}, {@code bj_bank_account}, {@code + * bn_bank_account}, {@code bs_bank_account}, {@code bt_bank_account}, {@code + * bw_bank_account}, {@code card}, {@code ca_bank_account}, {@code ch_bank_account}, {@code + * ci_bank_account}, {@code co_bank_account}, {@code crypto_wallet}, {@code + * cr_bank_account}, {@code cy_bank_account}, {@code cz_bank_account}, {@code + * de_bank_account}, {@code dk_bank_account}, {@code do_bank_account}, {@code + * dz_bank_account}, {@code ec_bank_account}, {@code ee_bank_account}, {@code + * eg_bank_account}, {@code es_bank_account}, {@code et_bank_account}, {@code * fi_bank_account}, {@code fr_bank_account}, {@code gb_bank_account}, {@code * gm_bank_account}, {@code gr_bank_account}, {@code gt_bank_account}, {@code * gy_bank_account}, {@code hk_bank_account}, {@code hr_bank_account}, {@code @@ -4492,6 +4495,13 @@ public static class Defaults extends StripeObject { @SerializedName("responsibilities") Responsibilities responsibilities; + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + @SerializedName("timezone") + String timezone; + /** Account profile information. */ @Getter @Setter @@ -5264,27 +5274,6 @@ public static class AnnualRevenue extends StripeObject { */ @SerializedName("fiscal_year_end") String fiscalYearEnd; - - /** Annual revenue amount in minor currency units (for example, '123' for 1.23 USD). */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** Documents that may be submitted to satisfy various informational requests. */ @@ -5663,30 +5652,6 @@ public static class MonthlyEstimatedRevenue extends StripeObject { */ @SerializedName("amount") Amount amount; - - /** - * Estimated monthly revenue amount in minor currency units (for example, '123' for 1.23 - * USD). - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** When the business was incorporated or registered. */ @@ -6403,7 +6368,7 @@ public static class Relationship extends StripeObject { /** The percentage of the Account's identity that the individual owns. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** * Whether the individual is authorized as the primary representative of the Account. This diff --git a/src/main/java/com/stripe/model/v2/core/AccountPerson.java b/src/main/java/com/stripe/model/v2/core/AccountPerson.java index f3ce221205d..25eed6ceaab 100644 --- a/src/main/java/com/stripe/model/v2/core/AccountPerson.java +++ b/src/main/java/com/stripe/model/v2/core/AccountPerson.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import java.util.Map; @@ -584,7 +585,7 @@ public static class Relationship extends StripeObject { /** The percentage of the Account's identity that the individual owns. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** * Whether the individual is authorized as the primary representative of the Account. This is diff --git a/src/main/java/com/stripe/model/v2/core/BatchJob.java b/src/main/java/com/stripe/model/v2/core/BatchJob.java new file mode 100644 index 00000000000..9bc1c8bf3e6 --- /dev/null +++ b/src/main/java/com/stripe/model/v2/core/BatchJob.java @@ -0,0 +1,408 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.core; + +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; +import com.stripe.model.StripeObject; +import java.time.Instant; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** BatchJob resource. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class BatchJob extends StripeObject implements HasId { + /** Timestamp at which BatchJob was created. */ + @SerializedName("created") + Instant created; + + /** Unique identifier for the BatchJob. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * 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; + + /** The maximum rps defined for the {@code BatchJob}. */ + @SerializedName("maximum_rps") + Long maximumRps; + + /** The metadata of the {@code BatchJob} object. */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value of the + * object field. + * + *

Equal to {@code v2.core.batch_job}. + */ + @SerializedName("object") + String object; + + /** If the validation will be run previous to the execution of the {@code BatchJob}. */ + @SerializedName("skip_validation") + Boolean skipValidation; + + /** + * The current status of the {@code BatchJob}. + * + *

One of {@code batch_failed}, {@code canceled}, {@code cancelling}, {@code complete}, {@code + * in_progress}, {@code ready_for_upload}, {@code timeout}, {@code upload_timeout}, {@code + * validating}, or {@code validation_failed}. + */ + @SerializedName("status") + String status; + + /** Additional details about the current state of the {@code BatchJob}. */ + @SerializedName("status_details") + StatusDetails statusDetails; + + /** Additional details about the current state of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StatusDetails extends StripeObject { + /** Additional details for the {@code BATCH_FAILED} status of the {@code BatchJob}. */ + @SerializedName("batch_failed") + BatchFailed batchFailed; + + /** Additional details for the {@code CANCELED} status of the {@code BatchJob}. */ + @SerializedName("canceled") + Canceled canceled; + + /** Additional details for the {@code COMPLETE} status of the {@code BatchJob}. */ + @SerializedName("complete") + Complete complete; + + /** Additional details for the {@code IN_PROGRESS} status of the {@code BatchJob}. */ + @SerializedName("in_progress") + InProgress inProgress; + + /** Additional details for the {@code READY_FOR_UPLOAD} status of the {@code BatchJob}. */ + @SerializedName("ready_for_upload") + ReadyForUpload readyForUpload; + + /** Additional details for the {@code TIMEOUT} status of the {@code BatchJob}. */ + @SerializedName("timeout") + Timeout timeout; + + /** Additional details for the {@code VALIDATING} status of the {@code BatchJob}. */ + @SerializedName("validating") + Validating validating; + + /** Additional details for the {@code VALIDATION_FAILED} status of the {@code BatchJob}. */ + @SerializedName("validation_failed") + ValidationFailed validationFailed; + + /** Additional details for the {@code BATCH_FAILED} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BatchFailed extends StripeObject { + /** Details about the {@code BatchJob} failure. */ + @SerializedName("error") + String error; + } + + /** Additional details for the {@code CANCELED} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Canceled extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + + /** Additional details for the {@code COMPLETE} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Complete extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + + /** Additional details for the {@code IN_PROGRESS} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InProgress extends StripeObject { + /** The number of records that failed processing so far. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** The number of records that were successfully processed so far. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + } + + /** Additional details for the {@code READY_FOR_UPLOAD} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ReadyForUpload extends StripeObject { + /** The upload file details. */ + @SerializedName("upload_url") + UploadUrl uploadUrl; + + /** The upload file details. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UploadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + + /** Additional details for the {@code TIMEOUT} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Timeout extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + + /** Additional details for the {@code VALIDATING} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Validating extends StripeObject { + /** + * The number of records that were validated. Note that there is no failure counter here; once + * we have any validation failures we give up. + */ + @SerializedName("validated_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long validatedCount; + } + + /** Additional details for the {@code VALIDATION_FAILED} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ValidationFailed extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + } +} diff --git a/src/main/java/com/stripe/model/v2/core/EventDestination.java b/src/main/java/com/stripe/model/v2/core/EventDestination.java index 0aee20d9e9b..cc45e0ae021 100644 --- a/src/main/java/com/stripe/model/v2/core/EventDestination.java +++ b/src/main/java/com/stripe/model/v2/core/EventDestination.java @@ -26,6 +26,10 @@ public class EventDestination extends StripeObject implements HasId { @SerializedName("amazon_eventbridge") AmazonEventbridge amazonEventbridge; + /** Azure Event Grid configuration. */ + @SerializedName("azure_event_grid") + AzureEventGrid azureEventGrid; + /** Time at which the object was created. */ @SerializedName("created") Instant created; @@ -46,7 +50,14 @@ public class EventDestination extends StripeObject implements HasId { @SerializedName("event_payload") String eventPayload; - /** Where events should be routed from. */ + /** + * Specifies which accounts' events route to this destination. {@code @self}: Receive events from + * the account that owns the event destination. {@code @accounts}: Receive events emitted from + * other accounts you manage which includes your v1 and v2 accounts. + * {@code @organization_members}: Receive events from accounts directly linked to the + * organization. {@code @organization_members/@accounts}: Receive events from all accounts + * connected to any platform accounts in the organization. + */ @SerializedName("events_from") List eventsFrom; @@ -98,7 +109,7 @@ public class EventDestination extends StripeObject implements HasId { /** * Event destination type. * - *

One of {@code amazon_eventbridge}, or {@code webhook_endpoint}. + *

One of {@code amazon_eventbridge}, {@code azure_event_grid}, or {@code webhook_endpoint}. */ @SerializedName("type") String type; @@ -133,6 +144,36 @@ public static class AmazonEventbridge extends StripeObject { String awsEventSourceStatus; } + /** Azure Event Grid configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AzureEventGrid extends StripeObject { + /** The name of the Azure partner topic. */ + @SerializedName("azure_partner_topic_name") + String azurePartnerTopicName; + + /** + * The status of the Azure partner topic. + * + *

One of {@code activated}, {@code deleted}, {@code never_activated}, or {@code unknown}. + */ + @SerializedName("azure_partner_topic_status") + String azurePartnerTopicStatus; + + /** The Azure region. */ + @SerializedName("azure_region") + String azureRegion; + + /** The name of the Azure resource group. */ + @SerializedName("azure_resource_group_name") + String azureResourceGroupName; + + /** The Azure subscription ID. */ + @SerializedName("azure_subscription_id") + String azureSubscriptionId; + } + /** Additional information about event destination status. */ @Getter @Setter @@ -150,7 +191,8 @@ public static class Disabled extends StripeObject { /** * Reason event destination has been disabled. * - *

One of {@code no_aws_event_source_exists}, or {@code user}. + *

One of {@code no_aws_event_source_exists}, {@code no_azure_partner_topic_exists}, or + * {@code user}. */ @SerializedName("reason") String reason; diff --git a/src/main/java/com/stripe/model/v2/core/EventNotification.java b/src/main/java/com/stripe/model/v2/core/EventNotification.java index 2246cabcaa7..374abbb60f8 100644 --- a/src/main/java/com/stripe/model/v2/core/EventNotification.java +++ b/src/main/java/com/stripe/model/v2/core/EventNotification.java @@ -93,6 +93,12 @@ public static EventNotification fromJson(String payload, StripeClient client) { // don't love the double json parse here, but I don't think we can avoid it? JsonObject jsonObject = ApiResource.GSON.fromJson(payload, JsonObject.class).getAsJsonObject(); + if (jsonObject.has("object") && "event".equals(jsonObject.get("object").getAsString())) { + throw new IllegalArgumentException( + "You passed a webhook payload to StripeClient.parseEventNotification, which expects an event notification." + + " Use StripeClient.constructEvent instead."); + } + Class cls = EventNotificationClassLookup.eventClassLookup.get(jsonObject.get("type").getAsString()); if (cls == null) { diff --git a/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java b/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java index d1ea223c682..f43af389910 100644 --- a/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java +++ b/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java @@ -5,6 +5,7 @@ import com.stripe.model.HasId; import com.stripe.model.StripeObject; import java.time.Instant; +import java.util.List; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -80,6 +81,10 @@ public class GbBankAccount extends StripeObject implements HasId { @SerializedName("sort_code") String sortCode; + /** The list of currencies supported by this bank account. */ + @SerializedName("supported_currencies") + List supportedCurrencies; + /** The alternative reference for this payout method, if it's a projected payout method. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java b/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java index a4b359adc37..37a3ed55f33 100644 --- a/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java +++ b/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java @@ -5,6 +5,7 @@ import com.stripe.model.HasId; import com.stripe.model.StripeObject; import java.time.Instant; +import java.util.List; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -81,6 +82,10 @@ public class UsBankAccount extends StripeObject implements HasId { @SerializedName("routing_number") String routingNumber; + /** The list of currencies supported by this bank account. */ + @SerializedName("supported_currencies") + List supportedCurrencies; + /** The bank account verification details. */ @SerializedName("verification") Verification verification; diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/Adjustment.java b/src/main/java/com/stripe/model/v2/moneymanagement/Adjustment.java index 25cf1b6224c..6c3003f3991 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/Adjustment.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/Adjustment.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -110,25 +111,4 @@ public static class AdjustedFlow extends StripeObject { @SerializedName("type") String type; } - - /** The amount of the Adjustment. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java b/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java index a02e0dfa787..a971b0de373 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.List; import java.util.Map; @@ -86,6 +87,7 @@ public class FinancialAccount extends StripeObject implements HasId { @SerializedName("status") String status; + /** Additional details related to the status of the FinancialAccount. */ @SerializedName("status_details") StatusDetails statusDetails; @@ -117,87 +119,15 @@ public class FinancialAccount extends StripeObject implements HasId { public static class Balance extends StripeObject { /** Balance that can be used for money movement. */ @SerializedName("available") - Map available; + Map available; /** Balance of inbound funds that will later transition to the {@code available} balance. */ @SerializedName("inbound_pending") - Map inboundPending; + Map inboundPending; /** Balance of funds that are being used for a pending outbound money movement. */ @SerializedName("outbound_pending") - Map outboundPending; - - /** - * For more details about Available, please refer to the API Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Available extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** - * For more details about InboundPending, please refer to the API Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class InboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** - * For more details about OutboundPending, please refer to the API Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class OutboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } + Map outboundPending; } /** @@ -216,35 +146,33 @@ public static class Other extends StripeObject { String type; } - /** - * For more details about StatusDetails, please refer to the API Reference. - */ + /** Additional details related to the status of the FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class StatusDetails extends StripeObject { + /** Details related to the closed state of the FinancialAccount. */ @SerializedName("closed") Closed closed; - /** - * For more details about Closed, please refer to the API - * Reference. - */ + /** Details related to the closed state of the FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class Closed extends StripeObject { + /** The forwarding settings for the closed FinancialAccount. */ @SerializedName("forwarding_settings") ForwardingSettings forwardingSettings; + /** + * The reason the FinancialAccount was closed. + * + *

One of {@code account_closed}, {@code closed_by_platform}, or {@code other}. + */ @SerializedName("reason") String reason; - /** - * For more details about ForwardingSettings, please refer to the API Reference. - */ + /** The forwarding settings for the closed FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/InboundTransfer.java b/src/main/java/com/stripe/model/v2/moneymanagement/InboundTransfer.java index 56e054e8aa0..4816f0ba479 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/InboundTransfer.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/InboundTransfer.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.List; import java.util.Map; @@ -74,27 +75,6 @@ public class InboundTransfer extends StripeObject implements HasId { @SerializedName("transfer_history") List transferHistory; - /** The amount in specified currency that will land in the FinancialAccount balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** A nested object containing information about the origin of the InboundTransfer. */ @Getter @Setter @@ -102,33 +82,12 @@ public static class Amount extends StripeObject { public static class From extends StripeObject { /** The amount in specified currency that was debited from the Payment Method. */ @SerializedName("debited") - Debited debited; + Amount debited; /** The Payment Method object used to create the InboundTransfer. */ @SerializedName("payment_method") PaymentMethod paymentMethod; - /** The amount in specified currency that was debited from the Payment Method. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Debited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** The Payment Method object used to create the InboundTransfer. */ @Getter @Setter @@ -154,32 +113,11 @@ public static class PaymentMethod extends StripeObject { public static class To extends StripeObject { /** The amount by which the FinancialAccount balance is credited. */ @SerializedName("credited") - Credited credited; + Amount credited; /** The FinancialAccount that funds will land in. */ @SerializedName("financial_account") String financialAccount; - - /** The amount by which the FinancialAccount balance is credited. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Credited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPayment.java b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPayment.java index c271016b876..c6046984d89 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPayment.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPayment.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.Map; import lombok.EqualsAndHashCode; @@ -145,32 +146,11 @@ public class OutboundPayment extends StripeObject implements HasId { /** * A unique identifier that can be used to track this OutboundPayment with recipient bank. Banks - * might call this a “reference number” or something similar. + * might call this a "reference number" or something similar. */ @SerializedName("trace_id") TraceId traceId; - /** The "presentment amount" for the OutboundPayment. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** Delivery options to be used to send the OutboundPayment. */ @Getter @Setter @@ -192,32 +172,11 @@ public static class DeliveryOptions extends StripeObject { public static class From extends StripeObject { /** The monetary amount debited from the sender, only set on responses. */ @SerializedName("debited") - Debited debited; + Amount debited; /** The FinancialAccount that funds were pulled from. */ @SerializedName("financial_account") String financialAccount; - - /** The monetary amount debited from the sender, only set on responses. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Debited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** Details about the OutboundPayment notification settings for recipient. */ @@ -329,7 +288,7 @@ public static class StatusTransitions extends StripeObject { public static class To extends StripeObject { /** The monetary amount being credited to the destination. */ @SerializedName("credited") - Credited credited; + Amount credited; /** The payout method which the OutboundPayment uses to send payout. */ @SerializedName("payout_method") @@ -338,32 +297,11 @@ public static class To extends StripeObject { /** To which account the OutboundPayment is sent. */ @SerializedName("recipient") String recipient; - - /** The monetary amount being credited to the destination. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Credited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** * A unique identifier that can be used to track this OutboundPayment with recipient bank. Banks - * might call this a “reference number” or something similar. + * might call this a "reference number" or something similar. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java index 1c80c6d4cac..aedc34af7ed 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.List; import java.util.Map; @@ -71,27 +72,6 @@ public class OutboundPaymentQuote extends StripeObject implements HasId { @SerializedName("to") To to; - /** The "presentment amount" for the OutboundPaymentQuote. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** Delivery options to be used to send the OutboundPayment. */ @Getter @Setter @@ -126,27 +106,6 @@ public static class EstimatedFee extends StripeObject { */ @SerializedName("type") String type; - - /** The fee amount for corresponding fee type. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** Details about the sender of an OutboundPaymentQuote. */ @@ -156,32 +115,11 @@ public static class Amount extends StripeObject { public static class From extends StripeObject { /** The monetary amount debited from the sender, only set on responses. */ @SerializedName("debited") - Debited debited; + Amount debited; /** The FinancialAccount that funds were pulled from. */ @SerializedName("financial_account") String financialAccount; - - /** The monetary amount debited from the sender, only set on responses. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Debited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** The underlying FXQuote details for the OutboundPaymentQuote. */ @@ -243,7 +181,7 @@ public static class Rate extends StripeObject { public static class To extends StripeObject { /** The monetary amount being credited to the destination. */ @SerializedName("credited") - Credited credited; + Amount credited; /** The payout method which the OutboundPayment uses to send payout. */ @SerializedName("payout_method") @@ -252,26 +190,5 @@ public static class To extends StripeObject { /** To which account the OutboundPayment is sent. */ @SerializedName("recipient") String recipient; - - /** The monetary amount being credited to the destination. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Credited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } } diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundTransfer.java b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundTransfer.java index d9ab6d45385..c052f60f631 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundTransfer.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundTransfer.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.Map; import lombok.EqualsAndHashCode; @@ -126,32 +127,11 @@ public class OutboundTransfer extends StripeObject implements HasId { /** * A unique identifier that can be used to track this OutboundTransfer with recipient bank. Banks - * might call this a “reference number” or something similar. + * might call this a "reference number" or something similar. */ @SerializedName("trace_id") TraceId traceId; - /** The "presentment amount" for the OutboundTransfer. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** Delivery options to be used to send the OutboundTransfer. */ @Getter @Setter @@ -173,32 +153,11 @@ public static class DeliveryOptions extends StripeObject { public static class From extends StripeObject { /** The monetary amount debited from the sender, only set on responses. */ @SerializedName("debited") - Debited debited; + Amount debited; /** The FinancialAccount that funds were pulled from. */ @SerializedName("financial_account") String financialAccount; - - /** The monetary amount debited from the sender, only set on responses. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Debited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** Status details for an OutboundTransfer in a {@code failed} or {@code returned} state. */ @@ -294,37 +253,16 @@ public static class StatusTransitions extends StripeObject { public static class To extends StripeObject { /** The monetary amount being credited to the destination. */ @SerializedName("credited") - Credited credited; + Amount credited; /** The payout method which the OutboundTransfer uses to send payout. */ @SerializedName("payout_method") String payoutMethod; - - /** The monetary amount being credited to the destination. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Credited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** * A unique identifier that can be used to track this OutboundTransfer with recipient bank. Banks - * might call this a “reference number” or something similar. + * might call this a "reference number" or something similar. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java index e7dae1d42e7..3635800ffb6 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java @@ -60,6 +60,13 @@ public class PayoutMethod extends StripeObject implements HasId { @SerializedName("object") String object; + /** + * Whether the Payout Method is currently unusable for money movement, despite potentially being + * correctly set up. Please reach out to Stripe Support for more information. + */ + @SerializedName("restricted") + Boolean restricted; + /** * Closed Enum. The type of payout method. * @@ -188,6 +195,10 @@ public static class Card extends StripeObject { /** The last 4 digits of the card number. */ @SerializedName("last4") String last4; + + /** The list of currencies supported by this bank account. */ + @SerializedName("supported_currencies") + List supportedCurrencies; } /** diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java index 23b774f7353..70c296bc556 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java @@ -54,6 +54,13 @@ public static class Country extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Field extends StripeObject { + /** + * The currencies supported by the corresponding credentials for bank accounts in the + * specified country. + */ + @SerializedName("currencies") + List currencies; + /** The local name of the field. */ @SerializedName("local_name") String localName; diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java index 0d985df7536..1c26a25da25 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -105,27 +106,6 @@ public class ReceivedCredit extends StripeObject implements HasId { @SerializedName("type") String type; - /** The amount and currency of the ReceivedCredit. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** * This object stores details about the originating Stripe transaction that resulted in the * ReceivedCredit. Present if {@code type} field value is {@code balance_transfer}. diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java index b47d0429e59..35e84bcd2d7 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -83,34 +84,13 @@ public class ReceivedDebit extends StripeObject implements HasId { StatusTransitions statusTransitions; /** - * Open enum, the type of the received debit. + * Open Enum. The type of the ReceivedDebit. * *

One of {@code bank_transfer}, or {@code external_debit}. */ @SerializedName("type") String type; - /** Amount and currency of the ReceivedDebit. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** * This object stores details about the originating banking transaction that resulted in the * ReceivedDebit. Present if {@code type} field value is {@code bank_transfer}. diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java b/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java index 9e276469389..bb463978436 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -41,6 +42,10 @@ public class Transaction extends StripeObject implements HasId { @SerializedName("category") String category; + /** Counterparty to this Transaction. */ + @SerializedName("counterparty") + Counterparty counterparty; + /** * Time at which the object was created. Represented as a RFC 3339 date & time UTC value in * millisecond precision, for example: 2022-09-18T13:22:18.123Z. @@ -48,6 +53,13 @@ public class Transaction extends StripeObject implements HasId { @SerializedName("created") Instant created; + /** + * Description of this Transaction. When applicable, the description is copied from the Flow + * object at the time of transaction creation. + */ + @SerializedName("description") + String description; + /** Indicates the FinancialAccount affected by this Transaction. */ @SerializedName("financial_account") String financialAccount; @@ -93,27 +105,6 @@ public class Transaction extends StripeObject implements HasId { @SerializedName("status_transitions") StatusTransitions statusTransitions; - /** The amount of the Transaction. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** * The delta to the FinancialAccount's balance. The balance_impact for the Transaction is equal to * sum of its TransactionEntries that have {@code effective_at}s in the past. @@ -124,78 +115,25 @@ public static class Amount extends StripeObject { public static class BalanceImpact extends StripeObject { /** Impact to the available balance. */ @SerializedName("available") - Available available; + Amount available; /** Impact to the inbound_pending balance. */ @SerializedName("inbound_pending") - InboundPending inboundPending; + Amount inboundPending; /** Impact to the outbound_pending balance. */ @SerializedName("outbound_pending") - OutboundPending outboundPending; - - /** Impact to the available balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Available extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** Impact to the inbound_pending balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class InboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** Impact to the outbound_pending balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class OutboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; + Amount outboundPending; + } - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } + /** Counterparty to this Transaction. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Counterparty extends StripeObject { + /** Name of the counterparty. */ + @SerializedName("name") + String name; } /** Details about the Flow object that created the Transaction. */ diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java b/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java index c5730e80df6..87d1e6f2e15 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -68,78 +69,15 @@ public class TransactionEntry extends StripeObject implements HasId { public static class BalanceImpact extends StripeObject { /** Impact to the available balance. */ @SerializedName("available") - Available available; + Amount available; /** Impact to the inbound_pending balance. */ @SerializedName("inbound_pending") - InboundPending inboundPending; + Amount inboundPending; /** Impact to the outbound_pending balance. */ @SerializedName("outbound_pending") - OutboundPending outboundPending; - - /** Impact to the available balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Available extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** Impact to the inbound_pending balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class InboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** Impact to the outbound_pending balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class OutboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } + Amount outboundPending; } /** Details copied from the transaction that this TransactionEntry belongs to. */ diff --git a/src/main/java/com/stripe/net/JsonEncoder.java b/src/main/java/com/stripe/net/JsonEncoder.java index 35de33bc6a2..898a7d6f5e3 100644 --- a/src/main/java/com/stripe/net/JsonEncoder.java +++ b/src/main/java/com/stripe/net/JsonEncoder.java @@ -3,15 +3,42 @@ import com.google.gson.FieldNamingPolicy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; final class JsonEncoder { + /** + * Serializes BigDecimal as a JSON string (e.g., "25.5") rather than a JSON number (25.5). All + * BigDecimal fields in the Stripe API use format: decimal, and the V2 API expects them as strings + * on the wire. + */ + private static final TypeAdapter BIG_DECIMAL_STRING_ADAPTER = + new TypeAdapter() { + @Override + public void write(JsonWriter out, BigDecimal value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(value.toPlainString()); + } + } + + @Override + public BigDecimal read(JsonReader in) throws IOException { + return new BigDecimal(in.nextString()); + } + }; + private static final Gson BODY_GSON = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .serializeNulls() + .registerTypeAdapter(BigDecimal.class, BIG_DECIMAL_STRING_ADAPTER) .create(); public static HttpContent createHttpContent(Map params) throws IOException { diff --git a/src/main/java/com/stripe/net/Webhook.java b/src/main/java/com/stripe/net/Webhook.java index ea67ea34362..09505f70873 100644 --- a/src/main/java/com/stripe/net/Webhook.java +++ b/src/main/java/com/stripe/net/Webhook.java @@ -54,8 +54,8 @@ public static Event constructEvent( /** * Returns an Event instance using the provided JSON payload. Throws a JsonSyntaxException if the - * payload is not valid JSON, and a SignatureVerificationException if the signature verification - * fails for any reason. + * payload is not valid JSON, a SignatureVerificationException if the signature verification fails + * for any reason, and an IllegalArgumentException if you pass the wrong type of input. * * @param payload the payload sent by Stripe. * @param sigHeader the contents of the signature header sent by Stripe. @@ -72,6 +72,13 @@ public static Event constructEvent( Event event = StripeObject.deserializeStripeObject( payload, Event.class, ApiResource.getGlobalResponseGetter()); + + if ("v2.core.event".equals(event.getObject())) { + throw new IllegalArgumentException( + "You passed an event notification to Webhook.constructEvent, which expects a webhook payload." + + " Use StripeClient.parseEventNotification instead."); + } + Signature.verifyHeader(payload, sigHeader, secret, tolerance, clock); // StripeObjects source their raw JSON object from their last response, but constructed webhooks // don't have that diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index a308f933b6c..7f9acd2895f 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -1629,6 +1629,10 @@ public static class Capabilities { @SerializedName("twint_payments") TwintPayments twintPayments; + /** The upi_payments capability. */ + @SerializedName("upi_payments") + UpiPayments upiPayments; + /** The us_bank_account_ach_payments capability. */ @SerializedName("us_bank_account_ach_payments") UsBankAccountAchPayments usBankAccountAchPayments; @@ -1714,6 +1718,7 @@ private Capabilities( TreasuryFifthThird treasuryFifthThird, TreasuryGoldmanSachs treasuryGoldmanSachs, TwintPayments twintPayments, + UpiPayments upiPayments, UsBankAccountAchPayments usBankAccountAchPayments, UsBankTransferPayments usBankTransferPayments, ZipPayments zipPayments) { @@ -1789,6 +1794,7 @@ private Capabilities( this.treasuryFifthThird = treasuryFifthThird; this.treasuryGoldmanSachs = treasuryGoldmanSachs; this.twintPayments = twintPayments; + this.upiPayments = upiPayments; this.usBankAccountAchPayments = usBankAccountAchPayments; this.usBankTransferPayments = usBankTransferPayments; this.zipPayments = zipPayments; @@ -1943,6 +1949,8 @@ public static class Builder { private TwintPayments twintPayments; + private UpiPayments upiPayments; + private UsBankAccountAchPayments usBankAccountAchPayments; private UsBankTransferPayments usBankTransferPayments; @@ -2024,6 +2032,7 @@ public AccountCreateParams.Capabilities build() { this.treasuryFifthThird, this.treasuryGoldmanSachs, this.twintPayments, + this.upiPayments, this.usBankAccountAchPayments, this.usBankTransferPayments, this.zipPayments); @@ -2539,6 +2548,12 @@ public Builder setTwintPayments( return this; } + /** The upi_payments capability. */ + public Builder setUpiPayments(AccountCreateParams.Capabilities.UpiPayments upiPayments) { + this.upiPayments = upiPayments; + return this; + } + /** The us_bank_account_ach_payments capability. */ public Builder setUsBankAccountAchPayments( AccountCreateParams.Capabilities.UsBankAccountAchPayments usBankAccountAchPayments) { @@ -8234,6 +8249,85 @@ public Builder setRequested(Boolean requested) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class UpiPayments { + /** + * 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; + + /** + * Passing true requests the capability for the account, if it is not already requested. A + * requested capability may not immediately become active. Any requirements to activate the + * capability are returned in the {@code requirements} arrays. + */ + @SerializedName("requested") + Boolean requested; + + private UpiPayments(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Capabilities.UpiPayments build() { + return new AccountCreateParams.Capabilities.UpiPayments(this.extraParams, this.requested); + } + + /** + * 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 AccountCreateParams.Capabilities.UpiPayments#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 AccountCreateParams.Capabilities.UpiPayments#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Passing true requests the capability for the account, if it is not already requested. A + * requested capability may not immediately become active. Any requirements to activate the + * capability are returned in the {@code requirements} arrays. + */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccountAchPayments { @@ -16202,7 +16296,10 @@ public static class PaypayPayments { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Whether your business sells digital content or not. */ + /** + * The type of goods your business sells. Use {@code digital_content} if you sell digital + * content. Use {@code other} for all other types of goods or services. + */ @SerializedName("goods_type") GoodsType goodsType; @@ -16296,7 +16393,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Whether your business sells digital content or not. */ + /** + * The type of goods your business sells. Use {@code digital_content} if you sell digital + * content. Use {@code other} for all other types of goods or services. + */ public Builder setGoodsType( AccountCreateParams.Settings.PaypayPayments.GoodsType goodsType) { this.goodsType = goodsType; diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index 25dae548c9c..b064c2f57c1 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -1730,6 +1730,10 @@ public static class Capabilities { @SerializedName("twint_payments") TwintPayments twintPayments; + /** The upi_payments capability. */ + @SerializedName("upi_payments") + UpiPayments upiPayments; + /** The us_bank_account_ach_payments capability. */ @SerializedName("us_bank_account_ach_payments") UsBankAccountAchPayments usBankAccountAchPayments; @@ -1815,6 +1819,7 @@ private Capabilities( TreasuryFifthThird treasuryFifthThird, TreasuryGoldmanSachs treasuryGoldmanSachs, TwintPayments twintPayments, + UpiPayments upiPayments, UsBankAccountAchPayments usBankAccountAchPayments, UsBankTransferPayments usBankTransferPayments, ZipPayments zipPayments) { @@ -1890,6 +1895,7 @@ private Capabilities( this.treasuryFifthThird = treasuryFifthThird; this.treasuryGoldmanSachs = treasuryGoldmanSachs; this.twintPayments = twintPayments; + this.upiPayments = upiPayments; this.usBankAccountAchPayments = usBankAccountAchPayments; this.usBankTransferPayments = usBankTransferPayments; this.zipPayments = zipPayments; @@ -2044,6 +2050,8 @@ public static class Builder { private TwintPayments twintPayments; + private UpiPayments upiPayments; + private UsBankAccountAchPayments usBankAccountAchPayments; private UsBankTransferPayments usBankTransferPayments; @@ -2125,6 +2133,7 @@ public AccountUpdateParams.Capabilities build() { this.treasuryFifthThird, this.treasuryGoldmanSachs, this.twintPayments, + this.upiPayments, this.usBankAccountAchPayments, this.usBankTransferPayments, this.zipPayments); @@ -2640,6 +2649,12 @@ public Builder setTwintPayments( return this; } + /** The upi_payments capability. */ + public Builder setUpiPayments(AccountUpdateParams.Capabilities.UpiPayments upiPayments) { + this.upiPayments = upiPayments; + return this; + } + /** The us_bank_account_ach_payments capability. */ public Builder setUsBankAccountAchPayments( AccountUpdateParams.Capabilities.UsBankAccountAchPayments usBankAccountAchPayments) { @@ -8335,6 +8350,85 @@ public Builder setRequested(Boolean requested) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class UpiPayments { + /** + * 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; + + /** + * Passing true requests the capability for the account, if it is not already requested. A + * requested capability may not immediately become active. Any requirements to activate the + * capability are returned in the {@code requirements} arrays. + */ + @SerializedName("requested") + Boolean requested; + + private UpiPayments(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Capabilities.UpiPayments build() { + return new AccountUpdateParams.Capabilities.UpiPayments(this.extraParams, this.requested); + } + + /** + * 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 AccountUpdateParams.Capabilities.UpiPayments#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 AccountUpdateParams.Capabilities.UpiPayments#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Passing true requests the capability for the account, if it is not already requested. A + * requested capability may not immediately become active. Any requirements to activate the + * capability are returned in the {@code requirements} arrays. + */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccountAchPayments { @@ -16411,7 +16505,10 @@ public static class PaypayPayments { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Whether your business sells digital content or not. */ + /** + * The type of goods your business sells. Use {@code digital_content} if you sell digital + * content. Use {@code other} for all other types of goods or services. + */ @SerializedName("goods_type") GoodsType goodsType; @@ -16505,7 +16602,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Whether your business sells digital content or not. */ + /** + * The type of goods your business sells. Use {@code digital_content} if you sell digital + * content. Use {@code other} for all other types of goods or services. + */ public Builder setGoodsType( AccountUpdateParams.Settings.PaypayPayments.GoodsType goodsType) { this.goodsType = goodsType; diff --git a/src/main/java/com/stripe/param/ChargeCaptureParams.java b/src/main/java/com/stripe/param/ChargeCaptureParams.java index 0c3aecfd06f..5378c15e0e8 100644 --- a/src/main/java/com/stripe/param/ChargeCaptureParams.java +++ b/src/main/java/com/stripe/param/ChargeCaptureParams.java @@ -352,10 +352,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -637,10 +633,6 @@ public Builder setLodgingData( * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -654,10 +646,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. diff --git a/src/main/java/com/stripe/param/ChargeUpdateParams.java b/src/main/java/com/stripe/param/ChargeUpdateParams.java index 8c0fdfe61de..024f5f587c6 100644 --- a/src/main/java/com/stripe/param/ChargeUpdateParams.java +++ b/src/main/java/com/stripe/param/ChargeUpdateParams.java @@ -499,10 +499,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -783,10 +779,6 @@ public Builder setLodgingData( * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -800,10 +792,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. diff --git a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java index 8ece8d38971..06ffbbb9254 100644 --- a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java +++ b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java @@ -635,6 +635,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -717,6 +724,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -780,6 +788,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -910,6 +919,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -979,6 +990,7 @@ public ConfirmationTokenCreateParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1585,6 +1597,15 @@ public Builder setType(ConfirmationTokenCreateParams.PaymentMethodData.Type type return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(ConfirmationTokenCreateParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -6046,19 +6067,9 @@ public static class StripeBalance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The source_type - * of the balance - */ - @SerializedName("source_type") - SourceType sourceType; - - private StripeBalance( - String account, Map extraParams, SourceType sourceType) { + private StripeBalance(String account, Map extraParams) { this.account = account; this.extraParams = extraParams; - this.sourceType = sourceType; } public static Builder builder() { @@ -6070,12 +6081,10 @@ public static class Builder { private Map extraParams; - private SourceType sourceType; - /** Finalize and obtain parameter instance from this builder. */ public ConfirmationTokenCreateParams.PaymentMethodData.StripeBalance build() { return new ConfirmationTokenCreateParams.PaymentMethodData.StripeBalance( - this.account, this.extraParams, this.sourceType); + this.account, this.extraParams); } /** The connected account ID whose Stripe balance to use as the source of payment. */ @@ -6113,35 +6122,6 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } - - /** - * The source_type - * of the balance - */ - public Builder setSourceType( - ConfirmationTokenCreateParams.PaymentMethodData.StripeBalance.SourceType sourceType) { - this.sourceType = sourceType; - return this; - } - } - - public enum SourceType implements ApiRequestParams.EnumParam { - @SerializedName("bank_account") - BANK_ACCOUNT("bank_account"), - - @SerializedName("card") - CARD("card"), - - @SerializedName("fpx") - FPX("fpx"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - SourceType(String value) { - this.value = value; - } } } @@ -6261,6 +6241,229 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfirmationTokenCreateParams.PaymentMethodData.Upi build() { + return new ConfirmationTokenCreateParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * 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 ConfirmationTokenCreateParams.PaymentMethodData.Upi#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 ConfirmationTokenCreateParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions build() { + return new ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions#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 + * ConfirmationTokenCreateParams.PaymentMethodData.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -6725,6 +6928,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/CreditNoteCreateParams.java b/src/main/java/com/stripe/param/CreditNoteCreateParams.java index 4af8c7201f0..cedeeb465b2 100644 --- a/src/main/java/com/stripe/param/CreditNoteCreateParams.java +++ b/src/main/java/com/stripe/param/CreditNoteCreateParams.java @@ -452,6 +452,15 @@ public static class Line { @SerializedName("invoice_line_item") String invoiceLineItem; + /** + * 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. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + /** The line item quantity to credit. */ @SerializedName("quantity") Long quantity; @@ -499,6 +508,7 @@ private Line( String description, Map extraParams, String invoiceLineItem, + Map metadata, Long quantity, Object taxAmounts, Object taxRates, @@ -509,6 +519,7 @@ private Line( this.description = description; this.extraParams = extraParams; this.invoiceLineItem = invoiceLineItem; + this.metadata = metadata; this.quantity = quantity; this.taxAmounts = taxAmounts; this.taxRates = taxRates; @@ -530,6 +541,8 @@ public static class Builder { private String invoiceLineItem; + private Map metadata; + private Long quantity; private Object taxAmounts; @@ -549,6 +562,7 @@ public CreditNoteCreateParams.Line build() { this.description, this.extraParams, this.invoiceLineItem, + this.metadata, this.quantity, this.taxAmounts, this.taxRates, @@ -610,6 +624,32 @@ public Builder setInvoiceLineItem(String invoiceLineItem) { return this; } + /** + * Add a key/value pair to `metadata` 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 + * CreditNoteCreateParams.Line#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` 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 CreditNoteCreateParams.Line#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + /** The line item quantity to credit. */ public Builder setQuantity(Long quantity) { this.quantity = quantity; diff --git a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java index cc81e9c9328..1d1dd8f82a6 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java @@ -523,6 +523,15 @@ public static class Line { @SerializedName("invoice_line_item") String invoiceLineItem; + /** + * 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. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + /** The line item quantity to credit. */ @SerializedName("quantity") Long quantity; @@ -570,6 +579,7 @@ private Line( String description, Map extraParams, String invoiceLineItem, + Map metadata, Long quantity, Object taxAmounts, Object taxRates, @@ -580,6 +590,7 @@ private Line( this.description = description; this.extraParams = extraParams; this.invoiceLineItem = invoiceLineItem; + this.metadata = metadata; this.quantity = quantity; this.taxAmounts = taxAmounts; this.taxRates = taxRates; @@ -601,6 +612,8 @@ public static class Builder { private String invoiceLineItem; + private Map metadata; + private Long quantity; private Object taxAmounts; @@ -620,6 +633,7 @@ public CreditNotePreviewLinesListParams.Line build() { this.description, this.extraParams, this.invoiceLineItem, + this.metadata, this.quantity, this.taxAmounts, this.taxRates, @@ -681,6 +695,32 @@ public Builder setInvoiceLineItem(String invoiceLineItem) { return this; } + /** + * Add a key/value pair to `metadata` 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 + * CreditNotePreviewLinesListParams.Line#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` 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 CreditNotePreviewLinesListParams.Line#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + /** The line item quantity to credit. */ public Builder setQuantity(Long quantity) { this.quantity = quantity; diff --git a/src/main/java/com/stripe/param/CreditNotePreviewParams.java b/src/main/java/com/stripe/param/CreditNotePreviewParams.java index 68518736636..69350171b81 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewParams.java @@ -452,6 +452,15 @@ public static class Line { @SerializedName("invoice_line_item") String invoiceLineItem; + /** + * 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. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + /** The line item quantity to credit. */ @SerializedName("quantity") Long quantity; @@ -499,6 +508,7 @@ private Line( String description, Map extraParams, String invoiceLineItem, + Map metadata, Long quantity, Object taxAmounts, Object taxRates, @@ -509,6 +519,7 @@ private Line( this.description = description; this.extraParams = extraParams; this.invoiceLineItem = invoiceLineItem; + this.metadata = metadata; this.quantity = quantity; this.taxAmounts = taxAmounts; this.taxRates = taxRates; @@ -530,6 +541,8 @@ public static class Builder { private String invoiceLineItem; + private Map metadata; + private Long quantity; private Object taxAmounts; @@ -549,6 +562,7 @@ public CreditNotePreviewParams.Line build() { this.description, this.extraParams, this.invoiceLineItem, + this.metadata, this.quantity, this.taxAmounts, this.taxRates, @@ -610,6 +624,32 @@ public Builder setInvoiceLineItem(String invoiceLineItem) { return this; } + /** + * Add a key/value pair to `metadata` 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 + * CreditNotePreviewParams.Line#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` 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 CreditNotePreviewParams.Line#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + /** The line item quantity to credit. */ public Builder setQuantity(Long quantity) { this.quantity = quantity; diff --git a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java index fe47391d356..2b66283037c 100644 --- a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java +++ b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java @@ -405,6 +405,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java index 430a8956192..6506d753365 100644 --- a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java @@ -405,6 +405,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/InvoiceAddLinesParams.java b/src/main/java/com/stripe/param/InvoiceAddLinesParams.java index c1fb37f2bd0..7ee9ecce946 100644 --- a/src/main/java/com/stripe/param/InvoiceAddLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceAddLinesParams.java @@ -286,10 +286,20 @@ public static class Line { @SerializedName("pricing") Pricing pricing; - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + @SerializedName("quantity_decimal") + BigDecimal quantityDecimal; + /** * A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes * on your own or use a third-party to calculate them. You cannot set tax amounts if any line @@ -324,6 +334,7 @@ private Line( PriceData priceData, Pricing pricing, Long quantity, + BigDecimal quantityDecimal, Object taxAmounts, Object taxRates) { this.amount = amount; @@ -338,6 +349,7 @@ private Line( this.priceData = priceData; this.pricing = pricing; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.taxAmounts = taxAmounts; this.taxRates = taxRates; } @@ -371,6 +383,8 @@ public static class Builder { private Long quantity; + private BigDecimal quantityDecimal; + private Object taxAmounts; private Object taxRates; @@ -390,6 +404,7 @@ public InvoiceAddLinesParams.Line build() { this.priceData, this.pricing, this.quantity, + this.quantityDecimal, this.taxAmounts, this.taxRates); } @@ -630,12 +645,25 @@ public Builder setPricing(InvoiceAddLinesParams.Line.Pricing pricing) { return this; } - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line + * item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * Add an element to `taxAmounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link @@ -1441,6 +1469,14 @@ public static class ProductData { @SerializedName("tax_code") String taxCode; + /** + * Tax details for this product, including the tax code and an optional performance + * location. + */ + @SerializedName("tax_details") + TaxDetails taxDetails; + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -1455,6 +1491,7 @@ private ProductData( Map metadata, String name, String taxCode, + TaxDetails taxDetails, String unitLabel) { this.description = description; this.extraParams = extraParams; @@ -1462,6 +1499,7 @@ private ProductData( this.metadata = metadata; this.name = name; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.unitLabel = unitLabel; } @@ -1482,6 +1520,8 @@ public static class Builder { private String taxCode; + private TaxDetails taxDetails; + private String unitLabel; /** Finalize and obtain parameter instance from this builder. */ @@ -1493,6 +1533,7 @@ public InvoiceAddLinesParams.Line.PriceData.ProductData build() { this.metadata, this.name, this.taxCode, + this.taxDetails, this.unitLabel); } @@ -1602,6 +1643,17 @@ public Builder setTaxCode(String taxCode) { return this; } + /** + * Tax details for this product, including the tax code and an optional performance + * location. + */ + public Builder setTaxDetails( + InvoiceAddLinesParams.Line.PriceData.ProductData.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -1611,6 +1663,109 @@ public Builder setUnitLabel(String unitLabel) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + private TaxDetails( + Map extraParams, String performanceLocation, Object taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String performanceLocation; + + private Object taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceAddLinesParams.Line.PriceData.ProductData.TaxDetails build() { + return new InvoiceAddLinesParams.Line.PriceData.ProductData.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * InvoiceAddLinesParams.Line.PriceData.ProductData.TaxDetails#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 + * InvoiceAddLinesParams.Line.PriceData.ProductData.TaxDetails#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(EmptyParam taxCode) { + this.taxCode = taxCode; + return this; + } + } + } } public enum TaxBehavior implements ApiRequestParams.EnumParam { diff --git a/src/main/java/com/stripe/param/InvoiceCreateParams.java b/src/main/java/com/stripe/param/InvoiceCreateParams.java index 651464b5eeb..8d0b26d869e 100644 --- a/src/main/java/com/stripe/param/InvoiceCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreateParams.java @@ -3930,6 +3930,13 @@ public static class Pix { @SerializedName("amount_includes_iof") AmountIncludesIof amountIncludesIof; + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + /** * 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. @@ -3940,8 +3947,12 @@ public static class Pix { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Pix(AmountIncludesIof amountIncludesIof, Map extraParams) { + private Pix( + AmountIncludesIof amountIncludesIof, + Long expiresAfterSeconds, + Map extraParams) { this.amountIncludesIof = amountIncludesIof; + this.expiresAfterSeconds = expiresAfterSeconds; this.extraParams = extraParams; } @@ -3952,12 +3963,14 @@ public static Builder builder() { public static class Builder { private AmountIncludesIof amountIncludesIof; + private Long expiresAfterSeconds; + private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Pix build() { return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Pix( - this.amountIncludesIof, this.extraParams); + this.amountIncludesIof, this.expiresAfterSeconds, this.extraParams); } /** Determines if the amount includes the IOF tax. Defaults to {@code never}. */ @@ -3968,6 +3981,15 @@ public Builder setAmountIncludesIof( return this; } + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + public Builder setExpiresAfterSeconds(Long expiresAfterSeconds) { + this.expiresAfterSeconds = expiresAfterSeconds; + 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 diff --git a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java index 88b1d35c83c..81e27120ab4 100644 --- a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java @@ -2310,10 +2310,21 @@ public static class InvoiceItem { @SerializedName("price_data") PriceData priceData; - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code + * quantity_decimal} instead to provide decimal precision. This field will be deprecated in + * favor of {@code quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice + * item. + */ + @SerializedName("quantity_decimal") + BigDecimal quantityDecimal; + /** * Only required if a default @@ -2365,6 +2376,7 @@ private InvoiceItem( String price, PriceData priceData, Long quantity, + BigDecimal quantityDecimal, TaxBehavior taxBehavior, Object taxCode, Object taxRates, @@ -2382,6 +2394,7 @@ private InvoiceItem( this.price = price; this.priceData = priceData; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.taxBehavior = taxBehavior; this.taxCode = taxCode; this.taxRates = taxRates; @@ -2418,6 +2431,8 @@ public static class Builder { private Long quantity; + private BigDecimal quantityDecimal; + private TaxBehavior taxBehavior; private Object taxCode; @@ -2443,6 +2458,7 @@ public InvoiceCreatePreviewParams.InvoiceItem build() { this.price, this.priceData, this.quantity, + this.quantityDecimal, this.taxBehavior, this.taxCode, this.taxRates, @@ -2638,12 +2654,25 @@ public Builder setPriceData(InvoiceCreatePreviewParams.InvoiceItem.PriceData pri return this; } - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code + * quantity_decimal} instead to provide decimal precision. This field will be deprecated in + * favor of {@code quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice + * item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * Only required if a default @@ -5602,6 +5631,10 @@ public static class Add { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + private Add( List discounts, @@ -5610,7 +5643,8 @@ private Add( String price, Long quantity, List taxRates, - Trial trial) { + Trial trial, + String trialOffer) { this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -5618,6 +5652,7 @@ private Add( this.quantity = quantity; this.taxRates = taxRates; this.trial = trial; + this.trialOffer = trialOffer; } public static Builder builder() { @@ -5641,6 +5676,8 @@ public static class Builder { private Trial trial; + private String trialOffer; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add build() { return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add( @@ -5650,7 +5687,8 @@ public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add build this.price, this.quantity, this.taxRates, - this.trial); + this.trial, + this.trialOffer); } /** @@ -5792,6 +5830,12 @@ public Builder setTrial( this.trial = trial; return this; } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } } @Getter @@ -6454,6 +6498,10 @@ public static class Set { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + private Set( List discounts, @@ -6462,7 +6510,8 @@ private Set( String price, Long quantity, List taxRates, - Trial trial) { + Trial trial, + String trialOffer) { this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -6470,6 +6519,7 @@ private Set( this.quantity = quantity; this.taxRates = taxRates; this.trial = trial; + this.trialOffer = trialOffer; } public static Builder builder() { @@ -6493,6 +6543,8 @@ public static class Builder { private Trial trial; + private String trialOffer; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set build() { return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set( @@ -6502,7 +6554,8 @@ public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set build this.price, this.quantity, this.taxRates, - this.trial); + this.trial, + this.trialOffer); } /** @@ -6654,6 +6707,12 @@ public Builder setTrial( this.trial = trial; return this; } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } } @Getter @@ -7530,7 +7589,7 @@ public Builder setType( public static class Set { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ @SerializedName("behavior") Behavior behavior; @@ -7568,8 +7627,7 @@ public static class Builder { /** * Required. The payment collection behavior for this subscription - * while paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code - * void}. + * while paused. */ public Builder setBehavior( InvoiceCreatePreviewParams.ScheduleDetails.Amendment.SetPauseCollection.Set.Behavior @@ -11239,6 +11297,10 @@ public static class Item { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + private Item( Object billingThresholds, Object discounts, @@ -11249,7 +11311,8 @@ private Item( PriceData priceData, Long quantity, Object taxRates, - Trial trial) { + Trial trial, + String trialOffer) { this.billingThresholds = billingThresholds; this.discounts = discounts; this.extraParams = extraParams; @@ -11260,6 +11323,7 @@ private Item( this.quantity = quantity; this.taxRates = taxRates; this.trial = trial; + this.trialOffer = trialOffer; } public static Builder builder() { @@ -11287,6 +11351,8 @@ public static class Builder { private Trial trial; + private String trialOffer; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item build() { return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item( @@ -11299,7 +11365,8 @@ public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item build() { this.priceData, this.quantity, this.taxRates, - this.trial); + this.trial, + this.trialOffer); } /** @@ -11521,6 +11588,12 @@ public Builder setTrial( this.trial = trial; return this; } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } } @Getter @@ -12480,7 +12553,7 @@ public enum Type implements ApiRequestParams.EnumParam { public static class PauseCollection { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ @SerializedName("behavior") Behavior behavior; @@ -12517,7 +12590,7 @@ public InvoiceCreatePreviewParams.ScheduleDetails.Phase.PauseCollection build() /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ public Builder setBehavior( InvoiceCreatePreviewParams.ScheduleDetails.Phase.PauseCollection.Behavior behavior) { @@ -14658,6 +14731,10 @@ public static class Item { @SerializedName("clear_usage") Boolean clearUsage; + /** The trial offer to apply to this subscription item. */ + @SerializedName("current_trial") + CurrentTrial currentTrial; + /** A flag that, if set to {@code true}, will delete the specified item. */ @SerializedName("deleted") Boolean deleted; @@ -14724,6 +14801,7 @@ public static class Item { private Item( Object billingThresholds, Boolean clearUsage, + CurrentTrial currentTrial, Boolean deleted, Object discounts, Map extraParams, @@ -14736,6 +14814,7 @@ private Item( Object taxRates) { this.billingThresholds = billingThresholds; this.clearUsage = clearUsage; + this.currentTrial = currentTrial; this.deleted = deleted; this.discounts = discounts; this.extraParams = extraParams; @@ -14757,6 +14836,8 @@ public static class Builder { private Boolean clearUsage; + private CurrentTrial currentTrial; + private Boolean deleted; private Object discounts; @@ -14782,6 +14863,7 @@ public InvoiceCreatePreviewParams.SubscriptionDetails.Item build() { return new InvoiceCreatePreviewParams.SubscriptionDetails.Item( this.billingThresholds, this.clearUsage, + this.currentTrial, this.deleted, this.discounts, this.extraParams, @@ -14824,6 +14906,13 @@ public Builder setClearUsage(Boolean clearUsage) { return this; } + /** The trial offer to apply to this subscription item. */ + public Builder setCurrentTrial( + InvoiceCreatePreviewParams.SubscriptionDetails.Item.CurrentTrial currentTrial) { + this.currentTrial = currentTrial; + return this; + } + /** A flag that, if set to {@code true}, will delete the specified item. */ public Builder setDeleted(Boolean deleted) { this.deleted = deleted; @@ -15137,6 +15226,106 @@ public Builder setUsageGte(Long usageGte) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CurrentTrial { + /** + * 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; + + /** + * Unix timestamp representing the end of the trial offer period. Required when the trial + * offer has {@code duration.type=timestamp}. Cannot be specified when {@code + * duration.type=relative}. + */ + @SerializedName("trial_end") + Long trialEnd; + + /** + * Required. The ID of the trial offer to apply to the subscription item. + */ + @SerializedName("trial_offer") + String trialOffer; + + private CurrentTrial(Map extraParams, Long trialEnd, String trialOffer) { + this.extraParams = extraParams; + this.trialEnd = trialEnd; + this.trialOffer = trialOffer; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long trialEnd; + + private String trialOffer; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.SubscriptionDetails.Item.CurrentTrial build() { + return new InvoiceCreatePreviewParams.SubscriptionDetails.Item.CurrentTrial( + this.extraParams, this.trialEnd, this.trialOffer); + } + + /** + * 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 + * InvoiceCreatePreviewParams.SubscriptionDetails.Item.CurrentTrial#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 + * InvoiceCreatePreviewParams.SubscriptionDetails.Item.CurrentTrial#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Unix timestamp representing the end of the trial offer period. Required when the trial + * offer has {@code duration.type=timestamp}. Cannot be specified when {@code + * duration.type=relative}. + */ + public Builder setTrialEnd(Long trialEnd) { + this.trialEnd = trialEnd; + return this; + } + + /** + * Required. The ID of the trial offer to apply to the subscription item. + */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { diff --git a/src/main/java/com/stripe/param/InvoiceItemCreateParams.java b/src/main/java/com/stripe/param/InvoiceItemCreateParams.java index 69cbd571523..d297a75a88e 100644 --- a/src/main/java/com/stripe/param/InvoiceItemCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceItemCreateParams.java @@ -121,10 +121,21 @@ public class InvoiceItemCreateParams extends ApiRequestParams { @SerializedName("pricing") Pricing pricing; - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice + * item. + */ + @SerializedName("quantity_decimal") + BigDecimal quantityDecimal; + /** * The ID of a subscription to add this invoice item to. When left blank, the invoice item is * added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions @@ -182,6 +193,7 @@ private InvoiceItemCreateParams( PriceData priceData, Pricing pricing, Long quantity, + BigDecimal quantityDecimal, String subscription, TaxBehavior taxBehavior, Object taxCode, @@ -203,6 +215,7 @@ private InvoiceItemCreateParams( this.priceData = priceData; this.pricing = pricing; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.subscription = subscription; this.taxBehavior = taxBehavior; this.taxCode = taxCode; @@ -247,6 +260,8 @@ public static class Builder { private Long quantity; + private BigDecimal quantityDecimal; + private String subscription; private TaxBehavior taxBehavior; @@ -276,6 +291,7 @@ public InvoiceItemCreateParams build() { this.priceData, this.pricing, this.quantity, + this.quantityDecimal, this.subscription, this.taxBehavior, this.taxCode, @@ -548,12 +564,25 @@ public Builder setPricing(InvoiceItemCreateParams.Pricing pricing) { return this; } - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code + * quantity_decimal} instead to provide decimal precision. This field will be deprecated in + * favor of {@code quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice + * item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * The ID of a subscription to add this invoice item to. When left blank, the invoice item is * added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions diff --git a/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java b/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java index 8c0fc3f9030..5cc28374b49 100644 --- a/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java @@ -96,10 +96,20 @@ public class InvoiceItemUpdateParams extends ApiRequestParams { @SerializedName("pricing") Pricing pricing; - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + @SerializedName("quantity_decimal") + Object quantityDecimal; + /** * Only required if a default @@ -145,6 +155,7 @@ private InvoiceItemUpdateParams( PriceData priceData, Pricing pricing, Long quantity, + Object quantityDecimal, TaxBehavior taxBehavior, Object taxCode, Object taxRates, @@ -161,6 +172,7 @@ private InvoiceItemUpdateParams( this.priceData = priceData; this.pricing = pricing; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.taxBehavior = taxBehavior; this.taxCode = taxCode; this.taxRates = taxRates; @@ -196,6 +208,8 @@ public static class Builder { private Long quantity; + private Object quantityDecimal; + private TaxBehavior taxBehavior; private Object taxCode; @@ -219,6 +233,7 @@ public InvoiceItemUpdateParams build() { this.priceData, this.pricing, this.quantity, + this.quantityDecimal, this.taxBehavior, this.taxCode, this.taxRates, @@ -486,12 +501,32 @@ public Builder setPricing(InvoiceItemUpdateParams.Pricing pricing) { return this; } - /** Non-negative integer. The quantity of units for the invoice item. */ + /** + * Non-negative integer. The quantity of units for the invoice item. Use {@code + * quantity_decimal} instead to provide decimal precision. This field will be deprecated in + * favor of {@code quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + public Builder setQuantityDecimal(EmptyParam quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * Only required if a default diff --git a/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java b/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java index 300745cd970..7263b0a27c0 100644 --- a/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java @@ -69,11 +69,10 @@ public class InvoiceLineItemUpdateParams extends ApiRequestParams { * to an object. This can be useful for storing additional information about the object in a * structured format. Individual keys can be unset by posting an empty value to them. All keys can * be unset by posting an empty value to {@code metadata}. For type=subscription - * line items, the incoming metadata specified on the request is directly used to set this value, - * in contrast to type=invoiceitem line items, - * where any existing metadata on the invoice line is merged with the incoming data. + * href="https://stripe.com/api/invoices/line_item">type=subscription line items, the incoming + * metadata specified on the request is directly used to set this value, in contrast to type=invoiceitem line items, where any + * existing metadata on the invoice line is merged with the incoming data. */ @SerializedName("metadata") Object metadata; @@ -100,10 +99,20 @@ public class InvoiceLineItemUpdateParams extends ApiRequestParams { @SerializedName("pricing") Pricing pricing; - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + @SerializedName("quantity_decimal") + Object quantityDecimal; + /** * A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on * your own or use a third-party to calculate them. You cannot set tax amounts if any line item @@ -138,6 +147,7 @@ private InvoiceLineItemUpdateParams( PriceData priceData, Pricing pricing, Long quantity, + Object quantityDecimal, Object taxAmounts, Object taxRates) { this.amount = amount; @@ -152,6 +162,7 @@ private InvoiceLineItemUpdateParams( this.priceData = priceData; this.pricing = pricing; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.taxAmounts = taxAmounts; this.taxRates = taxRates; } @@ -185,6 +196,8 @@ public static class Builder { private Long quantity; + private Object quantityDecimal; + private Object taxAmounts; private Object taxRates; @@ -204,6 +217,7 @@ public InvoiceLineItemUpdateParams build() { this.priceData, this.pricing, this.quantity, + this.quantityDecimal, this.taxAmounts, this.taxRates); } @@ -423,11 +437,10 @@ public Builder putAllMetadata(Map map) { * to an object. This can be useful for storing additional information about the object in a * structured format. Individual keys can be unset by posting an empty value to them. All keys * can be unset by posting an empty value to {@code metadata}. For type=subscription - * line items, the incoming metadata specified on the request is directly used to set this - * value, in contrast to type=invoiceitem line items, - * where any existing metadata on the invoice line is merged with the incoming data. + * href="https://stripe.com/api/invoices/line_item">type=subscription line items, the + * incoming metadata specified on the request is directly used to set this value, in contrast to + * type=invoiceitem line items, where + * any existing metadata on the invoice line is merged with the incoming data. */ public Builder setMetadata(EmptyParam metadata) { this.metadata = metadata; @@ -439,11 +452,10 @@ public Builder setMetadata(EmptyParam metadata) { * to an object. This can be useful for storing additional information about the object in a * structured format. Individual keys can be unset by posting an empty value to them. All keys * can be unset by posting an empty value to {@code metadata}. For type=subscription - * line items, the incoming metadata specified on the request is directly used to set this - * value, in contrast to type=invoiceitem line items, - * where any existing metadata on the invoice line is merged with the incoming data. + * href="https://stripe.com/api/invoices/line_item">type=subscription line items, the + * incoming metadata specified on the request is directly used to set this value, in contrast to + * type=invoiceitem line items, where + * any existing metadata on the invoice line is merged with the incoming data. */ public Builder setMetadata(Map metadata) { this.metadata = metadata; @@ -478,12 +490,32 @@ public Builder setPricing(InvoiceLineItemUpdateParams.Pricing pricing) { return this; } - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + public Builder setQuantityDecimal(EmptyParam quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * Add an element to `taxAmounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link @@ -1322,6 +1354,13 @@ public static class ProductData { @SerializedName("tax_code") Object taxCode; + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + @SerializedName("tax_details") + TaxDetails taxDetails; + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -1336,6 +1375,7 @@ private ProductData( Map metadata, Object name, Object taxCode, + TaxDetails taxDetails, Object unitLabel) { this.description = description; this.extraParams = extraParams; @@ -1343,6 +1383,7 @@ private ProductData( this.metadata = metadata; this.name = name; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.unitLabel = unitLabel; } @@ -1363,6 +1404,8 @@ public static class Builder { private Object taxCode; + private TaxDetails taxDetails; + private Object unitLabel; /** Finalize and obtain parameter instance from this builder. */ @@ -1374,6 +1417,7 @@ public InvoiceLineItemUpdateParams.PriceData.ProductData build() { this.metadata, this.name, this.taxCode, + this.taxDetails, this.unitLabel); } @@ -1506,6 +1550,17 @@ public Builder setTaxCode(EmptyParam taxCode) { return this; } + /** + * Tax details for this product, including the tax code and an optional performance + * location. + */ + public Builder setTaxDetails( + InvoiceLineItemUpdateParams.PriceData.ProductData.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -1524,6 +1579,119 @@ public Builder setUnitLabel(EmptyParam unitLabel) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + Object performanceLocation; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + private TaxDetails( + Map extraParams, Object performanceLocation, Object taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object performanceLocation; + + private Object taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceLineItemUpdateParams.PriceData.ProductData.TaxDetails build() { + return new InvoiceLineItemUpdateParams.PriceData.ProductData.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * InvoiceLineItemUpdateParams.PriceData.ProductData.TaxDetails#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 + * InvoiceLineItemUpdateParams.PriceData.ProductData.TaxDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(EmptyParam performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(EmptyParam taxCode) { + this.taxCode = taxCode; + return this; + } + } + } } public enum TaxBehavior implements ApiRequestParams.EnumParam { diff --git a/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java b/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java index 32987413672..f2baf50bd6a 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java @@ -303,10 +303,20 @@ public static class Line { @SerializedName("pricing") Pricing pricing; - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ @SerializedName("quantity") Long quantity; + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. + */ + @SerializedName("quantity_decimal") + BigDecimal quantityDecimal; + /** * A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes * on your own or use a third-party to calculate them. You cannot set tax amounts if any line @@ -341,6 +351,7 @@ private Line( PriceData priceData, Pricing pricing, Long quantity, + BigDecimal quantityDecimal, Object taxAmounts, Object taxRates) { this.amount = amount; @@ -355,6 +366,7 @@ private Line( this.priceData = priceData; this.pricing = pricing; this.quantity = quantity; + this.quantityDecimal = quantityDecimal; this.taxAmounts = taxAmounts; this.taxRates = taxRates; } @@ -388,6 +400,8 @@ public static class Builder { private Long quantity; + private BigDecimal quantityDecimal; + private Object taxAmounts; private Object taxRates; @@ -407,6 +421,7 @@ public InvoiceUpdateLinesParams.Line build() { this.priceData, this.pricing, this.quantity, + this.quantityDecimal, this.taxAmounts, this.taxRates); } @@ -654,12 +669,25 @@ public Builder setPricing(InvoiceUpdateLinesParams.Line.Pricing pricing) { return this; } - /** Non-negative integer. The quantity of units for the line item. */ + /** + * Non-negative integer. The quantity of units for the line item. Use {@code quantity_decimal} + * instead to provide decimal precision. This field will be deprecated in favor of {@code + * quantity_decimal} in a future version. + */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; } + /** + * Non-negative decimal with at most 12 decimal places. The quantity of units for the line + * item. + */ + public Builder setQuantityDecimal(BigDecimal quantityDecimal) { + this.quantityDecimal = quantityDecimal; + return this; + } + /** * Add an element to `taxAmounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link @@ -1466,6 +1494,14 @@ public static class ProductData { @SerializedName("tax_code") String taxCode; + /** + * Tax details for this product, including the tax code and an optional performance + * location. + */ + @SerializedName("tax_details") + TaxDetails taxDetails; + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -1480,6 +1516,7 @@ private ProductData( Map metadata, String name, String taxCode, + TaxDetails taxDetails, String unitLabel) { this.description = description; this.extraParams = extraParams; @@ -1487,6 +1524,7 @@ private ProductData( this.metadata = metadata; this.name = name; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.unitLabel = unitLabel; } @@ -1507,6 +1545,8 @@ public static class Builder { private String taxCode; + private TaxDetails taxDetails; + private String unitLabel; /** Finalize and obtain parameter instance from this builder. */ @@ -1518,6 +1558,7 @@ public InvoiceUpdateLinesParams.Line.PriceData.ProductData build() { this.metadata, this.name, this.taxCode, + this.taxDetails, this.unitLabel); } @@ -1629,6 +1670,17 @@ public Builder setTaxCode(String taxCode) { return this; } + /** + * Tax details for this product, including the tax code and an optional performance + * location. + */ + public Builder setTaxDetails( + InvoiceUpdateLinesParams.Line.PriceData.ProductData.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -1638,6 +1690,109 @@ public Builder setUnitLabel(String unitLabel) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + private TaxDetails( + Map extraParams, String performanceLocation, Object taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String performanceLocation; + + private Object taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceUpdateLinesParams.Line.PriceData.ProductData.TaxDetails build() { + return new InvoiceUpdateLinesParams.Line.PriceData.ProductData.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * InvoiceUpdateLinesParams.Line.PriceData.ProductData.TaxDetails#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 + * InvoiceUpdateLinesParams.Line.PriceData.ProductData.TaxDetails#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(EmptyParam taxCode) { + this.taxCode = taxCode; + return this; + } + } + } } public enum TaxBehavior implements ApiRequestParams.EnumParam { diff --git a/src/main/java/com/stripe/param/InvoiceUpdateParams.java b/src/main/java/com/stripe/param/InvoiceUpdateParams.java index 49039bfc406..b76da51a272 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateParams.java @@ -3953,6 +3953,13 @@ public static class Pix { @SerializedName("amount_includes_iof") AmountIncludesIof amountIncludesIof; + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + /** * 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. @@ -3963,8 +3970,12 @@ public static class Pix { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Pix(AmountIncludesIof amountIncludesIof, Map extraParams) { + private Pix( + AmountIncludesIof amountIncludesIof, + Long expiresAfterSeconds, + Map extraParams) { this.amountIncludesIof = amountIncludesIof; + this.expiresAfterSeconds = expiresAfterSeconds; this.extraParams = extraParams; } @@ -3975,12 +3986,14 @@ public static Builder builder() { public static class Builder { private AmountIncludesIof amountIncludesIof; + private Long expiresAfterSeconds; + private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Pix build() { return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Pix( - this.amountIncludesIof, this.extraParams); + this.amountIncludesIof, this.expiresAfterSeconds, this.extraParams); } /** Determines if the amount includes the IOF tax. Defaults to {@code never}. */ @@ -3991,6 +4004,15 @@ public Builder setAmountIncludesIof( return this; } + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + public Builder setExpiresAfterSeconds(Long expiresAfterSeconds) { + this.expiresAfterSeconds = expiresAfterSeconds; + 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 diff --git a/src/main/java/com/stripe/param/OrderCreateParams.java b/src/main/java/com/stripe/param/OrderCreateParams.java index 61a3a43a8b4..f67bbe667e5 100644 --- a/src/main/java/com/stripe/param/OrderCreateParams.java +++ b/src/main/java/com/stripe/param/OrderCreateParams.java @@ -2666,7 +2666,7 @@ public static class AcssDebit { @SerializedName("target_date") String targetDate; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -2816,7 +2816,7 @@ public Builder setTargetDate(String targetDate) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( OrderCreateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { diff --git a/src/main/java/com/stripe/param/OrderUpdateParams.java b/src/main/java/com/stripe/param/OrderUpdateParams.java index 2d0a8c07d33..474779b0baf 100644 --- a/src/main/java/com/stripe/param/OrderUpdateParams.java +++ b/src/main/java/com/stripe/param/OrderUpdateParams.java @@ -3099,7 +3099,7 @@ public static class AcssDebit { @SerializedName("target_date") Object targetDate; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -3259,7 +3259,7 @@ public Builder setTargetDate(EmptyParam targetDate) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( OrderUpdateParams.Payment.Settings.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { diff --git a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java index d49a3b8f50d..608d54a5db1 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java @@ -426,6 +426,10 @@ public static class AmountDetails { @SerializedName("shipping") Object shipping; + /** Contains information about the surcharge portion of the amount. */ + @SerializedName("surcharge") + Object surcharge; + /** Contains information about the tax portion of the amount. */ @SerializedName("tax") Object tax; @@ -436,12 +440,14 @@ private AmountDetails( Map extraParams, Object lineItems, Object shipping, + Object surcharge, Object tax) { this.discountAmount = discountAmount; this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; + this.surcharge = surcharge; this.tax = tax; } @@ -460,6 +466,8 @@ public static class Builder { private Object shipping; + private Object surcharge; + private Object tax; /** Finalize and obtain parameter instance from this builder. */ @@ -470,6 +478,7 @@ public PaymentIntentCaptureParams.AmountDetails build() { this.extraParams, this.lineItems, this.shipping, + this.surcharge, this.tax); } @@ -603,6 +612,18 @@ public Builder setShipping(EmptyParam shipping) { return this; } + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge(PaymentIntentCaptureParams.AmountDetails.Surcharge surcharge) { + this.surcharge = surcharge; + return this; + } + + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge(EmptyParam surcharge) { + this.surcharge = surcharge; + return this; + } + /** Contains information about the tax portion of the amount. */ public Builder setTax(PaymentIntentCaptureParams.AmountDetails.Tax tax) { this.tax = tax; @@ -1653,6 +1674,126 @@ public Builder setToPostalCode(EmptyParam toPostalCode) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Surcharge { + /** Portion of the amount that corresponds to a surcharge. */ + @SerializedName("amount") + Object amount; + + /** Indicate whether to enforce validations on the surcharge amount. */ + @SerializedName("enforce_validation") + ApiRequestParams.EnumParam enforceValidation; + + /** + * 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 Surcharge( + Object amount, + ApiRequestParams.EnumParam enforceValidation, + Map extraParams) { + this.amount = amount; + this.enforceValidation = enforceValidation; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private ApiRequestParams.EnumParam enforceValidation; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.AmountDetails.Surcharge build() { + return new PaymentIntentCaptureParams.AmountDetails.Surcharge( + this.amount, this.enforceValidation, this.extraParams); + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation( + PaymentIntentCaptureParams.AmountDetails.Surcharge.EnforceValidation + enforceValidation) { + this.enforceValidation = enforceValidation; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation(EmptyParam enforceValidation) { + this.enforceValidation = enforceValidation; + 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 PaymentIntentCaptureParams.AmountDetails.Surcharge#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 PaymentIntentCaptureParams.AmountDetails.Surcharge#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 EnforceValidation implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + EnforceValidation(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Tax { @@ -2021,10 +2162,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -2316,10 +2453,6 @@ public Builder setLodgingData( * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -2333,10 +2466,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 9a25c045961..939ee1e3582 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -784,6 +784,10 @@ public static class AmountDetails { @SerializedName("shipping") Object shipping; + /** Contains information about the surcharge portion of the amount. */ + @SerializedName("surcharge") + Object surcharge; + /** Contains information about the tax portion of the amount. */ @SerializedName("tax") Object tax; @@ -794,12 +798,14 @@ private AmountDetails( Map extraParams, Object lineItems, Object shipping, + Object surcharge, Object tax) { this.discountAmount = discountAmount; this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; + this.surcharge = surcharge; this.tax = tax; } @@ -818,6 +824,8 @@ public static class Builder { private Object shipping; + private Object surcharge; + private Object tax; /** Finalize and obtain parameter instance from this builder. */ @@ -828,6 +836,7 @@ public PaymentIntentConfirmParams.AmountDetails build() { this.extraParams, this.lineItems, this.shipping, + this.surcharge, this.tax); } @@ -961,6 +970,18 @@ public Builder setShipping(EmptyParam shipping) { return this; } + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge(PaymentIntentConfirmParams.AmountDetails.Surcharge surcharge) { + this.surcharge = surcharge; + return this; + } + + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge(EmptyParam surcharge) { + this.surcharge = surcharge; + return this; + } + /** Contains information about the tax portion of the amount. */ public Builder setTax(PaymentIntentConfirmParams.AmountDetails.Tax tax) { this.tax = tax; @@ -2011,6 +2032,126 @@ public Builder setToPostalCode(EmptyParam toPostalCode) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Surcharge { + /** Portion of the amount that corresponds to a surcharge. */ + @SerializedName("amount") + Object amount; + + /** Indicate whether to enforce validations on the surcharge amount. */ + @SerializedName("enforce_validation") + ApiRequestParams.EnumParam enforceValidation; + + /** + * 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 Surcharge( + Object amount, + ApiRequestParams.EnumParam enforceValidation, + Map extraParams) { + this.amount = amount; + this.enforceValidation = enforceValidation; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private ApiRequestParams.EnumParam enforceValidation; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.AmountDetails.Surcharge build() { + return new PaymentIntentConfirmParams.AmountDetails.Surcharge( + this.amount, this.enforceValidation, this.extraParams); + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation( + PaymentIntentConfirmParams.AmountDetails.Surcharge.EnforceValidation + enforceValidation) { + this.enforceValidation = enforceValidation; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation(EmptyParam enforceValidation) { + this.enforceValidation = enforceValidation; + 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 PaymentIntentConfirmParams.AmountDetails.Surcharge#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 PaymentIntentConfirmParams.AmountDetails.Surcharge#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 EnforceValidation implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + EnforceValidation(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Tax { @@ -2752,10 +2893,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -3047,10 +3184,6 @@ public Builder setLodgingData( * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -3064,10 +3197,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -13739,6 +13868,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -13821,6 +13957,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -13884,6 +14021,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -14014,6 +14152,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -14083,6 +14223,7 @@ public PaymentIntentConfirmParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -14685,6 +14826,15 @@ public Builder setType(PaymentIntentConfirmParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(PaymentIntentConfirmParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -19129,19 +19279,9 @@ public static class StripeBalance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The source_type - * of the balance - */ - @SerializedName("source_type") - SourceType sourceType; - - private StripeBalance( - String account, Map extraParams, SourceType sourceType) { + private StripeBalance(String account, Map extraParams) { this.account = account; this.extraParams = extraParams; - this.sourceType = sourceType; } public static Builder builder() { @@ -19153,12 +19293,10 @@ public static class Builder { private Map extraParams; - private SourceType sourceType; - /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentConfirmParams.PaymentMethodData.StripeBalance build() { return new PaymentIntentConfirmParams.PaymentMethodData.StripeBalance( - this.account, this.extraParams, this.sourceType); + this.account, this.extraParams); } /** The connected account ID whose Stripe balance to use as the source of payment. */ @@ -19194,35 +19332,6 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } - - /** - * The source_type - * of the balance - */ - public Builder setSourceType( - PaymentIntentConfirmParams.PaymentMethodData.StripeBalance.SourceType sourceType) { - this.sourceType = sourceType; - return this; - } - } - - public enum SourceType implements ApiRequestParams.EnumParam { - @SerializedName("bank_account") - BANK_ACCOUNT("bank_account"), - - @SerializedName("card") - CARD("card"), - - @SerializedName("fpx") - FPX("fpx"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - SourceType(String value) { - this.value = value; - } } } @@ -19342,6 +19451,229 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodData.Upi build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * 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 PaymentIntentConfirmParams.PaymentMethodData.Upi#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 PaymentIntentConfirmParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions#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 + * PaymentIntentConfirmParams.PaymentMethodData.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -19804,6 +20136,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -20223,6 +20558,13 @@ public static class PaymentMethodOptions { @SerializedName("twint") Object twint; + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Object upi; + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about the * US bank account payment method options. @@ -20302,6 +20644,7 @@ private PaymentMethodOptions( Object stripeBalance, Object swish, Object twint, + Object upi, Object usBankAccount, Object wechatPay, Object zip) { @@ -20362,6 +20705,7 @@ private PaymentMethodOptions( this.stripeBalance = stripeBalance; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -20486,6 +20830,8 @@ public static class Builder { private Object twint; + private Object upi; + private Object usBankAccount; private Object wechatPay; @@ -20552,6 +20898,7 @@ public PaymentIntentConfirmParams.PaymentMethodOptions build() { this.stripeBalance, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -21610,6 +21957,24 @@ public Builder setTwint(EmptyParam twint) { return this; } + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(PaymentIntentConfirmParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(EmptyParam upi) { + this.upi = upi; + return this; + } + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about * the US bank account payment method options. @@ -21717,7 +22082,7 @@ public static class AcssDebit { @SerializedName("target_date") String targetDate; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -21865,7 +22230,7 @@ public Builder setTargetDate(String targetDate) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentConfirmParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -25114,7 +25479,10 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -25249,7 +25617,10 @@ public PaymentIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions build this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -40122,7 +40493,7 @@ public static class MandateOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ @SerializedName("payment_schedule") PaymentSchedule paymentSchedule; @@ -40272,7 +40643,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ public Builder setPaymentSchedule( PaymentIntentConfirmParams.PaymentMethodOptions.Pix.MandateOptions.PaymentSchedule paymentSchedule) { @@ -42252,6 +42623,267 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodOptions.Upi build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * 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 PaymentIntentConfirmParams.PaymentMethodOptions.Upi#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 PaymentIntentConfirmParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions#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 + * PaymentIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -42276,10 +42908,6 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Preferred transaction settlement speed. */ - @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -42318,7 +42946,7 @@ public static class UsBankAccount { @SerializedName("transaction_purpose") ApiRequestParams.EnumParam transactionPurpose; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -42327,7 +42955,6 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, String targetDate, ApiRequestParams.EnumParam transactionPurpose, @@ -42336,7 +42963,6 @@ private UsBankAccount( this.financialConnections = financialConnections; this.mandateOptions = mandateOptions; this.networks = networks; - this.preferredSettlementSpeed = preferredSettlementSpeed; this.setupFutureUsage = setupFutureUsage; this.targetDate = targetDate; this.transactionPurpose = transactionPurpose; @@ -42356,8 +42982,6 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; - private ApiRequestParams.EnumParam setupFutureUsage; private String targetDate; @@ -42373,7 +42997,6 @@ public PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount build() { this.financialConnections, this.mandateOptions, this.networks, - this.preferredSettlementSpeed, this.setupFutureUsage, this.targetDate, this.transactionPurpose, @@ -42433,20 +43056,6 @@ public Builder setNetworks( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed( - PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.PreferredSettlementSpeed - preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. @@ -42531,7 +43140,7 @@ public Builder setTransactionPurpose(EmptyParam transactionPurpose) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { @@ -43292,21 +43901,6 @@ public enum Requested implements ApiRequestParams.EnumParam { } } - public enum PreferredSettlementSpeed implements ApiRequestParams.EnumParam { - @SerializedName("fastest") - FASTEST("fastest"), - - @SerializedName("standard") - STANDARD("standard"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - PreferredSettlementSpeed(String value) { - this.value = value; - } - } - public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), @@ -44233,6 +44827,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 5df7d757d92..556cc99bb34 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -1170,6 +1170,10 @@ public static class AmountDetails { @SerializedName("shipping") Object shipping; + /** Contains information about the surcharge portion of the amount. */ + @SerializedName("surcharge") + Object surcharge; + /** Contains information about the tax portion of the amount. */ @SerializedName("tax") Object tax; @@ -1180,12 +1184,14 @@ private AmountDetails( Map extraParams, Object lineItems, Object shipping, + Object surcharge, Object tax) { this.discountAmount = discountAmount; this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; + this.surcharge = surcharge; this.tax = tax; } @@ -1204,6 +1210,8 @@ public static class Builder { private Object shipping; + private Object surcharge; + private Object tax; /** Finalize and obtain parameter instance from this builder. */ @@ -1214,6 +1222,7 @@ public PaymentIntentCreateParams.AmountDetails build() { this.extraParams, this.lineItems, this.shipping, + this.surcharge, this.tax); } @@ -1347,6 +1356,18 @@ public Builder setShipping(EmptyParam shipping) { return this; } + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge(PaymentIntentCreateParams.AmountDetails.Surcharge surcharge) { + this.surcharge = surcharge; + return this; + } + + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge(EmptyParam surcharge) { + this.surcharge = surcharge; + return this; + } + /** Contains information about the tax portion of the amount. */ public Builder setTax(PaymentIntentCreateParams.AmountDetails.Tax tax) { this.tax = tax; @@ -2394,6 +2415,125 @@ public Builder setToPostalCode(EmptyParam toPostalCode) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Surcharge { + /** Portion of the amount that corresponds to a surcharge. */ + @SerializedName("amount") + Object amount; + + /** Indicate whether to enforce validations on the surcharge amount. */ + @SerializedName("enforce_validation") + ApiRequestParams.EnumParam enforceValidation; + + /** + * 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 Surcharge( + Object amount, + ApiRequestParams.EnumParam enforceValidation, + Map extraParams) { + this.amount = amount; + this.enforceValidation = enforceValidation; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private ApiRequestParams.EnumParam enforceValidation; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.AmountDetails.Surcharge build() { + return new PaymentIntentCreateParams.AmountDetails.Surcharge( + this.amount, this.enforceValidation, this.extraParams); + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation( + PaymentIntentCreateParams.AmountDetails.Surcharge.EnforceValidation enforceValidation) { + this.enforceValidation = enforceValidation; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation(EmptyParam enforceValidation) { + this.enforceValidation = enforceValidation; + 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 PaymentIntentCreateParams.AmountDetails.Surcharge#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 PaymentIntentCreateParams.AmountDetails.Surcharge#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 EnforceValidation implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + EnforceValidation(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Tax { @@ -3268,10 +3408,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -3563,10 +3699,6 @@ public Builder setLodgingData( * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -3580,10 +3712,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -14236,6 +14364,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -14318,6 +14453,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -14381,6 +14517,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -14511,6 +14648,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -14580,6 +14719,7 @@ public PaymentIntentCreateParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -15174,6 +15314,15 @@ public Builder setType(PaymentIntentCreateParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(PaymentIntentCreateParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -19612,19 +19761,9 @@ public static class StripeBalance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The source_type - * of the balance - */ - @SerializedName("source_type") - SourceType sourceType; - - private StripeBalance( - String account, Map extraParams, SourceType sourceType) { + private StripeBalance(String account, Map extraParams) { this.account = account; this.extraParams = extraParams; - this.sourceType = sourceType; } public static Builder builder() { @@ -19636,12 +19775,10 @@ public static class Builder { private Map extraParams; - private SourceType sourceType; - /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCreateParams.PaymentMethodData.StripeBalance build() { return new PaymentIntentCreateParams.PaymentMethodData.StripeBalance( - this.account, this.extraParams, this.sourceType); + this.account, this.extraParams); } /** The connected account ID whose Stripe balance to use as the source of payment. */ @@ -19677,35 +19814,6 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } - - /** - * The source_type - * of the balance - */ - public Builder setSourceType( - PaymentIntentCreateParams.PaymentMethodData.StripeBalance.SourceType sourceType) { - this.sourceType = sourceType; - return this; - } - } - - public enum SourceType implements ApiRequestParams.EnumParam { - @SerializedName("bank_account") - BANK_ACCOUNT("bank_account"), - - @SerializedName("card") - CARD("card"), - - @SerializedName("fpx") - FPX("fpx"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - SourceType(String value) { - this.value = value; - } } } @@ -19825,6 +19933,229 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodData.Upi build() { + return new PaymentIntentCreateParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * 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 PaymentIntentCreateParams.PaymentMethodData.Upi#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 PaymentIntentCreateParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions build() { + return new PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions#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 + * PaymentIntentCreateParams.PaymentMethodData.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -20287,6 +20618,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -20706,6 +21040,13 @@ public static class PaymentMethodOptions { @SerializedName("twint") Object twint; + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Object upi; + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about the * US bank account payment method options. @@ -20785,6 +21126,7 @@ private PaymentMethodOptions( Object stripeBalance, Object swish, Object twint, + Object upi, Object usBankAccount, Object wechatPay, Object zip) { @@ -20845,6 +21187,7 @@ private PaymentMethodOptions( this.stripeBalance = stripeBalance; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -20969,6 +21312,8 @@ public static class Builder { private Object twint; + private Object upi; + private Object usBankAccount; private Object wechatPay; @@ -21035,6 +21380,7 @@ public PaymentIntentCreateParams.PaymentMethodOptions build() { this.stripeBalance, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -22089,6 +22435,24 @@ public Builder setTwint(EmptyParam twint) { return this; } + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(PaymentIntentCreateParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(EmptyParam upi) { + this.upi = upi; + return this; + } + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about * the US bank account payment method options. @@ -22196,7 +22560,7 @@ public static class AcssDebit { @SerializedName("target_date") String targetDate; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -22344,7 +22708,7 @@ public Builder setTargetDate(String targetDate) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentCreateParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -25590,7 +25954,10 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -25725,7 +26092,10 @@ public PaymentIntentCreateParams.PaymentMethodOptions.Card.MandateOptions build( this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -40587,7 +40957,7 @@ public static class MandateOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ @SerializedName("payment_schedule") PaymentSchedule paymentSchedule; @@ -40737,7 +41107,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ public Builder setPaymentSchedule( PaymentIntentCreateParams.PaymentMethodOptions.Pix.MandateOptions.PaymentSchedule paymentSchedule) { @@ -42712,6 +43082,267 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodOptions.Upi build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * 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 PaymentIntentCreateParams.PaymentMethodOptions.Upi#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 PaymentIntentCreateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions#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 + * PaymentIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -42736,10 +43367,6 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Preferred transaction settlement speed. */ - @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -42778,7 +43405,7 @@ public static class UsBankAccount { @SerializedName("transaction_purpose") ApiRequestParams.EnumParam transactionPurpose; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -42787,7 +43414,6 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, String targetDate, ApiRequestParams.EnumParam transactionPurpose, @@ -42796,7 +43422,6 @@ private UsBankAccount( this.financialConnections = financialConnections; this.mandateOptions = mandateOptions; this.networks = networks; - this.preferredSettlementSpeed = preferredSettlementSpeed; this.setupFutureUsage = setupFutureUsage; this.targetDate = targetDate; this.transactionPurpose = transactionPurpose; @@ -42816,8 +43441,6 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; - private ApiRequestParams.EnumParam setupFutureUsage; private String targetDate; @@ -42833,7 +43456,6 @@ public PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount build() { this.financialConnections, this.mandateOptions, this.networks, - this.preferredSettlementSpeed, this.setupFutureUsage, this.targetDate, this.transactionPurpose, @@ -42891,20 +43513,6 @@ public Builder setNetworks( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed( - PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.PreferredSettlementSpeed - preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. @@ -42989,7 +43597,7 @@ public Builder setTransactionPurpose(EmptyParam transactionPurpose) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { @@ -43750,21 +44358,6 @@ public enum Requested implements ApiRequestParams.EnumParam { } } - public enum PreferredSettlementSpeed implements ApiRequestParams.EnumParam { - @SerializedName("fastest") - FASTEST("fastest"), - - @SerializedName("standard") - STANDARD("standard"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - PreferredSettlementSpeed(String value) { - this.value = value; - } - } - public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), @@ -44814,6 +45407,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentIntentDecrementAuthorizationParams.java b/src/main/java/com/stripe/param/PaymentIntentDecrementAuthorizationParams.java index 5402ed3cc42..5338c99cebe 100644 --- a/src/main/java/com/stripe/param/PaymentIntentDecrementAuthorizationParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentDecrementAuthorizationParams.java @@ -22,6 +22,10 @@ public class PaymentIntentDecrementAuthorizationParams extends ApiRequestParams @SerializedName("amount") Long amount; + /** Provides industry-specific information about the amount. */ + @SerializedName("amount_details") + AmountDetails amountDetails; + /** * The amount of the application fee (if any) that will be requested to be applied to the payment * and transferred to the application owner's Stripe account. The amount of the application fee @@ -62,6 +66,10 @@ public class PaymentIntentDecrementAuthorizationParams extends ApiRequestParams @SerializedName("metadata") Map metadata; + /** Provides industry-specific information about the charge. */ + @SerializedName("payment_details") + PaymentDetails paymentDetails; + /** * The parameters used to automatically create a transfer after the payment is captured. Learn * more about the use case for @@ -72,20 +80,24 @@ public class PaymentIntentDecrementAuthorizationParams extends ApiRequestParams private PaymentIntentDecrementAuthorizationParams( Long amount, + AmountDetails amountDetails, Long applicationFeeAmount, String description, List expand, Map extraParams, Hooks hooks, Map metadata, + PaymentDetails paymentDetails, TransferData transferData) { this.amount = amount; + this.amountDetails = amountDetails; this.applicationFeeAmount = applicationFeeAmount; this.description = description; this.expand = expand; this.extraParams = extraParams; this.hooks = hooks; this.metadata = metadata; + this.paymentDetails = paymentDetails; this.transferData = transferData; } @@ -96,6 +108,8 @@ public static Builder builder() { public static class Builder { private Long amount; + private AmountDetails amountDetails; + private Long applicationFeeAmount; private String description; @@ -108,18 +122,22 @@ public static class Builder { private Map metadata; + private PaymentDetails paymentDetails; + private TransferData transferData; /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentDecrementAuthorizationParams build() { return new PaymentIntentDecrementAuthorizationParams( this.amount, + this.amountDetails, this.applicationFeeAmount, this.description, this.expand, this.extraParams, this.hooks, this.metadata, + this.paymentDetails, this.transferData); } @@ -133,6 +151,13 @@ public Builder setAmount(Long amount) { return this; } + /** Provides industry-specific information about the amount. */ + public Builder setAmountDetails( + PaymentIntentDecrementAuthorizationParams.AmountDetails amountDetails) { + this.amountDetails = amountDetails; + return this; + } + /** * The amount of the application fee (if any) that will be requested to be applied to the * payment and transferred to the application owner's Stripe account. The amount of the @@ -236,6 +261,13 @@ public Builder putAllMetadata(Map map) { return this; } + /** Provides industry-specific information about the charge. */ + public Builder setPaymentDetails( + PaymentIntentDecrementAuthorizationParams.PaymentDetails paymentDetails) { + this.paymentDetails = paymentDetails; + return this; + } + /** * The parameters used to automatically create a transfer after the payment is captured. Learn * more about the use case for @@ -250,7 +282,33 @@ public Builder setTransferData( @Getter @EqualsAndHashCode(callSuper = false) - public static class Hooks { + public static class AmountDetails { + /** + * The total discount applied on the transaction represented in the smallest currency unit. An integer + * greater than 0. + * + *

This field is mutually exclusive with the {@code + * amount_details[line_items][#][discount_amount]} field. + */ + @SerializedName("discount_amount") + Object discountAmount; + + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic errors + * in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data to card networks if there's an + * arithmetic validation error. + */ + @SerializedName("enforce_arithmetic_validation") + Boolean enforceArithmeticValidation; + /** * 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 @@ -260,13 +318,40 @@ public static class Hooks { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Arguments passed in automations. */ - @SerializedName("inputs") - Inputs inputs; - - private Hooks(Map extraParams, Inputs inputs) { + /** + * A list of line items, each containing information about a product in the PaymentIntent. There + * is a maximum of 200 line items. + */ + @SerializedName("line_items") + Object lineItems; + + /** Contains information about the shipping portion of the amount. */ + @SerializedName("shipping") + Object shipping; + + /** Contains information about the surcharge portion of the amount. */ + @SerializedName("surcharge") + Object surcharge; + + /** Contains information about the tax portion of the amount. */ + @SerializedName("tax") + Object tax; + + private AmountDetails( + Object discountAmount, + Boolean enforceArithmeticValidation, + Map extraParams, + Object lineItems, + Object shipping, + Object surcharge, + Object tax) { + this.discountAmount = discountAmount; + this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; - this.inputs = inputs; + this.lineItems = lineItems; + this.shipping = shipping; + this.surcharge = surcharge; + this.tax = tax; } public static Builder builder() { @@ -274,19 +359,80 @@ public static Builder builder() { } public static class Builder { + private Object discountAmount; + + private Boolean enforceArithmeticValidation; + private Map extraParams; - private Inputs inputs; + private Object lineItems; + + private Object shipping; + + private Object surcharge; + + private Object tax; /** Finalize and obtain parameter instance from this builder. */ - public PaymentIntentDecrementAuthorizationParams.Hooks build() { - return new PaymentIntentDecrementAuthorizationParams.Hooks(this.extraParams, this.inputs); + public PaymentIntentDecrementAuthorizationParams.AmountDetails build() { + return new PaymentIntentDecrementAuthorizationParams.AmountDetails( + this.discountAmount, + this.enforceArithmeticValidation, + this.extraParams, + this.lineItems, + this.shipping, + this.surcharge, + this.tax); + } + + /** + * The total discount applied on the transaction represented in the smallest currency unit. An + * integer greater than 0. + * + *

This field is mutually exclusive with the {@code + * amount_details[line_items][#][discount_amount]} field. + */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * The total discount applied on the transaction represented in the smallest currency unit. An + * integer greater than 0. + * + *

This field is mutually exclusive with the {@code + * amount_details[line_items][#][discount_amount]} field. + */ + public Builder setDiscountAmount(EmptyParam discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic + * errors in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data to card networks if there's an + * arithmetic validation error. + */ + public Builder setEnforceArithmeticValidation(Boolean enforceArithmeticValidation) { + this.enforceArithmeticValidation = enforceArithmeticValidation; + 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 - * PaymentIntentDecrementAuthorizationParams.Hooks#extraParams} for the field documentation. + * PaymentIntentDecrementAuthorizationParams.AmountDetails#extraParams} for the field + * documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -299,8 +445,8 @@ public Builder putExtraParam(String key, Object value) { /** * 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 PaymentIntentDecrementAuthorizationParams.Hooks#extraParams} for the field - * documentation. + * See {@link PaymentIntentDecrementAuthorizationParams.AmountDetails#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -310,16 +456,113 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Arguments passed in automations. */ - public Builder setInputs(PaymentIntentDecrementAuthorizationParams.Hooks.Inputs inputs) { - this.inputs = inputs; + /** + * Add an element to `lineItems` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentDecrementAuthorizationParams.AmountDetails#lineItems} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addLineItem( + PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem element) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = + new ArrayList(); + } + ((List) this.lineItems) + .add(element); + return this; + } + + /** + * Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentDecrementAuthorizationParams.AmountDetails#lineItems} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllLineItem( + List elements) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = + new ArrayList(); + } + ((List) this.lineItems) + .addAll(elements); + return this; + } + + /** + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 200 line items. + */ + public Builder setLineItems(EmptyParam lineItems) { + this.lineItems = lineItems; + return this; + } + + /** + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 200 line items. + */ + public Builder setLineItems( + List lineItems) { + this.lineItems = lineItems; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping( + PaymentIntentDecrementAuthorizationParams.AmountDetails.Shipping shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping(EmptyParam shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge( + PaymentIntentDecrementAuthorizationParams.AmountDetails.Surcharge surcharge) { + this.surcharge = surcharge; + return this; + } + + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge(EmptyParam surcharge) { + this.surcharge = surcharge; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(PaymentIntentDecrementAuthorizationParams.AmountDetails.Tax tax) { + this.tax = tax; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(EmptyParam tax) { + this.tax = tax; return this; } } @Getter @EqualsAndHashCode(callSuper = false) - public static class Inputs { + public static class LineItem { + /** + * The discount applied on this line item represented in the smallest currency unit. An + * integer greater than 0. + * + *

This field is mutually exclusive with the {@code amount_details[discount_amount]} field. + */ + @SerializedName("discount_amount") + Long discountAmount; + /** * 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. @@ -329,13 +572,69 @@ public static class Inputs { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Tax arguments for automations. */ + /** Payment method-specific information for line items. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + + /** + * The product code of the line item, such as an SKU. Required for L3 rates. At most 12 + * characters long. + */ + @SerializedName("product_code") + String productCode; + + /** + * Required. The product name of the line item. Required for L3 rates. At + * most 1024 characters long. + * + *

For Cards, this field is truncated to 26 alphanumeric characters before being sent to + * the card networks. For PayPal, this field is truncated to 127 characters. + */ + @SerializedName("product_name") + String productName; + + /** + * Required. The quantity of items. Required for L3 rates. An integer greater + * than 0. + */ + @SerializedName("quantity") + Long quantity; + + /** Contains information about the tax on the item. */ @SerializedName("tax") Tax tax; - private Inputs(Map extraParams, Tax tax) { + /** + * Required. The unit cost of the line item represented in the smallest currency unit. Required + * for L3 rates. An integer greater than or equal to 0. + */ + @SerializedName("unit_cost") + Long unitCost; + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + @SerializedName("unit_of_measure") + String unitOfMeasure; + + private LineItem( + Long discountAmount, + Map extraParams, + PaymentMethodOptions paymentMethodOptions, + String productCode, + String productName, + Long quantity, + Tax tax, + Long unitCost, + String unitOfMeasure) { + this.discountAmount = discountAmount; this.extraParams = extraParams; + this.paymentMethodOptions = paymentMethodOptions; + this.productCode = productCode; + this.productName = productName; + this.quantity = quantity; this.tax = tax; + this.unitCost = unitCost; + this.unitOfMeasure = unitOfMeasure; } public static Builder builder() { @@ -343,21 +642,57 @@ public static Builder builder() { } public static class Builder { + private Long discountAmount; + private Map extraParams; + private PaymentMethodOptions paymentMethodOptions; + + private String productCode; + + private String productName; + + private Long quantity; + private Tax tax; + private Long unitCost; + + private String unitOfMeasure; + /** Finalize and obtain parameter instance from this builder. */ - public PaymentIntentDecrementAuthorizationParams.Hooks.Inputs build() { - return new PaymentIntentDecrementAuthorizationParams.Hooks.Inputs( - this.extraParams, this.tax); + public PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem build() { + return new PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem( + this.discountAmount, + this.extraParams, + this.paymentMethodOptions, + this.productCode, + this.productName, + this.quantity, + this.tax, + this.unitCost, + this.unitOfMeasure); + } + + /** + * The discount applied on this line item represented in the smallest currency unit. An + * integer greater than 0. + * + *

This field is mutually exclusive with the {@code amount_details[discount_amount]} + * field. + */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + 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 PaymentIntentDecrementAuthorizationParams.Hooks.Inputs#extraParams} for - * the field documentation. + * map. See {@link + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -370,8 +705,9 @@ public Builder putExtraParam(String key, Object value) { /** * 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 PaymentIntentDecrementAuthorizationParams.Hooks.Inputs#extraParams} for - * the field documentation. + * map. See {@link + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -381,22 +717,84 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Tax arguments for automations. */ - public Builder setTax(PaymentIntentDecrementAuthorizationParams.Hooks.Inputs.Tax tax) { + /** Payment method-specific information for line items. */ + public Builder setPaymentMethodOptions( + PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions + paymentMethodOptions) { + this.paymentMethodOptions = paymentMethodOptions; + return this; + } + + /** + * The product code of the line item, such as an SKU. Required for L3 rates. At most 12 + * characters long. + */ + public Builder setProductCode(String productCode) { + this.productCode = productCode; + return this; + } + + /** + * Required. The product name of the line item. Required for L3 rates. At + * most 1024 characters long. + * + *

For Cards, this field is truncated to 26 alphanumeric characters before being sent to + * the card networks. For PayPal, this field is truncated to 127 characters. + */ + public Builder setProductName(String productName) { + this.productName = productName; + return this; + } + + /** + * Required. The quantity of items. Required for L3 rates. An integer + * greater than 0. + */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** Contains information about the tax on the item. */ + public Builder setTax( + PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.Tax tax) { this.tax = tax; return this; } + + /** + * Required. The unit cost of the line item represented in the smallest currency unit. + * Required for L3 rates. An integer greater than or equal to 0. + */ + public Builder setUnitCost(Long unitCost) { + this.unitCost = unitCost; + return this; + } + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + public Builder setUnitOfMeasure(String unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + return this; + } } @Getter @EqualsAndHashCode(callSuper = false) - public static class Tax { + public static class PaymentMethodOptions { /** - * Required. The TaxCalculation id + * This sub-hash contains line item details that are specific to the {@code card} payment + * method. */ - @SerializedName("calculation") - Object calculation; + @SerializedName("card") + Card card; + + /** + * This sub-hash contains line item details that are specific to the {@code card_present} + * payment method. + */ + @SerializedName("card_present") + CardPresent cardPresent; /** * Map of extra parameters for custom features not available in this client library. The @@ -408,9 +806,31 @@ public static class Tax { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Tax(Object calculation, Map extraParams) { - this.calculation = calculation; + /** + * This sub-hash contains line item details that are specific to the {@code klarna} payment + * method. + */ + @SerializedName("klarna") + Klarna klarna; + + /** + * This sub-hash contains line item details that are specific to the {@code paypal} payment + * method. + */ + @SerializedName("paypal") + Paypal paypal; + + private PaymentMethodOptions( + Card card, + CardPresent cardPresent, + Map extraParams, + Klarna klarna, + Paypal paypal) { + this.card = card; + this.cardPresent = cardPresent; this.extraParams = extraParams; + this.klarna = klarna; + this.paypal = paypal; } public static Builder builder() { @@ -418,38 +838,54 @@ public static Builder builder() { } public static class Builder { - private Object calculation; + private Card card; + + private CardPresent cardPresent; private Map extraParams; + private Klarna klarna; + + private Paypal paypal; + /** Finalize and obtain parameter instance from this builder. */ - public PaymentIntentDecrementAuthorizationParams.Hooks.Inputs.Tax build() { - return new PaymentIntentDecrementAuthorizationParams.Hooks.Inputs.Tax( - this.calculation, this.extraParams); + public PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions + build() { + return new PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions( + this.card, this.cardPresent, this.extraParams, this.klarna, this.paypal); } /** - * Required. The TaxCalculation id + * This sub-hash contains line item details that are specific to the {@code card} payment + * method. */ - public Builder setCalculation(String calculation) { - this.calculation = calculation; + public Builder setCard( + PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions + .Card + card) { + this.card = card; return this; } /** - * Required. The TaxCalculation id + * This sub-hash contains line item details that are specific to the {@code card_present} + * payment method. */ - public Builder setCalculation(EmptyParam calculation) { - this.calculation = calculation; + public Builder setCardPresent( + PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions + .CardPresent + cardPresent) { + this.cardPresent = cardPresent; 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 PaymentIntentDecrementAuthorizationParams.Hooks.Inputs.Tax#extraParams} + * map. See {@link + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -463,7 +899,8 @@ public Builder putExtraParam(String key, Object value) { /** * 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 PaymentIntentDecrementAuthorizationParams.Hooks.Inputs.Tax#extraParams} + * map. See {@link + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -473,7 +910,1271 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** + * This sub-hash contains line item details that are specific to the {@code klarna} + * payment method. + */ + public Builder setKlarna( + PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions + .Klarna + klarna) { + this.klarna = klarna; + return this; + } + + /** + * This sub-hash contains line item details that are specific to the {@code paypal} + * payment method. + */ + public Builder setPaypal( + PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions + .Paypal + paypal) { + this.paypal = paypal; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, and so on. + */ + @SerializedName("commodity_code") + String commodityCode; + + /** + * 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 Card(String commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Card + build() { + return new PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Card(this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, and so on. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + 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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Card#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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Card#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CardPresent { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, and so on. + */ + @SerializedName("commodity_code") + String commodityCode; + + /** + * 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 CardPresent(String commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.CardPresent + build() { + return new PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.CardPresent(this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, and so on. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + 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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Klarna { + /** + * 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; + + /** URL to an image for the product. Max length, 4096 characters. */ + @SerializedName("image_url") + String imageUrl; + + /** URL to the product page. Max length, 4096 characters. */ + @SerializedName("product_url") + String productUrl; + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + @SerializedName("reference") + String reference; + + /** Reference for the subscription this line item is for. */ + @SerializedName("subscription_reference") + String subscriptionReference; + + private Klarna( + Map extraParams, + String imageUrl, + String productUrl, + String reference, + String subscriptionReference) { + this.extraParams = extraParams; + this.imageUrl = imageUrl; + this.productUrl = productUrl; + this.reference = reference; + this.subscriptionReference = subscriptionReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String imageUrl; + + private String productUrl; + + private String reference; + + private String subscriptionReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Klarna + build() { + return new PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Klarna( + this.extraParams, + this.imageUrl, + this.productUrl, + this.reference, + this.subscriptionReference); + } + + /** + * 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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** URL to an image for the product. Max length, 4096 characters. */ + public Builder setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** URL to the product page. Max length, 4096 characters. */ + public Builder setProductUrl(String productUrl) { + this.productUrl = productUrl; + return this; + } + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + + /** Reference for the subscription this line item is for. */ + public Builder setSubscriptionReference(String subscriptionReference) { + this.subscriptionReference = subscriptionReference; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Paypal { + /** Type of the line item. */ + @SerializedName("category") + Category category; + + /** Description of the line item. */ + @SerializedName("description") + String description; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The Stripe account ID of the connected account that sells the item. */ + @SerializedName("sold_by") + String soldBy; + + private Paypal( + Category category, + String description, + Map extraParams, + String soldBy) { + this.category = category; + this.description = description; + this.extraParams = extraParams; + this.soldBy = soldBy; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Category category; + + private String description; + + private Map extraParams; + + private String soldBy; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Paypal + build() { + return new PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Paypal( + this.category, this.description, this.extraParams, this.soldBy); + } + + /** Type of the line item. */ + public Builder setCategory( + PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Paypal.Category + category) { + this.category = category; + return this; + } + + /** Description of the line item. */ + public Builder setDescription(String description) { + this.description = description; + 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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The Stripe account ID of the connected account that sells the item. */ + public Builder setSoldBy(String soldBy) { + this.soldBy = soldBy; + return this; + } + } + + public enum Category implements ApiRequestParams.EnumParam { + @SerializedName("digital_goods") + DIGITAL_GOODS("digital_goods"), + + @SerializedName("donation") + DONATION("donation"), + + @SerializedName("physical_goods") + PHYSICAL_GOODS("physical_goods"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Category(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * 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 total amount of tax on a single line item represented in + * the smallest currency unit. + * Required for L3 rates. An integer greater than or equal to 0. + * + *

This field is mutually exclusive with the {@code + * amount_details[tax][total_tax_amount]} field. + */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.Tax build() { + return new PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * 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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.Tax#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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.LineItem.Tax#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 total amount of tax on a single line item represented in + * the smallest currency + * unit. Required for L3 rates. An integer greater than or equal to 0. + * + *

This field is mutually exclusive with the {@code + * amount_details[tax][total_tax_amount]} field. + */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Shipping { + /** + * If a physical good is being shipped, the cost of shipping represented in the smallest currency unit. An + * integer greater than or equal to 0. + */ + @SerializedName("amount") + Object amount; + + /** + * 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; + + /** + * If a physical good is being shipped, the postal code of where it is being shipped from. At + * most 10 alphanumeric characters long, hyphens are allowed. + */ + @SerializedName("from_postal_code") + Object fromPostalCode; + + /** + * If a physical good is being shipped, the postal code of where it is being shipped to. At + * most 10 alphanumeric characters long, hyphens are allowed. + */ + @SerializedName("to_postal_code") + Object toPostalCode; + + private Shipping( + Object amount, + Map extraParams, + Object fromPostalCode, + Object toPostalCode) { + this.amount = amount; + this.extraParams = extraParams; + this.fromPostalCode = fromPostalCode; + this.toPostalCode = toPostalCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private Map extraParams; + + private Object fromPostalCode; + + private Object toPostalCode; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.AmountDetails.Shipping build() { + return new PaymentIntentDecrementAuthorizationParams.AmountDetails.Shipping( + this.amount, this.extraParams, this.fromPostalCode, this.toPostalCode); + } + + /** + * If a physical good is being shipped, the cost of shipping represented in the smallest currency unit. An + * integer greater than or equal to 0. + */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * If a physical good is being shipped, the cost of shipping represented in the smallest currency unit. An + * integer greater than or equal to 0. + */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + 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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.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; + } + + /** + * If a physical good is being shipped, the postal code of where it is being shipped from. + * At most 10 alphanumeric characters long, hyphens are allowed. + */ + public Builder setFromPostalCode(String fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** + * If a physical good is being shipped, the postal code of where it is being shipped from. + * At most 10 alphanumeric characters long, hyphens are allowed. + */ + public Builder setFromPostalCode(EmptyParam fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** + * If a physical good is being shipped, the postal code of where it is being shipped to. At + * most 10 alphanumeric characters long, hyphens are allowed. + */ + public Builder setToPostalCode(String toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + + /** + * If a physical good is being shipped, the postal code of where it is being shipped to. At + * most 10 alphanumeric characters long, hyphens are allowed. + */ + public Builder setToPostalCode(EmptyParam toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Surcharge { + /** Portion of the amount that corresponds to a surcharge. */ + @SerializedName("amount") + Object amount; + + /** Indicate whether to enforce validations on the surcharge amount. */ + @SerializedName("enforce_validation") + ApiRequestParams.EnumParam enforceValidation; + + /** + * 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 Surcharge( + Object amount, + ApiRequestParams.EnumParam enforceValidation, + Map extraParams) { + this.amount = amount; + this.enforceValidation = enforceValidation; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private ApiRequestParams.EnumParam enforceValidation; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.AmountDetails.Surcharge build() { + return new PaymentIntentDecrementAuthorizationParams.AmountDetails.Surcharge( + this.amount, this.enforceValidation, this.extraParams); + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation( + PaymentIntentDecrementAuthorizationParams.AmountDetails.Surcharge.EnforceValidation + enforceValidation) { + this.enforceValidation = enforceValidation; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation(EmptyParam enforceValidation) { + this.enforceValidation = enforceValidation; + 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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.Surcharge#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 + * PaymentIntentDecrementAuthorizationParams.AmountDetails.Surcharge#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 EnforceValidation implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + EnforceValidation(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * 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 total amount of tax on the transaction represented in the smallest currency unit. Required + * for L2 rates. An integer greater than or equal to 0. + * + *

This field is mutually exclusive with the {@code + * amount_details[line_items][#][tax][total_tax_amount]} field. + */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.AmountDetails.Tax build() { + return new PaymentIntentDecrementAuthorizationParams.AmountDetails.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * 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 PaymentIntentDecrementAuthorizationParams.AmountDetails.Tax#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 PaymentIntentDecrementAuthorizationParams.AmountDetails.Tax#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 total amount of tax on the transaction represented in the + * smallest currency unit. + * Required for L2 rates. An integer greater than or equal to 0. + * + *

This field is mutually exclusive with the {@code + * amount_details[line_items][#][tax][total_tax_amount]} field. + */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Hooks { + /** + * 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; + + /** Arguments passed in automations. */ + @SerializedName("inputs") + Inputs inputs; + + private Hooks(Map extraParams, Inputs inputs) { + this.extraParams = extraParams; + this.inputs = inputs; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Inputs inputs; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.Hooks build() { + return new PaymentIntentDecrementAuthorizationParams.Hooks(this.extraParams, this.inputs); + } + + /** + * 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 + * PaymentIntentDecrementAuthorizationParams.Hooks#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 PaymentIntentDecrementAuthorizationParams.Hooks#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Arguments passed in automations. */ + public Builder setInputs(PaymentIntentDecrementAuthorizationParams.Hooks.Inputs inputs) { + this.inputs = inputs; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Inputs { + /** + * 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; + + /** Tax arguments for automations. */ + @SerializedName("tax") + Tax tax; + + private Inputs(Map extraParams, Tax tax) { + this.extraParams = extraParams; + this.tax = tax; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Tax tax; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.Hooks.Inputs build() { + return new PaymentIntentDecrementAuthorizationParams.Hooks.Inputs( + this.extraParams, this.tax); + } + + /** + * 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 PaymentIntentDecrementAuthorizationParams.Hooks.Inputs#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 PaymentIntentDecrementAuthorizationParams.Hooks.Inputs#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Tax arguments for automations. */ + public Builder setTax(PaymentIntentDecrementAuthorizationParams.Hooks.Inputs.Tax tax) { + this.tax = tax; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * Required. The TaxCalculation id + */ + @SerializedName("calculation") + Object calculation; + + /** + * 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 Tax(Object calculation, Map extraParams) { + this.calculation = calculation; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object calculation; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.Hooks.Inputs.Tax build() { + return new PaymentIntentDecrementAuthorizationParams.Hooks.Inputs.Tax( + this.calculation, this.extraParams); + } + + /** + * Required. The TaxCalculation id + */ + public Builder setCalculation(String calculation) { + this.calculation = calculation; + return this; + } + + /** + * Required. The TaxCalculation id + */ + public Builder setCalculation(EmptyParam calculation) { + this.calculation = calculation; + 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 PaymentIntentDecrementAuthorizationParams.Hooks.Inputs.Tax#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 PaymentIntentDecrementAuthorizationParams.Hooks.Inputs.Tax#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDetails { + /** + * A unique value to identify the customer. This field is available only for card payments. + * + *

This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent + * to card networks. + */ + @SerializedName("customer_reference") + Object customerReference; + + /** + * 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 unique value assigned by the business to identify the transaction. Required for L2 and L3 + * rates. + * + *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before + * being sent to card networks. For Klarna, this field is truncated to 255 characters and is + * visible to customers when they view the order in the Klarna app. + */ + @SerializedName("order_reference") + Object orderReference; + + private PaymentDetails( + Object customerReference, Map extraParams, Object orderReference) { + this.customerReference = customerReference; + this.extraParams = extraParams; + this.orderReference = orderReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object customerReference; + + private Map extraParams; + + private Object orderReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentDecrementAuthorizationParams.PaymentDetails build() { + return new PaymentIntentDecrementAuthorizationParams.PaymentDetails( + this.customerReference, this.extraParams, this.orderReference); + } + + /** + * A unique value to identify the customer. This field is available only for card payments. + * + *

This field is truncated to 25 alphanumeric characters, excluding spaces, before being + * sent to card networks. + */ + public Builder setCustomerReference(String customerReference) { + this.customerReference = customerReference; + return this; + } + + /** + * A unique value to identify the customer. This field is available only for card payments. + * + *

This field is truncated to 25 alphanumeric characters, excluding spaces, before being + * sent to card networks. + */ + public Builder setCustomerReference(EmptyParam customerReference) { + this.customerReference = customerReference; + 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 + * PaymentIntentDecrementAuthorizationParams.PaymentDetails#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 PaymentIntentDecrementAuthorizationParams.PaymentDetails#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A unique value assigned by the business to identify the transaction. Required for L2 and L3 + * rates. + * + *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, + * before being sent to card networks. For Klarna, this field is truncated to 255 characters + * and is visible to customers when they view the order in the Klarna app. + */ + public Builder setOrderReference(String orderReference) { + this.orderReference = orderReference; + return this; + } + + /** + * A unique value assigned by the business to identify the transaction. Required for L2 and L3 + * rates. + * + *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, + * before being sent to card networks. For Klarna, this field is truncated to 255 characters + * and is visible to customers when they view the order in the Klarna app. + */ + public Builder setOrderReference(EmptyParam orderReference) { + this.orderReference = orderReference; + return this; } } } diff --git a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java index 0e4c1698594..a6f744593cb 100644 --- a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java @@ -370,6 +370,10 @@ public static class AmountDetails { @SerializedName("shipping") Object shipping; + /** Contains information about the surcharge portion of the amount. */ + @SerializedName("surcharge") + Object surcharge; + /** Contains information about the tax portion of the amount. */ @SerializedName("tax") Object tax; @@ -380,12 +384,14 @@ private AmountDetails( Map extraParams, Object lineItems, Object shipping, + Object surcharge, Object tax) { this.discountAmount = discountAmount; this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; + this.surcharge = surcharge; this.tax = tax; } @@ -404,6 +410,8 @@ public static class Builder { private Object shipping; + private Object surcharge; + private Object tax; /** Finalize and obtain parameter instance from this builder. */ @@ -414,6 +422,7 @@ public PaymentIntentIncrementAuthorizationParams.AmountDetails build() { this.extraParams, this.lineItems, this.shipping, + this.surcharge, this.tax); } @@ -556,6 +565,19 @@ public Builder setShipping(EmptyParam shipping) { return this; } + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge( + PaymentIntentIncrementAuthorizationParams.AmountDetails.Surcharge surcharge) { + this.surcharge = surcharge; + return this; + } + + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge(EmptyParam surcharge) { + this.surcharge = surcharge; + return this; + } + /** Contains information about the tax portion of the amount. */ public Builder setTax(PaymentIntentIncrementAuthorizationParams.AmountDetails.Tax tax) { this.tax = tax; @@ -1625,6 +1647,128 @@ public Builder setToPostalCode(EmptyParam toPostalCode) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Surcharge { + /** Portion of the amount that corresponds to a surcharge. */ + @SerializedName("amount") + Object amount; + + /** Indicate whether to enforce validations on the surcharge amount. */ + @SerializedName("enforce_validation") + ApiRequestParams.EnumParam enforceValidation; + + /** + * 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 Surcharge( + Object amount, + ApiRequestParams.EnumParam enforceValidation, + Map extraParams) { + this.amount = amount; + this.enforceValidation = enforceValidation; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private ApiRequestParams.EnumParam enforceValidation; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.AmountDetails.Surcharge build() { + return new PaymentIntentIncrementAuthorizationParams.AmountDetails.Surcharge( + this.amount, this.enforceValidation, this.extraParams); + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation( + PaymentIntentIncrementAuthorizationParams.AmountDetails.Surcharge.EnforceValidation + enforceValidation) { + this.enforceValidation = enforceValidation; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation(EmptyParam enforceValidation) { + this.enforceValidation = enforceValidation; + 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 + * PaymentIntentIncrementAuthorizationParams.AmountDetails.Surcharge#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 + * PaymentIntentIncrementAuthorizationParams.AmountDetails.Surcharge#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 EnforceValidation implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + EnforceValidation(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Tax { @@ -1967,10 +2111,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -2056,10 +2196,6 @@ public Builder putAllExtraParam(Map map) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -2073,10 +2209,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index b5624387f48..1c9f531799a 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -1053,6 +1053,10 @@ public static class AmountDetails { @SerializedName("shipping") Object shipping; + /** Contains information about the surcharge portion of the amount. */ + @SerializedName("surcharge") + Object surcharge; + /** Contains information about the tax portion of the amount. */ @SerializedName("tax") Object tax; @@ -1063,12 +1067,14 @@ private AmountDetails( Map extraParams, Object lineItems, Object shipping, + Object surcharge, Object tax) { this.discountAmount = discountAmount; this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; + this.surcharge = surcharge; this.tax = tax; } @@ -1087,6 +1093,8 @@ public static class Builder { private Object shipping; + private Object surcharge; + private Object tax; /** Finalize and obtain parameter instance from this builder. */ @@ -1097,6 +1105,7 @@ public PaymentIntentUpdateParams.AmountDetails build() { this.extraParams, this.lineItems, this.shipping, + this.surcharge, this.tax); } @@ -1230,6 +1239,18 @@ public Builder setShipping(EmptyParam shipping) { return this; } + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge(PaymentIntentUpdateParams.AmountDetails.Surcharge surcharge) { + this.surcharge = surcharge; + return this; + } + + /** Contains information about the surcharge portion of the amount. */ + public Builder setSurcharge(EmptyParam surcharge) { + this.surcharge = surcharge; + return this; + } + /** Contains information about the tax portion of the amount. */ public Builder setTax(PaymentIntentUpdateParams.AmountDetails.Tax tax) { this.tax = tax; @@ -2361,6 +2382,125 @@ public Builder setToPostalCode(EmptyParam toPostalCode) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Surcharge { + /** Portion of the amount that corresponds to a surcharge. */ + @SerializedName("amount") + Object amount; + + /** Indicate whether to enforce validations on the surcharge amount. */ + @SerializedName("enforce_validation") + ApiRequestParams.EnumParam enforceValidation; + + /** + * 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 Surcharge( + Object amount, + ApiRequestParams.EnumParam enforceValidation, + Map extraParams) { + this.amount = amount; + this.enforceValidation = enforceValidation; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private ApiRequestParams.EnumParam enforceValidation; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.AmountDetails.Surcharge build() { + return new PaymentIntentUpdateParams.AmountDetails.Surcharge( + this.amount, this.enforceValidation, this.extraParams); + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Portion of the amount that corresponds to a surcharge. */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation( + PaymentIntentUpdateParams.AmountDetails.Surcharge.EnforceValidation enforceValidation) { + this.enforceValidation = enforceValidation; + return this; + } + + /** Indicate whether to enforce validations on the surcharge amount. */ + public Builder setEnforceValidation(EmptyParam enforceValidation) { + this.enforceValidation = enforceValidation; + 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 PaymentIntentUpdateParams.AmountDetails.Surcharge#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 PaymentIntentUpdateParams.AmountDetails.Surcharge#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 EnforceValidation implements ApiRequestParams.EnumParam { + @SerializedName("automatic") + AUTOMATIC("automatic"), + + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + EnforceValidation(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Tax { @@ -3015,10 +3155,6 @@ public static class PaymentDetails { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before * being sent to card networks. For Klarna, this field is truncated to 255 characters and is * visible to customers when they view the order in the Klarna app. @@ -3310,10 +3446,6 @@ public Builder setLodgingData( * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -3327,10 +3459,6 @@ public Builder setOrderReference(String orderReference) { * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. * - *

Required when the Payment Method Types array contains {@code card}, including when automatic_payment_methods.enabled - * is set to {@code true}. - * *

For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, * before being sent to card networks. For Klarna, this field is truncated to 255 characters * and is visible to customers when they view the order in the Klarna app. @@ -14989,6 +15117,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -15071,6 +15206,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -15134,6 +15270,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -15264,6 +15401,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -15333,6 +15472,7 @@ public PaymentIntentUpdateParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -15927,6 +16067,15 @@ public Builder setType(PaymentIntentUpdateParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(PaymentIntentUpdateParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -20539,19 +20688,9 @@ public static class StripeBalance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The source_type - * of the balance - */ - @SerializedName("source_type") - SourceType sourceType; - - private StripeBalance( - Object account, Map extraParams, SourceType sourceType) { + private StripeBalance(Object account, Map extraParams) { this.account = account; this.extraParams = extraParams; - this.sourceType = sourceType; } public static Builder builder() { @@ -20563,12 +20702,10 @@ public static class Builder { private Map extraParams; - private SourceType sourceType; - /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentUpdateParams.PaymentMethodData.StripeBalance build() { return new PaymentIntentUpdateParams.PaymentMethodData.StripeBalance( - this.account, this.extraParams, this.sourceType); + this.account, this.extraParams); } /** The connected account ID whose Stripe balance to use as the source of payment. */ @@ -20610,35 +20747,6 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } - - /** - * The source_type - * of the balance - */ - public Builder setSourceType( - PaymentIntentUpdateParams.PaymentMethodData.StripeBalance.SourceType sourceType) { - this.sourceType = sourceType; - return this; - } - } - - public enum SourceType implements ApiRequestParams.EnumParam { - @SerializedName("bank_account") - BANK_ACCOUNT("bank_account"), - - @SerializedName("card") - CARD("card"), - - @SerializedName("fpx") - FPX("fpx"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - SourceType(String value) { - this.value = value; - } } } @@ -20758,6 +20866,238 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodData.Upi build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * 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 PaymentIntentUpdateParams.PaymentMethodData.Upi#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 PaymentIntentUpdateParams.PaymentMethodData.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + Object description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + Object description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private Object description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions#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 + * PaymentIntentUpdateParams.PaymentMethodData.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -21238,6 +21578,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -21657,6 +22000,13 @@ public static class PaymentMethodOptions { @SerializedName("twint") Object twint; + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Object upi; + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about the * US bank account payment method options. @@ -21736,6 +22086,7 @@ private PaymentMethodOptions( Object stripeBalance, Object swish, Object twint, + Object upi, Object usBankAccount, Object wechatPay, Object zip) { @@ -21796,6 +22147,7 @@ private PaymentMethodOptions( this.stripeBalance = stripeBalance; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -21920,6 +22272,8 @@ public static class Builder { private Object twint; + private Object upi; + private Object usBankAccount; private Object wechatPay; @@ -21986,6 +22340,7 @@ public PaymentIntentUpdateParams.PaymentMethodOptions build() { this.stripeBalance, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -23040,6 +23395,24 @@ public Builder setTwint(EmptyParam twint) { return this; } + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(PaymentIntentUpdateParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + + /** + * If this is a {@code upi} PaymentIntent, this sub-hash contains details about the UPI + * payment method options. + */ + public Builder setUpi(EmptyParam upi) { + this.upi = upi; + return this; + } + /** * If this is a {@code us_bank_account} PaymentMethod, this sub-hash contains details about * the US bank account payment method options. @@ -23147,7 +23520,7 @@ public static class AcssDebit { @SerializedName("target_date") Object targetDate; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -23305,7 +23678,7 @@ public Builder setTargetDate(EmptyParam targetDate) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentUpdateParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -26617,7 +26990,10 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -26752,7 +27128,10 @@ public PaymentIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions build( this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -42472,7 +42851,7 @@ public static class MandateOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ @SerializedName("payment_schedule") PaymentSchedule paymentSchedule; @@ -42641,7 +43020,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ public Builder setPaymentSchedule( PaymentIntentUpdateParams.PaymentMethodOptions.Pix.MandateOptions.PaymentSchedule paymentSchedule) { @@ -44644,6 +45023,276 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodOptions.Upi build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * 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 PaymentIntentUpdateParams.PaymentMethodOptions.Upi#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 PaymentIntentUpdateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + Object description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + Object description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private Object description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions#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 + * PaymentIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -44668,10 +45317,6 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Preferred transaction settlement speed. */ - @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -44710,7 +45355,7 @@ public static class UsBankAccount { @SerializedName("transaction_purpose") ApiRequestParams.EnumParam transactionPurpose; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -44719,7 +45364,6 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, Object targetDate, ApiRequestParams.EnumParam transactionPurpose, @@ -44728,7 +45372,6 @@ private UsBankAccount( this.financialConnections = financialConnections; this.mandateOptions = mandateOptions; this.networks = networks; - this.preferredSettlementSpeed = preferredSettlementSpeed; this.setupFutureUsage = setupFutureUsage; this.targetDate = targetDate; this.transactionPurpose = transactionPurpose; @@ -44748,8 +45391,6 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; - private ApiRequestParams.EnumParam setupFutureUsage; private Object targetDate; @@ -44765,7 +45406,6 @@ public PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount build() { this.financialConnections, this.mandateOptions, this.networks, - this.preferredSettlementSpeed, this.setupFutureUsage, this.targetDate, this.transactionPurpose, @@ -44823,20 +45463,6 @@ public Builder setNetworks( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed( - PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.PreferredSettlementSpeed - preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. @@ -44931,7 +45557,7 @@ public Builder setTransactionPurpose(EmptyParam transactionPurpose) { return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { @@ -45707,21 +46333,6 @@ public enum Requested implements ApiRequestParams.EnumParam { } } - public enum PreferredSettlementSpeed implements ApiRequestParams.EnumParam { - @SerializedName("fastest") - FASTEST("fastest"), - - @SerializedName("standard") - STANDARD("standard"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - PreferredSettlementSpeed(String value) { - this.value = value; - } - } - public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), @@ -46714,6 +47325,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 68d23987b3f..317f121c208 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -110,6 +110,16 @@ public class PaymentLinkCreateParams extends ApiRequestParams { @SerializedName("line_items") List lineItems; + /** + * Settings for Managed Payments for this Payment Link and resulting CheckoutSessions, PaymentIntents, Invoices, and Subscriptions. + */ + @SerializedName("managed_payments") + ManagedPayments managedPayments; + /** * 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 @@ -239,6 +249,7 @@ private PaymentLinkCreateParams( String inactiveMessage, InvoiceCreation invoiceCreation, List lineItems, + ManagedPayments managedPayments, Map metadata, NameCollection nameCollection, String onBehalfOf, @@ -270,6 +281,7 @@ private PaymentLinkCreateParams( this.inactiveMessage = inactiveMessage; this.invoiceCreation = invoiceCreation; this.lineItems = lineItems; + this.managedPayments = managedPayments; this.metadata = metadata; this.nameCollection = nameCollection; this.onBehalfOf = onBehalfOf; @@ -324,6 +336,8 @@ public static class Builder { private List lineItems; + private ManagedPayments managedPayments; + private Map metadata; private NameCollection nameCollection; @@ -373,6 +387,7 @@ public PaymentLinkCreateParams build() { this.inactiveMessage, this.invoiceCreation, this.lineItems, + this.managedPayments, this.metadata, this.nameCollection, this.onBehalfOf, @@ -588,6 +603,18 @@ public Builder addAllLineItem(List elements) { return this; } + /** + * Settings for Managed Payments for this Payment Link and resulting CheckoutSessions, PaymentIntents, Invoices, and Subscriptions. + */ + public Builder setManagedPayments(PaymentLinkCreateParams.ManagedPayments managedPayments) { + this.managedPayments = managedPayments; + return this; + } + /** * Add a key/value pair to `metadata` 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 @@ -3943,6 +3970,14 @@ public static class ProductData { @SerializedName("tax_code") String taxCode; + /** + * Tax details for this product, including the tax code and an optional performance + * location. + */ + @SerializedName("tax_details") + TaxDetails taxDetails; + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -3957,6 +3992,7 @@ private ProductData( Map metadata, String name, String taxCode, + TaxDetails taxDetails, String unitLabel) { this.description = description; this.extraParams = extraParams; @@ -3964,6 +4000,7 @@ private ProductData( this.metadata = metadata; this.name = name; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.unitLabel = unitLabel; } @@ -3984,6 +4021,8 @@ public static class Builder { private String taxCode; + private TaxDetails taxDetails; + private String unitLabel; /** Finalize and obtain parameter instance from this builder. */ @@ -3995,6 +4034,7 @@ public PaymentLinkCreateParams.LineItem.PriceData.ProductData build() { this.metadata, this.name, this.taxCode, + this.taxDetails, this.unitLabel); } @@ -4106,6 +4146,17 @@ public Builder setTaxCode(String taxCode) { return this; } + /** + * Tax details for this product, including the tax code and an optional performance + * location. + */ + public Builder setTaxDetails( + PaymentLinkCreateParams.LineItem.PriceData.ProductData.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -4115,6 +4166,109 @@ public Builder setUnitLabel(String unitLabel) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + private TaxDetails( + Map extraParams, String performanceLocation, Object taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String performanceLocation; + + private Object taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkCreateParams.LineItem.PriceData.ProductData.TaxDetails build() { + return new PaymentLinkCreateParams.LineItem.PriceData.ProductData.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentLinkCreateParams.LineItem.PriceData.ProductData.TaxDetails#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 + * PaymentLinkCreateParams.LineItem.PriceData.ProductData.TaxDetails#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(EmptyParam taxCode) { + this.taxCode = taxCode; + return this; + } + } + } } @Getter @@ -4259,6 +4413,84 @@ public enum TaxBehavior implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ManagedPayments { + /** + * Set to {@code true} to enable Managed Payments, Stripe's + * merchant of record solution, for this session. + */ + @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; + + private ManagedPayments(Boolean enabled, Map extraParams) { + this.enabled = enabled; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkCreateParams.ManagedPayments build() { + return new PaymentLinkCreateParams.ManagedPayments(this.enabled, this.extraParams); + } + + /** + * Set to {@code true} to enable Managed Payments, Stripe's + * merchant of record solution, for this session. + */ + 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 + * PaymentLinkCreateParams.ManagedPayments#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 PaymentLinkCreateParams.ManagedPayments#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class NameCollection { @@ -7110,6 +7342,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index bd28aadae5b..18d7460bbc3 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -6172,6 +6172,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java index 04132633297..56b17599650 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java @@ -526,6 +526,13 @@ public class PaymentMethodConfigurationCreateParams extends ApiRequestParams { @SerializedName("twint") Twint twint; + /** + * Unified Payment Interface (UPI) is India's leading payment method with exponential growth since + * it launched in 2016. + */ + @SerializedName("upi") + Upi upi; + /** * Stripe users in the United States can accept ACH direct debit payments from customers with a US * bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check @@ -615,6 +622,7 @@ private PaymentMethodConfigurationCreateParams( Sofort sofort, Swish swish, Twint twint, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -680,6 +688,7 @@ private PaymentMethodConfigurationCreateParams( this.sofort = sofort; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -814,6 +823,8 @@ public static class Builder { private Twint twint; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -885,6 +896,7 @@ public PaymentMethodConfigurationCreateParams build() { this.sofort, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1573,6 +1585,15 @@ public Builder setTwint(PaymentMethodConfigurationCreateParams.Twint twint) { return this; } + /** + * Unified Payment Interface (UPI) is India's leading payment method with exponential growth + * since it launched in 2016. + */ + public Builder setUpi(PaymentMethodConfigurationCreateParams.Upi upi) { + this.upi = upi; + return this; + } + /** * Stripe users in the United States can accept ACH direct debit payments from customers with a * US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. @@ -11214,6 +11235,169 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * 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 Upi(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.Upi build() { + return new PaymentMethodConfigurationCreateParams.Upi( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationCreateParams.Upi.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + 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 + * PaymentMethodConfigurationCreateParams.Upi#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 PaymentMethodConfigurationCreateParams.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.Upi.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.Upi.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * 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 PaymentMethodConfigurationCreateParams.Upi.DisplayPreference#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 PaymentMethodConfigurationCreateParams.Upi.DisplayPreference#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationCreateParams.Upi.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java index a66f808e91a..3c2fa94c8d2 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java @@ -527,6 +527,13 @@ public class PaymentMethodConfigurationUpdateParams extends ApiRequestParams { @SerializedName("twint") Twint twint; + /** + * Unified Payment Interface (UPI) is India's leading payment method with exponential growth since + * it launched in 2016. + */ + @SerializedName("upi") + Upi upi; + /** * Stripe users in the United States can accept ACH direct debit payments from customers with a US * bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check @@ -616,6 +623,7 @@ private PaymentMethodConfigurationUpdateParams( Sofort sofort, Swish swish, Twint twint, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -681,6 +689,7 @@ private PaymentMethodConfigurationUpdateParams( this.sofort = sofort; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -815,6 +824,8 @@ public static class Builder { private Twint twint; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -886,6 +897,7 @@ public PaymentMethodConfigurationUpdateParams build() { this.sofort, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1580,6 +1592,15 @@ public Builder setTwint(PaymentMethodConfigurationUpdateParams.Twint twint) { return this; } + /** + * Unified Payment Interface (UPI) is India's leading payment method with exponential growth + * since it launched in 2016. + */ + public Builder setUpi(PaymentMethodConfigurationUpdateParams.Upi upi) { + this.upi = upi; + return this; + } + /** * Stripe users in the United States can accept ACH direct debit payments from customers with a * US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. @@ -11221,6 +11242,169 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * 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 Upi(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.Upi build() { + return new PaymentMethodConfigurationUpdateParams.Upi( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + 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 + * PaymentMethodConfigurationUpdateParams.Upi#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 PaymentMethodConfigurationUpdateParams.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * 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 PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference#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 PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationUpdateParams.Upi.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index f82dd7e575c..7c2c73529ef 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -460,6 +460,13 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -547,6 +554,7 @@ private PaymentMethodCreateParams( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -615,6 +623,7 @@ private PaymentMethodCreateParams( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -755,6 +764,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -829,6 +840,7 @@ public PaymentMethodCreateParams build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1479,6 +1491,15 @@ public Builder setType(PaymentMethodCreateParams.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(PaymentMethodCreateParams.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -6102,18 +6123,9 @@ public static class StripeBalance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The source_type - * of the balance - */ - @SerializedName("source_type") - SourceType sourceType; - - private StripeBalance(String account, Map extraParams, SourceType sourceType) { + private StripeBalance(String account, Map extraParams) { this.account = account; this.extraParams = extraParams; - this.sourceType = sourceType; } public static Builder builder() { @@ -6125,12 +6137,9 @@ public static class Builder { private Map extraParams; - private SourceType sourceType; - /** Finalize and obtain parameter instance from this builder. */ public PaymentMethodCreateParams.StripeBalance build() { - return new PaymentMethodCreateParams.StripeBalance( - this.account, this.extraParams, this.sourceType); + return new PaymentMethodCreateParams.StripeBalance(this.account, this.extraParams); } /** The connected account ID whose Stripe balance to use as the source of payment. */ @@ -6165,34 +6174,6 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } - - /** - * The source_type - * of the balance - */ - public Builder setSourceType(PaymentMethodCreateParams.StripeBalance.SourceType sourceType) { - this.sourceType = sourceType; - return this; - } - } - - public enum SourceType implements ApiRequestParams.EnumParam { - @SerializedName("bank_account") - BANK_ACCOUNT("bank_account"), - - @SerializedName("card") - CARD("card"), - - @SerializedName("fpx") - FPX("fpx"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - SourceType(String value) { - this.value = value; - } } } @@ -6385,6 +6366,221 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodCreateParams.Upi build() { + return new PaymentMethodCreateParams.Upi(this.extraParams, this.mandateOptions); + } + + /** + * 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 + * PaymentMethodCreateParams.Upi#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 PaymentMethodCreateParams.Upi#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + PaymentMethodCreateParams.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param refers + * to the exact amount to be charged in future payments. If {@code maximum}, the amount + * charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodCreateParams.Upi.MandateOptions build() { + return new PaymentMethodCreateParams.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + PaymentMethodCreateParams.Upi.MandateOptions.AmountType amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 PaymentMethodCreateParams.Upi.MandateOptions#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 PaymentMethodCreateParams.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -6847,6 +7043,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PaymentMethodListParams.java b/src/main/java/com/stripe/param/PaymentMethodListParams.java index 5fc891fdef3..ec7d70f3314 100644 --- a/src/main/java/com/stripe/param/PaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodListParams.java @@ -433,6 +433,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/PlanCreateParams.java b/src/main/java/com/stripe/param/PlanCreateParams.java index 874c7c03d7b..8f8ca774143 100644 --- a/src/main/java/com/stripe/param/PlanCreateParams.java +++ b/src/main/java/com/stripe/param/PlanCreateParams.java @@ -574,6 +574,13 @@ public static class Product { @SerializedName("tax_code") String taxCode; + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + @SerializedName("tax_details") + TaxDetails taxDetails; + /** * A label that represents units of this product. When set, this will be included in customers' * receipts, invoices, Checkout, and the customer portal. @@ -589,6 +596,7 @@ private Product( String name, String statementDescriptor, String taxCode, + TaxDetails taxDetails, String unitLabel) { this.active = active; this.extraParams = extraParams; @@ -597,6 +605,7 @@ private Product( this.name = name; this.statementDescriptor = statementDescriptor; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.unitLabel = unitLabel; } @@ -619,6 +628,8 @@ public static class Builder { private String taxCode; + private TaxDetails taxDetails; + private String unitLabel; /** Finalize and obtain parameter instance from this builder. */ @@ -631,6 +642,7 @@ public PlanCreateParams.Product build() { this.name, this.statementDescriptor, this.taxCode, + this.taxDetails, this.unitLabel); } @@ -727,6 +739,15 @@ public Builder setTaxCode(String taxCode) { return this; } + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + public Builder setTaxDetails(PlanCreateParams.Product.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -736,6 +757,106 @@ public Builder setUnitLabel(String unitLabel) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + private TaxDetails( + Map extraParams, String performanceLocation, Object taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String performanceLocation; + + private Object taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public PlanCreateParams.Product.TaxDetails build() { + return new PlanCreateParams.Product.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PlanCreateParams.Product.TaxDetails#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 PlanCreateParams.Product.TaxDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(EmptyParam taxCode) { + this.taxCode = taxCode; + return this; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/PriceCreateParams.java b/src/main/java/com/stripe/param/PriceCreateParams.java index 3748c9890a8..eeb5222e348 100644 --- a/src/main/java/com/stripe/param/PriceCreateParams.java +++ b/src/main/java/com/stripe/param/PriceCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; @@ -1232,6 +1233,13 @@ public static class ProductData { @SerializedName("tax_code") String taxCode; + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + @SerializedName("tax_details") + TaxDetails taxDetails; + /** * A label that represents units of this product. When set, this will be included in customers' * receipts, invoices, Checkout, and the customer portal. @@ -1247,6 +1255,7 @@ private ProductData( String name, String statementDescriptor, String taxCode, + TaxDetails taxDetails, String unitLabel) { this.active = active; this.extraParams = extraParams; @@ -1255,6 +1264,7 @@ private ProductData( this.name = name; this.statementDescriptor = statementDescriptor; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.unitLabel = unitLabel; } @@ -1277,6 +1287,8 @@ public static class Builder { private String taxCode; + private TaxDetails taxDetails; + private String unitLabel; /** Finalize and obtain parameter instance from this builder. */ @@ -1289,6 +1301,7 @@ public PriceCreateParams.ProductData build() { this.name, this.statementDescriptor, this.taxCode, + this.taxDetails, this.unitLabel); } @@ -1385,6 +1398,15 @@ public Builder setTaxCode(String taxCode) { return this; } + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + public Builder setTaxDetails(PriceCreateParams.ProductData.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -1394,6 +1416,106 @@ public Builder setUnitLabel(String unitLabel) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + private TaxDetails( + Map extraParams, String performanceLocation, Object taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String performanceLocation; + + private Object taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public PriceCreateParams.ProductData.TaxDetails build() { + return new PriceCreateParams.ProductData.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PriceCreateParams.ProductData.TaxDetails#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 PriceCreateParams.ProductData.TaxDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(EmptyParam taxCode) { + this.taxCode = taxCode; + return this; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/ProductCreateParams.java b/src/main/java/com/stripe/param/ProductCreateParams.java index 2c612b09e0c..4af7ac26927 100644 --- a/src/main/java/com/stripe/param/ProductCreateParams.java +++ b/src/main/java/com/stripe/param/ProductCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; @@ -102,6 +103,13 @@ public class ProductCreateParams extends ApiRequestParams { @SerializedName("tax_code") String taxCode; + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + @SerializedName("tax_details") + TaxDetails taxDetails; + /** * The type of the product. Defaults to {@code service} if not explicitly specified, enabling use * of this product with Subscriptions and Plans. Set this parameter to {@code good} to use this @@ -137,6 +145,7 @@ private ProductCreateParams( Boolean shippable, String statementDescriptor, String taxCode, + TaxDetails taxDetails, Type type, String unitLabel, String url) { @@ -154,6 +163,7 @@ private ProductCreateParams( this.shippable = shippable; this.statementDescriptor = statementDescriptor; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.type = type; this.unitLabel = unitLabel; this.url = url; @@ -192,6 +202,8 @@ public static class Builder { private String taxCode; + private TaxDetails taxDetails; + private Type type; private String unitLabel; @@ -215,6 +227,7 @@ public ProductCreateParams build() { this.shippable, this.statementDescriptor, this.taxCode, + this.taxDetails, this.type, this.unitLabel, this.url); @@ -423,6 +436,15 @@ public Builder setTaxCode(String taxCode) { return this; } + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + public Builder setTaxDetails(ProductCreateParams.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * The type of the product. Defaults to {@code service} if not explicitly specified, enabling * use of this product with Subscriptions and Plans. Set this parameter to {@code good} to use @@ -1711,6 +1733,104 @@ public Builder setWidth(BigDecimal width) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + private TaxDetails( + Map extraParams, String performanceLocation, Object taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String performanceLocation; + + private Object taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public ProductCreateParams.TaxDetails build() { + return new ProductCreateParams.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * ProductCreateParams.TaxDetails#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 ProductCreateParams.TaxDetails#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(EmptyParam taxCode) { + this.taxCode = taxCode; + return this; + } + } + } + public enum Type implements ApiRequestParams.EnumParam { @SerializedName("good") GOOD("good"), diff --git a/src/main/java/com/stripe/param/ProductUpdateParams.java b/src/main/java/com/stripe/param/ProductUpdateParams.java index ad8b06c6632..da6bbc08e0f 100644 --- a/src/main/java/com/stripe/param/ProductUpdateParams.java +++ b/src/main/java/com/stripe/param/ProductUpdateParams.java @@ -96,6 +96,13 @@ public class ProductUpdateParams extends ApiRequestParams { @SerializedName("tax_code") Object taxCode; + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + @SerializedName("tax_details") + Object taxDetails; + /** * A label that represents units of this product. When set, this will be included in customers' * receipts, invoices, Checkout, and the customer portal. May only be set if {@code type=service}. @@ -121,6 +128,7 @@ private ProductUpdateParams( Boolean shippable, Object statementDescriptor, Object taxCode, + Object taxDetails, Object unitLabel, Object url) { this.active = active; @@ -136,6 +144,7 @@ private ProductUpdateParams( this.shippable = shippable; this.statementDescriptor = statementDescriptor; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.unitLabel = unitLabel; this.url = url; } @@ -171,6 +180,8 @@ public static class Builder { private Object taxCode; + private Object taxDetails; + private Object unitLabel; private Object url; @@ -191,6 +202,7 @@ public ProductUpdateParams build() { this.shippable, this.statementDescriptor, this.taxCode, + this.taxDetails, this.unitLabel, this.url); } @@ -506,6 +518,24 @@ public Builder setTaxCode(EmptyParam taxCode) { return this; } + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + public Builder setTaxDetails(ProductUpdateParams.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + + /** + * Tax details for this product, including the tax + * code and an optional performance location. + */ + public Builder setTaxDetails(EmptyParam taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * A label that represents units of this product. When set, this will be included in customers' * receipts, invoices, Checkout, and the customer portal. May only be set if {@code @@ -727,4 +757,112 @@ public Builder setWidth(BigDecimal width) { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + Object performanceLocation; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + private TaxDetails( + Map extraParams, Object performanceLocation, Object taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object performanceLocation; + + private Object taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public ProductUpdateParams.TaxDetails build() { + return new ProductUpdateParams.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * ProductUpdateParams.TaxDetails#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 ProductUpdateParams.TaxDetails#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(EmptyParam performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(EmptyParam taxCode) { + this.taxCode = taxCode; + return this; + } + } + } } diff --git a/src/main/java/com/stripe/param/QuoteCreateParams.java b/src/main/java/com/stripe/param/QuoteCreateParams.java index 87e82fa9b6f..a67c22352b6 100644 --- a/src/main/java/com/stripe/param/QuoteCreateParams.java +++ b/src/main/java/com/stripe/param/QuoteCreateParams.java @@ -2502,6 +2502,10 @@ public static class AddItem { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + private AddItem( List discounts, Map extraParams, @@ -2509,7 +2513,8 @@ private AddItem( String price, Long quantity, List taxRates, - Trial trial) { + Trial trial, + String trialOffer) { this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -2517,6 +2522,7 @@ private AddItem( this.quantity = quantity; this.taxRates = taxRates; this.trial = trial; + this.trialOffer = trialOffer; } public static Builder builder() { @@ -2538,6 +2544,8 @@ public static class Builder { private Trial trial; + private String trialOffer; + /** Finalize and obtain parameter instance from this builder. */ public QuoteCreateParams.Line.Action.AddItem build() { return new QuoteCreateParams.Line.Action.AddItem( @@ -2547,7 +2555,8 @@ public QuoteCreateParams.Line.Action.AddItem build() { this.price, this.quantity, this.taxRates, - this.trial); + this.trial, + this.trialOffer); } /** @@ -2675,6 +2684,12 @@ public Builder setTrial(QuoteCreateParams.Line.Action.AddItem.Trial trial) { this.trial = trial; return this; } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } } @Getter @@ -3506,6 +3521,10 @@ public static class SetItem { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + private SetItem( List discounts, Map extraParams, @@ -3513,7 +3532,8 @@ private SetItem( String price, Long quantity, List taxRates, - Trial trial) { + Trial trial, + String trialOffer) { this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -3521,6 +3541,7 @@ private SetItem( this.quantity = quantity; this.taxRates = taxRates; this.trial = trial; + this.trialOffer = trialOffer; } public static Builder builder() { @@ -3542,6 +3563,8 @@ public static class Builder { private Trial trial; + private String trialOffer; + /** Finalize and obtain parameter instance from this builder. */ public QuoteCreateParams.Line.Action.SetItem build() { return new QuoteCreateParams.Line.Action.SetItem( @@ -3551,7 +3574,8 @@ public QuoteCreateParams.Line.Action.SetItem build() { this.price, this.quantity, this.taxRates, - this.trial); + this.trial, + this.trialOffer); } /** @@ -3688,6 +3712,12 @@ public Builder setTrial(QuoteCreateParams.Line.Action.SetItem.Trial trial) { this.trial = trial; return this; } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } } @Getter @@ -4917,7 +4947,7 @@ public Builder setType(QuoteCreateParams.Line.SetPauseCollection.Type type) { public static class Set { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ @SerializedName("behavior") Behavior behavior; @@ -4954,7 +4984,7 @@ public QuoteCreateParams.Line.SetPauseCollection.Set build() { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ public Builder setBehavior( QuoteCreateParams.Line.SetPauseCollection.Set.Behavior behavior) { diff --git a/src/main/java/com/stripe/param/QuoteUpdateParams.java b/src/main/java/com/stripe/param/QuoteUpdateParams.java index 540bf09299b..01b203c4c80 100644 --- a/src/main/java/com/stripe/param/QuoteUpdateParams.java +++ b/src/main/java/com/stripe/param/QuoteUpdateParams.java @@ -2454,6 +2454,10 @@ public static class AddItem { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + Object trialOffer; + private AddItem( List discounts, Map extraParams, @@ -2461,7 +2465,8 @@ private AddItem( Object price, Long quantity, List taxRates, - Trial trial) { + Trial trial, + Object trialOffer) { this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -2469,6 +2474,7 @@ private AddItem( this.quantity = quantity; this.taxRates = taxRates; this.trial = trial; + this.trialOffer = trialOffer; } public static Builder builder() { @@ -2490,6 +2496,8 @@ public static class Builder { private Trial trial; + private Object trialOffer; + /** Finalize and obtain parameter instance from this builder. */ public QuoteUpdateParams.Line.Action.AddItem build() { return new QuoteUpdateParams.Line.Action.AddItem( @@ -2499,7 +2507,8 @@ public QuoteUpdateParams.Line.Action.AddItem build() { this.price, this.quantity, this.taxRates, - this.trial); + this.trial, + this.trialOffer); } /** @@ -2633,6 +2642,18 @@ public Builder setTrial(QuoteUpdateParams.Line.Action.AddItem.Trial trial) { this.trial = trial; return this; } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(EmptyParam trialOffer) { + this.trialOffer = trialOffer; + return this; + } } @Getter @@ -3524,6 +3545,10 @@ public static class SetItem { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + Object trialOffer; + private SetItem( List discounts, Map extraParams, @@ -3531,7 +3556,8 @@ private SetItem( Object price, Long quantity, List taxRates, - Trial trial) { + Trial trial, + Object trialOffer) { this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -3539,6 +3565,7 @@ private SetItem( this.quantity = quantity; this.taxRates = taxRates; this.trial = trial; + this.trialOffer = trialOffer; } public static Builder builder() { @@ -3560,6 +3587,8 @@ public static class Builder { private Trial trial; + private Object trialOffer; + /** Finalize and obtain parameter instance from this builder. */ public QuoteUpdateParams.Line.Action.SetItem build() { return new QuoteUpdateParams.Line.Action.SetItem( @@ -3569,7 +3598,8 @@ public QuoteUpdateParams.Line.Action.SetItem build() { this.price, this.quantity, this.taxRates, - this.trial); + this.trial, + this.trialOffer); } /** @@ -3712,6 +3742,18 @@ public Builder setTrial(QuoteUpdateParams.Line.Action.SetItem.Trial trial) { this.trial = trial; return this; } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(EmptyParam trialOffer) { + this.trialOffer = trialOffer; + return this; + } } @Getter @@ -4981,7 +5023,7 @@ public Builder setType(QuoteUpdateParams.Line.SetPauseCollection.Type type) { public static class Set { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ @SerializedName("behavior") Behavior behavior; @@ -5018,7 +5060,7 @@ public QuoteUpdateParams.Line.SetPauseCollection.Set build() { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ public Builder setBehavior( QuoteUpdateParams.Line.SetPauseCollection.Set.Behavior behavior) { diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index 7a47efa726d..3f7bcdda64a 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -1049,6 +1049,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -1131,6 +1138,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -1194,6 +1202,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -1324,6 +1333,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -1393,6 +1404,7 @@ public SetupIntentConfirmParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1987,6 +1999,15 @@ public Builder setType(SetupIntentConfirmParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(SetupIntentConfirmParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -6425,19 +6446,9 @@ public static class StripeBalance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The source_type - * of the balance - */ - @SerializedName("source_type") - SourceType sourceType; - - private StripeBalance( - String account, Map extraParams, SourceType sourceType) { + private StripeBalance(String account, Map extraParams) { this.account = account; this.extraParams = extraParams; - this.sourceType = sourceType; } public static Builder builder() { @@ -6449,12 +6460,10 @@ public static class Builder { private Map extraParams; - private SourceType sourceType; - /** Finalize and obtain parameter instance from this builder. */ public SetupIntentConfirmParams.PaymentMethodData.StripeBalance build() { return new SetupIntentConfirmParams.PaymentMethodData.StripeBalance( - this.account, this.extraParams, this.sourceType); + this.account, this.extraParams); } /** The connected account ID whose Stripe balance to use as the source of payment. */ @@ -6490,35 +6499,6 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } - - /** - * The source_type - * of the balance - */ - public Builder setSourceType( - SetupIntentConfirmParams.PaymentMethodData.StripeBalance.SourceType sourceType) { - this.sourceType = sourceType; - return this; - } - } - - public enum SourceType implements ApiRequestParams.EnumParam { - @SerializedName("bank_account") - BANK_ACCOUNT("bank_account"), - - @SerializedName("card") - CARD("card"), - - @SerializedName("fpx") - FPX("fpx"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - SourceType(String value) { - this.value = value; - } } } @@ -6638,6 +6618,228 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodData.Upi build() { + return new SetupIntentConfirmParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * 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 SetupIntentConfirmParams.PaymentMethodData.Upi#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 SetupIntentConfirmParams.PaymentMethodData.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions build() { + return new SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions.AmountType amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions#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 + * SetupIntentConfirmParams.PaymentMethodData.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -7100,6 +7302,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -7204,6 +7409,20 @@ public static class PaymentMethodOptions { @SerializedName("sepa_debit") SepaDebit sepaDebit; + /** + * If this is a {@code stripe_balance} PaymentMethod, this sub-hash contains details about the + * Stripe Balance payment method options. + */ + @SerializedName("stripe_balance") + StripeBalance stripeBalance; + + /** + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Upi upi; + /** * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the US * bank account payment method options. @@ -7224,6 +7443,8 @@ private PaymentMethodOptions( Payto payto, Pix pix, SepaDebit sepaDebit, + StripeBalance stripeBalance, + Upi upi, UsBankAccount usBankAccount) { this.acssDebit = acssDebit; this.amazonPay = amazonPay; @@ -7237,6 +7458,8 @@ private PaymentMethodOptions( this.payto = payto; this.pix = pix; this.sepaDebit = sepaDebit; + this.stripeBalance = stripeBalance; + this.upi = upi; this.usBankAccount = usBankAccount; } @@ -7269,6 +7492,10 @@ public static class Builder { private SepaDebit sepaDebit; + private StripeBalance stripeBalance; + + private Upi upi; + private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ @@ -7286,6 +7513,8 @@ public SetupIntentConfirmParams.PaymentMethodOptions build() { this.payto, this.pix, this.sepaDebit, + this.stripeBalance, + this.upi, this.usBankAccount); } @@ -7418,21 +7647,40 @@ public Builder setSepaDebit( } /** - * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the - * US bank account payment method options. + * If this is a {@code stripe_balance} PaymentMethod, this sub-hash contains details about the + * Stripe Balance payment method options. */ - public Builder setUsBankAccount( - SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount usBankAccount) { - this.usBankAccount = usBankAccount; + public Builder setStripeBalance( + SetupIntentConfirmParams.PaymentMethodOptions.StripeBalance stripeBalance) { + this.stripeBalance = stripeBalance; return this; } - } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class AcssDebit { /** - * Three-letter ISO currency + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + public Builder setUpi(SetupIntentConfirmParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + + /** + * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the + * US bank account payment method options. + */ + public Builder setUsBankAccount( + SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount usBankAccount) { + this.usBankAccount = usBankAccount; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AcssDebit { + /** + * Three-letter ISO currency * code, in lowercase. Must be a supported * currency. */ @@ -7452,7 +7700,7 @@ public static class AcssDebit { @SerializedName("mandate_options") MandateOptions mandateOptions; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -7532,7 +7780,7 @@ public Builder setMandateOptions( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentConfirmParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -8230,7 +8478,10 @@ public Builder setThreeDSecure( @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -8379,7 +8630,10 @@ public SetupIntentConfirmParams.PaymentMethodOptions.Card.MandateOptions build() this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -10758,7 +11012,7 @@ public static class MandateOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ @SerializedName("payment_schedule") PaymentSchedule paymentSchedule; @@ -10908,7 +11162,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ public Builder setPaymentSchedule( SetupIntentConfirmParams.PaymentMethodOptions.Pix.MandateOptions.PaymentSchedule paymentSchedule) { @@ -11157,6 +11411,325 @@ public Builder setReferencePrefix(EmptyParam referencePrefix) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class StripeBalance { + /** + * 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 StripeBalance(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodOptions.StripeBalance build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.StripeBalance(this.extraParams); + } + + /** + * 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 SetupIntentConfirmParams.PaymentMethodOptions.StripeBalance#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 SetupIntentConfirmParams.PaymentMethodOptions.StripeBalance#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodOptions.Upi build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * 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 SetupIntentConfirmParams.PaymentMethodOptions.Upi#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 SetupIntentConfirmParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + SetupIntentConfirmParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions#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 + * SetupIntentConfirmParams.PaymentMethodOptions.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -11181,7 +11754,7 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -11274,7 +11847,7 @@ public Builder setNetworks( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentConfirmParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index b6ab8a0968c..00fe22c2149 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -1587,6 +1587,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -1669,6 +1676,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -1732,6 +1740,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -1862,6 +1871,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -1931,6 +1942,7 @@ public SetupIntentCreateParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -2524,6 +2536,15 @@ public Builder setType(SetupIntentCreateParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(SetupIntentCreateParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -6959,19 +6980,9 @@ public static class StripeBalance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The source_type - * of the balance - */ - @SerializedName("source_type") - SourceType sourceType; - - private StripeBalance( - String account, Map extraParams, SourceType sourceType) { + private StripeBalance(String account, Map extraParams) { this.account = account; this.extraParams = extraParams; - this.sourceType = sourceType; } public static Builder builder() { @@ -6983,12 +6994,10 @@ public static class Builder { private Map extraParams; - private SourceType sourceType; - /** Finalize and obtain parameter instance from this builder. */ public SetupIntentCreateParams.PaymentMethodData.StripeBalance build() { return new SetupIntentCreateParams.PaymentMethodData.StripeBalance( - this.account, this.extraParams, this.sourceType); + this.account, this.extraParams); } /** The connected account ID whose Stripe balance to use as the source of payment. */ @@ -7024,35 +7033,6 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } - - /** - * The source_type - * of the balance - */ - public Builder setSourceType( - SetupIntentCreateParams.PaymentMethodData.StripeBalance.SourceType sourceType) { - this.sourceType = sourceType; - return this; - } - } - - public enum SourceType implements ApiRequestParams.EnumParam { - @SerializedName("bank_account") - BANK_ACCOUNT("bank_account"), - - @SerializedName("card") - CARD("card"), - - @SerializedName("fpx") - FPX("fpx"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - SourceType(String value) { - this.value = value; - } } } @@ -7172,6 +7152,228 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodData.Upi build() { + return new SetupIntentCreateParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * 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 SetupIntentCreateParams.PaymentMethodData.Upi#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 SetupIntentCreateParams.PaymentMethodData.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions build() { + return new SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions.AmountType amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions#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 + * SetupIntentCreateParams.PaymentMethodData.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -7634,6 +7836,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -7738,6 +7943,20 @@ public static class PaymentMethodOptions { @SerializedName("sepa_debit") SepaDebit sepaDebit; + /** + * If this is a {@code stripe_balance} PaymentMethod, this sub-hash contains details about the + * Stripe Balance payment method options. + */ + @SerializedName("stripe_balance") + StripeBalance stripeBalance; + + /** + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Upi upi; + /** * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the US * bank account payment method options. @@ -7758,6 +7977,8 @@ private PaymentMethodOptions( Payto payto, Pix pix, SepaDebit sepaDebit, + StripeBalance stripeBalance, + Upi upi, UsBankAccount usBankAccount) { this.acssDebit = acssDebit; this.amazonPay = amazonPay; @@ -7771,6 +7992,8 @@ private PaymentMethodOptions( this.payto = payto; this.pix = pix; this.sepaDebit = sepaDebit; + this.stripeBalance = stripeBalance; + this.upi = upi; this.usBankAccount = usBankAccount; } @@ -7803,6 +8026,10 @@ public static class Builder { private SepaDebit sepaDebit; + private StripeBalance stripeBalance; + + private Upi upi; + private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ @@ -7820,6 +8047,8 @@ public SetupIntentCreateParams.PaymentMethodOptions build() { this.payto, this.pix, this.sepaDebit, + this.stripeBalance, + this.upi, this.usBankAccount); } @@ -7952,21 +8181,40 @@ public Builder setSepaDebit( } /** - * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the - * US bank account payment method options. + * If this is a {@code stripe_balance} PaymentMethod, this sub-hash contains details about the + * Stripe Balance payment method options. */ - public Builder setUsBankAccount( - SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { - this.usBankAccount = usBankAccount; + public Builder setStripeBalance( + SetupIntentCreateParams.PaymentMethodOptions.StripeBalance stripeBalance) { + this.stripeBalance = stripeBalance; return this; } - } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class AcssDebit { /** - * Three-letter ISO currency + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + public Builder setUpi(SetupIntentCreateParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + + /** + * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the + * US bank account payment method options. + */ + public Builder setUsBankAccount( + SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { + this.usBankAccount = usBankAccount; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AcssDebit { + /** + * Three-letter ISO currency * code, in lowercase. Must be a supported * currency. */ @@ -7986,7 +8234,7 @@ public static class AcssDebit { @SerializedName("mandate_options") MandateOptions mandateOptions; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -8066,7 +8314,7 @@ public Builder setMandateOptions( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentCreateParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -8762,7 +9010,10 @@ public Builder setThreeDSecure( @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -8911,7 +9162,10 @@ public SetupIntentCreateParams.PaymentMethodOptions.Card.MandateOptions build() this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -11290,7 +11544,7 @@ public static class MandateOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ @SerializedName("payment_schedule") PaymentSchedule paymentSchedule; @@ -11440,7 +11694,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ public Builder setPaymentSchedule( SetupIntentCreateParams.PaymentMethodOptions.Pix.MandateOptions.PaymentSchedule paymentSchedule) { @@ -11689,6 +11943,325 @@ public Builder setReferencePrefix(EmptyParam referencePrefix) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class StripeBalance { + /** + * 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 StripeBalance(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodOptions.StripeBalance build() { + return new SetupIntentCreateParams.PaymentMethodOptions.StripeBalance(this.extraParams); + } + + /** + * 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 SetupIntentCreateParams.PaymentMethodOptions.StripeBalance#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 SetupIntentCreateParams.PaymentMethodOptions.StripeBalance#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodOptions.Upi build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * 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 SetupIntentCreateParams.PaymentMethodOptions.Upi#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 SetupIntentCreateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + SetupIntentCreateParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions#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 + * SetupIntentCreateParams.PaymentMethodOptions.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -11713,7 +12286,7 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -11806,7 +12379,7 @@ public Builder setNetworks( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { @@ -12854,6 +13427,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index 0b018234234..efe520a01c2 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -956,6 +956,13 @@ public static class PaymentMethodData { @SerializedName("type") Type type; + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + @SerializedName("upi") + Upi upi; + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US * bank account payment method. @@ -1038,6 +1045,7 @@ private PaymentMethodData( Swish swish, Twint twint, Type type, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay, Zip zip) { @@ -1101,6 +1109,7 @@ private PaymentMethodData( this.swish = swish; this.twint = twint; this.type = type; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; this.zip = zip; @@ -1231,6 +1240,8 @@ public static class Builder { private Type type; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -1300,6 +1311,7 @@ public SetupIntentUpdateParams.PaymentMethodData build() { this.swish, this.twint, this.type, + this.upi, this.usBankAccount, this.wechatPay, this.zip); @@ -1893,6 +1905,15 @@ public Builder setType(SetupIntentUpdateParams.PaymentMethodData.Type type) { return this; } + /** + * If this is a {@code upi} PaymentMethod, this hash contains details about the UPI payment + * method. + */ + public Builder setUpi(SetupIntentUpdateParams.PaymentMethodData.Upi upi) { + this.upi = upi; + return this; + } + /** * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the * US bank account payment method. @@ -6502,19 +6523,9 @@ public static class StripeBalance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The source_type - * of the balance - */ - @SerializedName("source_type") - SourceType sourceType; - - private StripeBalance( - Object account, Map extraParams, SourceType sourceType) { + private StripeBalance(Object account, Map extraParams) { this.account = account; this.extraParams = extraParams; - this.sourceType = sourceType; } public static Builder builder() { @@ -6526,12 +6537,10 @@ public static class Builder { private Map extraParams; - private SourceType sourceType; - /** Finalize and obtain parameter instance from this builder. */ public SetupIntentUpdateParams.PaymentMethodData.StripeBalance build() { return new SetupIntentUpdateParams.PaymentMethodData.StripeBalance( - this.account, this.extraParams, this.sourceType); + this.account, this.extraParams); } /** The connected account ID whose Stripe balance to use as the source of payment. */ @@ -6573,35 +6582,6 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } - - /** - * The source_type - * of the balance - */ - public Builder setSourceType( - SetupIntentUpdateParams.PaymentMethodData.StripeBalance.SourceType sourceType) { - this.sourceType = sourceType; - return this; - } - } - - public enum SourceType implements ApiRequestParams.EnumParam { - @SerializedName("bank_account") - BANK_ACCOUNT("bank_account"), - - @SerializedName("card") - CARD("card"), - - @SerializedName("fpx") - FPX("fpx"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - SourceType(String value) { - this.value = value; - } } } @@ -6721,6 +6701,237 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + private Upi(Map extraParams, MandateOptions mandateOptions) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodData.Upi build() { + return new SetupIntentUpdateParams.PaymentMethodData.Upi( + this.extraParams, this.mandateOptions); + } + + /** + * 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 SetupIntentUpdateParams.PaymentMethodData.Upi#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 SetupIntentUpdateParams.PaymentMethodData.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + Object description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + Object description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private Object description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions build() { + return new SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions.AmountType amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions#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 + * SetupIntentUpdateParams.PaymentMethodData.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -7201,6 +7412,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -7305,6 +7519,20 @@ public static class PaymentMethodOptions { @SerializedName("sepa_debit") SepaDebit sepaDebit; + /** + * If this is a {@code stripe_balance} PaymentMethod, this sub-hash contains details about the + * Stripe Balance payment method options. + */ + @SerializedName("stripe_balance") + StripeBalance stripeBalance; + + /** + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + @SerializedName("upi") + Upi upi; + /** * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the US * bank account payment method options. @@ -7325,6 +7553,8 @@ private PaymentMethodOptions( Payto payto, Pix pix, SepaDebit sepaDebit, + StripeBalance stripeBalance, + Upi upi, UsBankAccount usBankAccount) { this.acssDebit = acssDebit; this.amazonPay = amazonPay; @@ -7338,6 +7568,8 @@ private PaymentMethodOptions( this.payto = payto; this.pix = pix; this.sepaDebit = sepaDebit; + this.stripeBalance = stripeBalance; + this.upi = upi; this.usBankAccount = usBankAccount; } @@ -7370,6 +7602,10 @@ public static class Builder { private SepaDebit sepaDebit; + private StripeBalance stripeBalance; + + private Upi upi; + private UsBankAccount usBankAccount; /** Finalize and obtain parameter instance from this builder. */ @@ -7387,6 +7623,8 @@ public SetupIntentUpdateParams.PaymentMethodOptions build() { this.payto, this.pix, this.sepaDebit, + this.stripeBalance, + this.upi, this.usBankAccount); } @@ -7519,10 +7757,29 @@ public Builder setSepaDebit( } /** - * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the - * US bank account payment method options. + * If this is a {@code stripe_balance} PaymentMethod, this sub-hash contains details about the + * Stripe Balance payment method options. */ - public Builder setUsBankAccount( + public Builder setStripeBalance( + SetupIntentUpdateParams.PaymentMethodOptions.StripeBalance stripeBalance) { + this.stripeBalance = stripeBalance; + return this; + } + + /** + * If this is a {@code upi} SetupIntent, this sub-hash contains details about the UPI payment + * method options. + */ + public Builder setUpi(SetupIntentUpdateParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + + /** + * If this is a {@code us_bank_account} SetupIntent, this sub-hash contains details about the + * US bank account payment method options. + */ + public Builder setUsBankAccount( SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { this.usBankAccount = usBankAccount; return this; @@ -7553,7 +7810,7 @@ public static class AcssDebit { @SerializedName("mandate_options") MandateOptions mandateOptions; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -7633,7 +7890,7 @@ public Builder setMandateOptions( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentUpdateParams.PaymentMethodOptions.AcssDebit.VerificationMethod verificationMethod) { @@ -8338,7 +8595,10 @@ public Builder setThreeDSecure( @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ @SerializedName("amount") Long amount; @@ -8487,7 +8747,10 @@ public SetupIntentUpdateParams.PaymentMethodOptions.Card.MandateOptions build() this.supportedTypes); } - /** Required. Amount to be charged for future payments. */ + /** + * Required. Amount to be charged for future payments, specified in the + * presentment currency. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -10982,7 +11245,7 @@ public static class MandateOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ @SerializedName("payment_schedule") PaymentSchedule paymentSchedule; @@ -11151,7 +11414,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ public Builder setPaymentSchedule( SetupIntentUpdateParams.PaymentMethodOptions.Pix.MandateOptions.PaymentSchedule paymentSchedule) { @@ -11418,6 +11681,334 @@ public Builder setReferencePrefix(EmptyParam referencePrefix) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class StripeBalance { + /** + * 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 StripeBalance(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodOptions.StripeBalance build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.StripeBalance(this.extraParams); + } + + /** + * 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 SetupIntentUpdateParams.PaymentMethodOptions.StripeBalance#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 SetupIntentUpdateParams.PaymentMethodOptions.StripeBalance#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Upi { + /** + * 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; + + /** Configuration options for setting up an eMandate. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + + @SerializedName("setup_future_usage") + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodOptions.Upi build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * 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 SetupIntentUpdateParams.PaymentMethodOptions.Upi#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 SetupIntentUpdateParams.PaymentMethodOptions.Upi#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Configuration options for setting up an eMandate. */ + public Builder setMandateOptions( + SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + SetupIntentUpdateParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + Object description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + Object description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private Object description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions.AmountType + amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + 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 + * SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions#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 + * SetupIntentUpdateParams.PaymentMethodOptions.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -11442,7 +12033,7 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ @SerializedName("verification_method") VerificationMethod verificationMethod; @@ -11535,7 +12126,7 @@ public Builder setNetworks( return this; } - /** Bank account verification method. */ + /** Bank account verification method. The default value is {@code automatic}. */ public Builder setVerificationMethod( SetupIntentUpdateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod verificationMethod) { @@ -12490,6 +13081,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index 33ef74e591c..d2dc3da6302 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -255,8 +255,8 @@ public class SubscriptionCreateParams extends ApiRequestParams { /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ @SerializedName("pending_invoice_item_interval") Object pendingInvoiceItemInterval; @@ -1066,8 +1066,8 @@ public Builder setPaymentSettings(SubscriptionCreateParams.PaymentSettings payme /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval( SubscriptionCreateParams.PendingInvoiceItemInterval pendingInvoiceItemInterval) { @@ -1077,8 +1077,8 @@ public Builder setPendingInvoiceItemInterval( /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval(EmptyParam pendingInvoiceItemInterval) { this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; @@ -3994,6 +3994,10 @@ public static class Item { @SerializedName("billing_thresholds") Object billingThresholds; + /** The trial offer to apply to this subscription item. */ + @SerializedName("current_trial") + CurrentTrial currentTrial; + /** The coupons to redeem into discounts for the subscription item. */ @SerializedName("discounts") Object discounts; @@ -4051,6 +4055,7 @@ public static class Item { private Item( Object billingThresholds, + CurrentTrial currentTrial, Object discounts, Map extraParams, Map metadata, @@ -4061,6 +4066,7 @@ private Item( Object taxRates, Trial trial) { this.billingThresholds = billingThresholds; + this.currentTrial = currentTrial; this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -4079,6 +4085,8 @@ public static Builder builder() { public static class Builder { private Object billingThresholds; + private CurrentTrial currentTrial; + private Object discounts; private Map extraParams; @@ -4101,6 +4109,7 @@ public static class Builder { public SubscriptionCreateParams.Item build() { return new SubscriptionCreateParams.Item( this.billingThresholds, + this.currentTrial, this.discounts, this.extraParams, this.metadata, @@ -4131,6 +4140,12 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { return this; } + /** The trial offer to apply to this subscription item. */ + public Builder setCurrentTrial(SubscriptionCreateParams.Item.CurrentTrial currentTrial) { + this.currentTrial = currentTrial; + return this; + } + /** * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link @@ -4391,6 +4406,101 @@ public Builder setUsageGte(Long usageGte) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CurrentTrial { + /** + * 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; + + /** + * Unix timestamp representing the end of the trial offer period. Required when the trial + * offer has {@code duration.type=timestamp}. Cannot be specified when {@code + * duration.type=relative}. + */ + @SerializedName("trial_end") + Long trialEnd; + + /** Required. The ID of the trial offer to apply to the subscription item. */ + @SerializedName("trial_offer") + String trialOffer; + + private CurrentTrial(Map extraParams, Long trialEnd, String trialOffer) { + this.extraParams = extraParams; + this.trialEnd = trialEnd; + this.trialOffer = trialOffer; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long trialEnd; + + private String trialOffer; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.Item.CurrentTrial build() { + return new SubscriptionCreateParams.Item.CurrentTrial( + this.extraParams, this.trialEnd, this.trialOffer); + } + + /** + * 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 SubscriptionCreateParams.Item.CurrentTrial#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 SubscriptionCreateParams.Item.CurrentTrial#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Unix timestamp representing the end of the trial offer period. Required when the trial + * offer has {@code duration.type=timestamp}. Cannot be specified when {@code + * duration.type=relative}. + */ + public Builder setTrialEnd(Long trialEnd) { + this.trialEnd = trialEnd; + return this; + } + + /** + * Required. The ID of the trial offer to apply to the subscription item. + */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { @@ -6250,7 +6360,7 @@ public Builder setRequestThreeDSecure( @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ @SerializedName("amount") Long amount; @@ -6310,7 +6420,7 @@ public static class Builder { .MandateOptions(this.amount, this.amountType, this.description, this.extraParams); } - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -7095,6 +7205,13 @@ public enum Purpose implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Pix { + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + /** * 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. @@ -7109,7 +7226,11 @@ public static class Pix { @SerializedName("mandate_options") MandateOptions mandateOptions; - private Pix(Map extraParams, MandateOptions mandateOptions) { + private Pix( + Long expiresAfterSeconds, + Map extraParams, + MandateOptions mandateOptions) { + this.expiresAfterSeconds = expiresAfterSeconds; this.extraParams = extraParams; this.mandateOptions = mandateOptions; } @@ -7119,6 +7240,8 @@ public static Builder builder() { } public static class Builder { + private Long expiresAfterSeconds; + private Map extraParams; private MandateOptions mandateOptions; @@ -7126,7 +7249,16 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Pix build() { return new SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Pix( - this.extraParams, this.mandateOptions); + this.expiresAfterSeconds, this.extraParams, this.mandateOptions); + } + + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + public Builder setExpiresAfterSeconds(Long expiresAfterSeconds) { + this.expiresAfterSeconds = expiresAfterSeconds; + return this; } /** @@ -7196,7 +7328,7 @@ public static class MandateOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ @SerializedName("payment_schedule") PaymentSchedule paymentSchedule; @@ -7295,7 +7427,7 @@ public Builder putAllExtraParam(Map map) { } /** - * Schedule at which the future payments will be charged. Defaults to {@code weekly}. + * Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ public Builder setPaymentSchedule( SubscriptionCreateParams.PaymentSettings.PaymentMethodOptions.Pix.MandateOptions @@ -8715,6 +8847,13 @@ public Builder putAllExtraParam(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class EndBehavior { + /** + * Indicates how the subscription's billing cycle anchor is reset when a trial ends. Defaults + * to {@code now}. + */ + @SerializedName("billing_cycle_anchor") + BillingCycleAnchor billingCycleAnchor; + /** * 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. @@ -8732,7 +8871,10 @@ public static class EndBehavior { MissingPaymentMethod missingPaymentMethod; private EndBehavior( - Map extraParams, MissingPaymentMethod missingPaymentMethod) { + BillingCycleAnchor billingCycleAnchor, + Map extraParams, + MissingPaymentMethod missingPaymentMethod) { + this.billingCycleAnchor = billingCycleAnchor; this.extraParams = extraParams; this.missingPaymentMethod = missingPaymentMethod; } @@ -8742,6 +8884,8 @@ public static Builder builder() { } public static class Builder { + private BillingCycleAnchor billingCycleAnchor; + private Map extraParams; private MissingPaymentMethod missingPaymentMethod; @@ -8749,7 +8893,18 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionCreateParams.TrialSettings.EndBehavior build() { return new SubscriptionCreateParams.TrialSettings.EndBehavior( - this.extraParams, this.missingPaymentMethod); + this.billingCycleAnchor, this.extraParams, this.missingPaymentMethod); + } + + /** + * Indicates how the subscription's billing cycle anchor is reset when a trial ends. + * Defaults to {@code now}. + */ + public Builder setBillingCycleAnchor( + SubscriptionCreateParams.TrialSettings.EndBehavior.BillingCycleAnchor + billingCycleAnchor) { + this.billingCycleAnchor = billingCycleAnchor; + return this; } /** @@ -8792,6 +8947,21 @@ public Builder setMissingPaymentMethod( } } + public enum BillingCycleAnchor implements ApiRequestParams.EnumParam { + @SerializedName("now") + NOW("now"), + + @SerializedName("unchanged") + UNCHANGED("unchanged"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + BillingCycleAnchor(String value) { + this.value = value; + } + } + public enum MissingPaymentMethod implements ApiRequestParams.EnumParam { @SerializedName("cancel") CANCEL("cancel"), diff --git a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java index 0731bd57c1c..a97ca03cdba 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java @@ -22,6 +22,10 @@ public class SubscriptionItemCreateParams extends ApiRequestParams { @SerializedName("billing_thresholds") Object billingThresholds; + /** The trial offer to apply to this subscription item. */ + @SerializedName("current_trial") + CurrentTrial currentTrial; + /** The coupons to redeem into discounts for the subscription item. */ @SerializedName("discounts") Object discounts; @@ -107,7 +111,7 @@ public class SubscriptionItemCreateParams extends ApiRequestParams { /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ @SerializedName("proration_date") Long prorationDate; @@ -136,6 +140,7 @@ public class SubscriptionItemCreateParams extends ApiRequestParams { private SubscriptionItemCreateParams( Object billingThresholds, + CurrentTrial currentTrial, Object discounts, List expand, Map extraParams, @@ -151,6 +156,7 @@ private SubscriptionItemCreateParams( Object taxRates, Trial trial) { this.billingThresholds = billingThresholds; + this.currentTrial = currentTrial; this.discounts = discounts; this.expand = expand; this.extraParams = extraParams; @@ -174,6 +180,8 @@ public static Builder builder() { public static class Builder { private Object billingThresholds; + private CurrentTrial currentTrial; + private Object discounts; private List expand; @@ -206,6 +214,7 @@ public static class Builder { public SubscriptionItemCreateParams build() { return new SubscriptionItemCreateParams( this.billingThresholds, + this.currentTrial, this.discounts, this.expand, this.extraParams, @@ -241,6 +250,12 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { return this; } + /** The trial offer to apply to this subscription item. */ + public Builder setCurrentTrial(SubscriptionItemCreateParams.CurrentTrial currentTrial) { + this.currentTrial = currentTrial; + return this; + } + /** * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link @@ -430,7 +445,7 @@ public Builder setProrationBehavior( /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ public Builder setProrationDate(Long prorationDate) { this.prorationDate = prorationDate; @@ -588,6 +603,97 @@ public Builder setUsageGte(Long usageGte) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CurrentTrial { + /** + * 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; + + /** + * Unix timestamp representing the end of the trial offer period. Required when the trial offer + * has {@code duration.type=timestamp}. Cannot be specified when {@code duration.type=relative}. + */ + @SerializedName("trial_end") + Long trialEnd; + + /** Required. The ID of the trial offer to apply to the subscription item. */ + @SerializedName("trial_offer") + String trialOffer; + + private CurrentTrial(Map extraParams, Long trialEnd, String trialOffer) { + this.extraParams = extraParams; + this.trialEnd = trialEnd; + this.trialOffer = trialOffer; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long trialEnd; + + private String trialOffer; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionItemCreateParams.CurrentTrial build() { + return new SubscriptionItemCreateParams.CurrentTrial( + this.extraParams, this.trialEnd, this.trialOffer); + } + + /** + * 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 + * SubscriptionItemCreateParams.CurrentTrial#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 SubscriptionItemCreateParams.CurrentTrial#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Unix timestamp representing the end of the trial offer period. Required when the trial + * offer has {@code duration.type=timestamp}. Cannot be specified when {@code + * duration.type=relative}. + */ + public Builder setTrialEnd(Long trialEnd) { + this.trialEnd = trialEnd; + return this; + } + + /** Required. The ID of the trial offer to apply to the subscription item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { diff --git a/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java b/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java index e4dd97fd49f..b120672bf05 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java @@ -71,7 +71,7 @@ public class SubscriptionItemDeleteParams extends ApiRequestParams { /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ @SerializedName("proration_date") Long prorationDate; @@ -199,7 +199,7 @@ public Builder setProrationBehavior( /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ public Builder setProrationDate(Long prorationDate) { this.prorationDate = prorationDate; diff --git a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java index a6b97c1b80b..1fa32ea4574 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java @@ -22,6 +22,10 @@ public class SubscriptionItemUpdateParams extends ApiRequestParams { @SerializedName("billing_thresholds") Object billingThresholds; + /** The trial offer to apply to this subscription item. */ + @SerializedName("current_trial") + CurrentTrial currentTrial; + /** The coupons to redeem into discounts for the subscription item. */ @SerializedName("discounts") Object discounts; @@ -118,7 +122,7 @@ public class SubscriptionItemUpdateParams extends ApiRequestParams { /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ @SerializedName("proration_date") Long prorationDate; @@ -139,6 +143,7 @@ public class SubscriptionItemUpdateParams extends ApiRequestParams { private SubscriptionItemUpdateParams( Object billingThresholds, + CurrentTrial currentTrial, Object discounts, List expand, Map extraParams, @@ -153,6 +158,7 @@ private SubscriptionItemUpdateParams( Long quantity, Object taxRates) { this.billingThresholds = billingThresholds; + this.currentTrial = currentTrial; this.discounts = discounts; this.expand = expand; this.extraParams = extraParams; @@ -175,6 +181,8 @@ public static Builder builder() { public static class Builder { private Object billingThresholds; + private CurrentTrial currentTrial; + private Object discounts; private List expand; @@ -205,6 +213,7 @@ public static class Builder { public SubscriptionItemUpdateParams build() { return new SubscriptionItemUpdateParams( this.billingThresholds, + this.currentTrial, this.discounts, this.expand, this.extraParams, @@ -239,6 +248,12 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { return this; } + /** The trial offer to apply to this subscription item. */ + public Builder setCurrentTrial(SubscriptionItemUpdateParams.CurrentTrial currentTrial) { + this.currentTrial = currentTrial; + return this; + } + /** * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link @@ -481,7 +496,7 @@ public Builder setProrationBehavior( /** * If set, the proration will be calculated as though the subscription was updated at the given * time. This can be used to apply the same proration that was previewed with the upcoming invoice endpoint. + * href="https://stripe.com/api/invoices/create_preview">upcoming invoice endpoint. */ public Builder setProrationDate(Long prorationDate) { this.prorationDate = prorationDate; @@ -627,6 +642,103 @@ public Builder setUsageGte(Long usageGte) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CurrentTrial { + /** + * 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; + + /** + * Unix timestamp representing the end of the trial offer period. Required when the trial offer + * has {@code duration.type=timestamp}. Cannot be specified when {@code duration.type=relative}. + */ + @SerializedName("trial_end") + Long trialEnd; + + /** Required. The ID of the trial offer to apply to the subscription item. */ + @SerializedName("trial_offer") + Object trialOffer; + + private CurrentTrial(Map extraParams, Long trialEnd, Object trialOffer) { + this.extraParams = extraParams; + this.trialEnd = trialEnd; + this.trialOffer = trialOffer; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long trialEnd; + + private Object trialOffer; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionItemUpdateParams.CurrentTrial build() { + return new SubscriptionItemUpdateParams.CurrentTrial( + this.extraParams, this.trialEnd, this.trialOffer); + } + + /** + * 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 + * SubscriptionItemUpdateParams.CurrentTrial#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 SubscriptionItemUpdateParams.CurrentTrial#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Unix timestamp representing the end of the trial offer period. Required when the trial + * offer has {@code duration.type=timestamp}. Cannot be specified when {@code + * duration.type=relative}. + */ + public Builder setTrialEnd(Long trialEnd) { + this.trialEnd = trialEnd; + return this; + } + + /** Required. The ID of the trial offer to apply to the subscription item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } + + /** Required. The ID of the trial offer to apply to the subscription item. */ + public Builder setTrialOffer(EmptyParam trialOffer) { + this.trialOffer = trialOffer; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java index 039df9a120e..2cdc09f23bf 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java @@ -1989,6 +1989,10 @@ public static class Add { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + private Add( List discounts, Map extraParams, @@ -1996,7 +2000,8 @@ private Add( String price, Long quantity, List taxRates, - Trial trial) { + Trial trial, + String trialOffer) { this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -2004,6 +2009,7 @@ private Add( this.quantity = quantity; this.taxRates = taxRates; this.trial = trial; + this.trialOffer = trialOffer; } public static Builder builder() { @@ -2025,6 +2031,8 @@ public static class Builder { private Trial trial; + private String trialOffer; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleAmendParams.Amendment.ItemAction.Add build() { return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Add( @@ -2034,7 +2042,8 @@ public SubscriptionScheduleAmendParams.Amendment.ItemAction.Add build() { this.price, this.quantity, this.taxRates, - this.trial); + this.trial, + this.trialOffer); } /** @@ -2169,6 +2178,12 @@ public Builder setTrial( this.trial = trial; return this; } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } } @Getter @@ -2818,6 +2833,10 @@ public static class Set { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + private Set( List discounts, Map extraParams, @@ -2825,7 +2844,8 @@ private Set( String price, Long quantity, List taxRates, - Trial trial) { + Trial trial, + String trialOffer) { this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -2833,6 +2853,7 @@ private Set( this.quantity = quantity; this.taxRates = taxRates; this.trial = trial; + this.trialOffer = trialOffer; } public static Builder builder() { @@ -2854,6 +2875,8 @@ public static class Builder { private Trial trial; + private String trialOffer; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleAmendParams.Amendment.ItemAction.Set build() { return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Set( @@ -2863,7 +2886,8 @@ public SubscriptionScheduleAmendParams.Amendment.ItemAction.Set build() { this.price, this.quantity, this.taxRates, - this.trial); + this.trial, + this.trialOffer); } /** @@ -3007,6 +3031,12 @@ public Builder setTrial( this.trial = trial; return this; } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } } @Getter @@ -3863,7 +3893,7 @@ public Builder setType( public static class Set { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ @SerializedName("behavior") Behavior behavior; @@ -3900,7 +3930,7 @@ public SubscriptionScheduleAmendParams.Amendment.SetPauseCollection.Set build() /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ public Builder setBehavior( SubscriptionScheduleAmendParams.Amendment.SetPauseCollection.Set.Behavior behavior) { diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java index 6354185a1d3..cace6e31ff3 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java @@ -4651,6 +4651,10 @@ public static class Item { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + String trialOffer; + private Item( Object billingThresholds, Object discounts, @@ -4661,7 +4665,8 @@ private Item( PriceData priceData, Long quantity, Object taxRates, - Trial trial) { + Trial trial, + String trialOffer) { this.billingThresholds = billingThresholds; this.discounts = discounts; this.extraParams = extraParams; @@ -4672,6 +4677,7 @@ private Item( this.quantity = quantity; this.taxRates = taxRates; this.trial = trial; + this.trialOffer = trialOffer; } public static Builder builder() { @@ -4699,6 +4705,8 @@ public static class Builder { private Trial trial; + private String trialOffer; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleCreateParams.Phase.Item build() { return new SubscriptionScheduleCreateParams.Phase.Item( @@ -4711,7 +4719,8 @@ public SubscriptionScheduleCreateParams.Phase.Item build() { this.priceData, this.quantity, this.taxRates, - this.trial); + this.trial, + this.trialOffer); } /** @@ -4923,6 +4932,12 @@ public Builder setTrial(SubscriptionScheduleCreateParams.Phase.Item.Trial trial) this.trial = trial; return this; } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } } @Getter @@ -5858,7 +5873,7 @@ public enum Type implements ApiRequestParams.EnumParam { public static class PauseCollection { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ @SerializedName("behavior") Behavior behavior; @@ -5894,7 +5909,7 @@ public SubscriptionScheduleCreateParams.Phase.PauseCollection build() { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ public Builder setBehavior( SubscriptionScheduleCreateParams.Phase.PauseCollection.Behavior behavior) { diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java index ffe33e2d3e5..a447eb17d95 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java @@ -4565,6 +4565,10 @@ public static class Item { @SerializedName("trial") Trial trial; + /** The ID of the trial offer to apply to the configuration item. */ + @SerializedName("trial_offer") + Object trialOffer; + private Item( Object billingThresholds, Object discounts, @@ -4575,7 +4579,8 @@ private Item( PriceData priceData, Long quantity, Object taxRates, - Trial trial) { + Trial trial, + Object trialOffer) { this.billingThresholds = billingThresholds; this.discounts = discounts; this.extraParams = extraParams; @@ -4586,6 +4591,7 @@ private Item( this.quantity = quantity; this.taxRates = taxRates; this.trial = trial; + this.trialOffer = trialOffer; } public static Builder builder() { @@ -4613,6 +4619,8 @@ public static class Builder { private Trial trial; + private Object trialOffer; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleUpdateParams.Phase.Item build() { return new SubscriptionScheduleUpdateParams.Phase.Item( @@ -4625,7 +4633,8 @@ public SubscriptionScheduleUpdateParams.Phase.Item build() { this.priceData, this.quantity, this.taxRates, - this.trial); + this.trial, + this.trialOffer); } /** @@ -4852,6 +4861,18 @@ public Builder setTrial(SubscriptionScheduleUpdateParams.Phase.Item.Trial trial) this.trial = trial; return this; } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } + + /** The ID of the trial offer to apply to the configuration item. */ + public Builder setTrialOffer(EmptyParam trialOffer) { + this.trialOffer = trialOffer; + return this; + } } @Getter @@ -5836,7 +5857,7 @@ public enum Type implements ApiRequestParams.EnumParam { public static class PauseCollection { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ @SerializedName("behavior") Behavior behavior; @@ -5872,7 +5893,7 @@ public SubscriptionScheduleUpdateParams.Phase.PauseCollection build() { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ public Builder setBehavior( SubscriptionScheduleUpdateParams.Phase.PauseCollection.Behavior behavior) { diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index 0060cc04405..962fcbbd60e 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -230,8 +230,8 @@ public class SubscriptionUpdateParams extends ApiRequestParams { /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ @SerializedName("pending_invoice_item_interval") Object pendingInvoiceItemInterval; @@ -1065,8 +1065,8 @@ public Builder setPaymentSettings(SubscriptionUpdateParams.PaymentSettings payme /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval( SubscriptionUpdateParams.PendingInvoiceItemInterval pendingInvoiceItemInterval) { @@ -1076,8 +1076,8 @@ public Builder setPendingInvoiceItemInterval( /** * Specifies an interval for how often to bill for any pending invoice items. It is analogous to - * calling Create an invoice for the - * given subscription at the specified interval. + * calling Create an invoice for the given + * subscription at the specified interval. */ public Builder setPendingInvoiceItemInterval(EmptyParam pendingInvoiceItemInterval) { this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; @@ -3934,6 +3934,10 @@ public static class Item { @SerializedName("clear_usage") Boolean clearUsage; + /** The trial offer to apply to this subscription item. */ + @SerializedName("current_trial") + CurrentTrial currentTrial; + /** A flag that, if set to {@code true}, will delete the specified item. */ @SerializedName("deleted") Boolean deleted; @@ -4000,6 +4004,7 @@ public static class Item { private Item( Object billingThresholds, Boolean clearUsage, + CurrentTrial currentTrial, Boolean deleted, Object discounts, Map extraParams, @@ -4012,6 +4017,7 @@ private Item( Object taxRates) { this.billingThresholds = billingThresholds; this.clearUsage = clearUsage; + this.currentTrial = currentTrial; this.deleted = deleted; this.discounts = discounts; this.extraParams = extraParams; @@ -4033,6 +4039,8 @@ public static class Builder { private Boolean clearUsage; + private CurrentTrial currentTrial; + private Boolean deleted; private Object discounts; @@ -4058,6 +4066,7 @@ public SubscriptionUpdateParams.Item build() { return new SubscriptionUpdateParams.Item( this.billingThresholds, this.clearUsage, + this.currentTrial, this.deleted, this.discounts, this.extraParams, @@ -4099,6 +4108,12 @@ public Builder setClearUsage(Boolean clearUsage) { return this; } + /** The trial offer to apply to this subscription item. */ + public Builder setCurrentTrial(SubscriptionUpdateParams.Item.CurrentTrial currentTrial) { + this.currentTrial = currentTrial; + return this; + } + /** A flag that, if set to {@code true}, will delete the specified item. */ public Builder setDeleted(Boolean deleted) { this.deleted = deleted; @@ -4415,6 +4430,109 @@ public Builder setUsageGte(Long usageGte) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CurrentTrial { + /** + * 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; + + /** + * Unix timestamp representing the end of the trial offer period. Required when the trial + * offer has {@code duration.type=timestamp}. Cannot be specified when {@code + * duration.type=relative}. + */ + @SerializedName("trial_end") + Long trialEnd; + + /** Required. The ID of the trial offer to apply to the subscription item. */ + @SerializedName("trial_offer") + Object trialOffer; + + private CurrentTrial(Map extraParams, Long trialEnd, Object trialOffer) { + this.extraParams = extraParams; + this.trialEnd = trialEnd; + this.trialOffer = trialOffer; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long trialEnd; + + private Object trialOffer; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.Item.CurrentTrial build() { + return new SubscriptionUpdateParams.Item.CurrentTrial( + this.extraParams, this.trialEnd, this.trialOffer); + } + + /** + * 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 SubscriptionUpdateParams.Item.CurrentTrial#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 SubscriptionUpdateParams.Item.CurrentTrial#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Unix timestamp representing the end of the trial offer period. Required when the trial + * offer has {@code duration.type=timestamp}. Cannot be specified when {@code + * duration.type=relative}. + */ + public Builder setTrialEnd(Long trialEnd) { + this.trialEnd = trialEnd; + return this; + } + + /** + * Required. The ID of the trial offer to apply to the subscription item. + */ + public Builder setTrialOffer(String trialOffer) { + this.trialOffer = trialOffer; + return this; + } + + /** + * Required. The ID of the trial offer to apply to the subscription item. + */ + public Builder setTrialOffer(EmptyParam trialOffer) { + this.trialOffer = trialOffer; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { @@ -5171,7 +5289,7 @@ public enum TaxBehavior implements ApiRequestParams.EnumParam { public static class PauseCollection { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ @SerializedName("behavior") Behavior behavior; @@ -5214,7 +5332,7 @@ public SubscriptionUpdateParams.PauseCollection build() { /** * Required. The payment collection behavior for this subscription while - * paused. One of {@code keep_as_draft}, {@code mark_uncollectible}, or {@code void}. + * paused. */ public Builder setBehavior(SubscriptionUpdateParams.PauseCollection.Behavior behavior) { this.behavior = behavior; @@ -6307,7 +6425,7 @@ public Builder setRequestThreeDSecure( @Getter @EqualsAndHashCode(callSuper = false) public static class MandateOptions { - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ @SerializedName("amount") Long amount; @@ -6367,7 +6485,7 @@ public static class Builder { .MandateOptions(this.amount, this.amountType, this.description, this.extraParams); } - /** Amount to be charged for future payments. */ + /** Amount to be charged for future payments, specified in the presentment currency. */ public Builder setAmount(Long amount) { this.amount = amount; return this; @@ -7190,6 +7308,13 @@ public enum Purpose implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Pix { + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + @SerializedName("expires_after_seconds") + Long expiresAfterSeconds; + /** * 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. @@ -7204,7 +7329,11 @@ public static class Pix { @SerializedName("mandate_options") MandateOptions mandateOptions; - private Pix(Map extraParams, MandateOptions mandateOptions) { + private Pix( + Long expiresAfterSeconds, + Map extraParams, + MandateOptions mandateOptions) { + this.expiresAfterSeconds = expiresAfterSeconds; this.extraParams = extraParams; this.mandateOptions = mandateOptions; } @@ -7214,6 +7343,8 @@ public static Builder builder() { } public static class Builder { + private Long expiresAfterSeconds; + private Map extraParams; private MandateOptions mandateOptions; @@ -7221,7 +7352,16 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Pix build() { return new SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Pix( - this.extraParams, this.mandateOptions); + this.expiresAfterSeconds, this.extraParams, this.mandateOptions); + } + + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. + * Defaults to 86400 seconds. + */ + public Builder setExpiresAfterSeconds(Long expiresAfterSeconds) { + this.expiresAfterSeconds = expiresAfterSeconds; + return this; } /** @@ -7291,7 +7431,7 @@ public static class MandateOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ @SerializedName("payment_schedule") PaymentSchedule paymentSchedule; @@ -7399,7 +7539,7 @@ public Builder putAllExtraParam(Map map) { } /** - * Schedule at which the future payments will be charged. Defaults to {@code weekly}. + * Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ public Builder setPaymentSchedule( SubscriptionUpdateParams.PaymentSettings.PaymentMethodOptions.Pix.MandateOptions @@ -8840,6 +8980,13 @@ public Builder putAllExtraParam(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class EndBehavior { + /** + * Indicates how the subscription's billing cycle anchor is reset when a trial ends. Defaults + * to {@code now}. + */ + @SerializedName("billing_cycle_anchor") + BillingCycleAnchor billingCycleAnchor; + /** * 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. @@ -8857,7 +9004,10 @@ public static class EndBehavior { MissingPaymentMethod missingPaymentMethod; private EndBehavior( - Map extraParams, MissingPaymentMethod missingPaymentMethod) { + BillingCycleAnchor billingCycleAnchor, + Map extraParams, + MissingPaymentMethod missingPaymentMethod) { + this.billingCycleAnchor = billingCycleAnchor; this.extraParams = extraParams; this.missingPaymentMethod = missingPaymentMethod; } @@ -8867,6 +9017,8 @@ public static Builder builder() { } public static class Builder { + private BillingCycleAnchor billingCycleAnchor; + private Map extraParams; private MissingPaymentMethod missingPaymentMethod; @@ -8874,7 +9026,18 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionUpdateParams.TrialSettings.EndBehavior build() { return new SubscriptionUpdateParams.TrialSettings.EndBehavior( - this.extraParams, this.missingPaymentMethod); + this.billingCycleAnchor, this.extraParams, this.missingPaymentMethod); + } + + /** + * Indicates how the subscription's billing cycle anchor is reset when a trial ends. + * Defaults to {@code now}. + */ + public Builder setBillingCycleAnchor( + SubscriptionUpdateParams.TrialSettings.EndBehavior.BillingCycleAnchor + billingCycleAnchor) { + this.billingCycleAnchor = billingCycleAnchor; + return this; } /** @@ -8917,6 +9080,21 @@ public Builder setMissingPaymentMethod( } } + public enum BillingCycleAnchor implements ApiRequestParams.EnumParam { + @SerializedName("now") + NOW("now"), + + @SerializedName("unchanged") + UNCHANGED("unchanged"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + BillingCycleAnchor(String value) { + this.value = value; + } + } + public enum MissingPaymentMethod implements ApiRequestParams.EnumParam { @SerializedName("cancel") CANCEL("cancel"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index 02630970994..40dbe716deb 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -645,7 +645,10 @@ public enum ApiVersion implements ApiRequestParams.EnumParam { VERSION_2026_01_28_CLOVER("2026-01-28.clover"), @SerializedName("2026-02-25.clover") - VERSION_2026_02_25_CLOVER("2026-02-25.clover"); + VERSION_2026_02_25_CLOVER("2026-02-25.clover"), + + @SerializedName("2026-03-25.dahlia") + VERSION_2026_03_25_DAHLIA("2026-03-25.dahlia"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 84a7e0a8c35..44489749066 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -196,6 +196,13 @@ public class SessionCreateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The integration identifier for this Checkout Session. Multiple Checkout Sessions can have the + * same integration identifier. + */ + @SerializedName("integration_identifier") + String integrationIdentifier; + /** Generate a post-purchase Invoice for one-time payments. */ @SerializedName("invoice_creation") InvoiceCreation invoiceCreation; @@ -465,6 +472,7 @@ private SessionCreateParams( List expand, Long expiresAt, Map extraParams, + String integrationIdentifier, InvoiceCreation invoiceCreation, List lineItems, Locale locale, @@ -516,6 +524,7 @@ private SessionCreateParams( this.expand = expand; this.expiresAt = expiresAt; this.extraParams = extraParams; + this.integrationIdentifier = integrationIdentifier; this.invoiceCreation = invoiceCreation; this.lineItems = lineItems; this.locale = locale; @@ -596,6 +605,8 @@ public static class Builder { private Map extraParams; + private String integrationIdentifier; + private InvoiceCreation invoiceCreation; private List lineItems; @@ -679,6 +690,7 @@ public SessionCreateParams build() { this.expand, this.expiresAt, this.extraParams, + this.integrationIdentifier, this.invoiceCreation, this.lineItems, this.locale, @@ -1022,6 +1034,15 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The integration identifier for this Checkout Session. Multiple Checkout Sessions can have the + * same integration identifier. + */ + public Builder setIntegrationIdentifier(String integrationIdentifier) { + this.integrationIdentifier = integrationIdentifier; + return this; + } + /** Generate a post-purchase Invoice for one-time payments. */ public Builder setInvoiceCreation(SessionCreateParams.InvoiceCreation invoiceCreation) { this.invoiceCreation = invoiceCreation; @@ -5706,6 +5727,14 @@ public static class ProductData { @SerializedName("tax_code") String taxCode; + /** + * Tax details for this product, including the tax code and an optional performance + * location. + */ + @SerializedName("tax_details") + TaxDetails taxDetails; + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -5720,6 +5749,7 @@ private ProductData( Map metadata, String name, String taxCode, + TaxDetails taxDetails, String unitLabel) { this.description = description; this.extraParams = extraParams; @@ -5727,6 +5757,7 @@ private ProductData( this.metadata = metadata; this.name = name; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.unitLabel = unitLabel; } @@ -5747,6 +5778,8 @@ public static class Builder { private String taxCode; + private TaxDetails taxDetails; + private String unitLabel; /** Finalize and obtain parameter instance from this builder. */ @@ -5758,6 +5791,7 @@ public SessionCreateParams.LineItem.PriceData.ProductData build() { this.metadata, this.name, this.taxCode, + this.taxDetails, this.unitLabel); } @@ -5867,6 +5901,17 @@ public Builder setTaxCode(String taxCode) { return this; } + /** + * Tax details for this product, including the tax code and an optional performance + * location. + */ + public Builder setTaxDetails( + SessionCreateParams.LineItem.PriceData.ProductData.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -5876,6 +5921,109 @@ public Builder setUnitLabel(String unitLabel) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + private TaxDetails( + Map extraParams, String performanceLocation, Object taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String performanceLocation; + + private Object taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.LineItem.PriceData.ProductData.TaxDetails build() { + return new SessionCreateParams.LineItem.PriceData.ProductData.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SessionCreateParams.LineItem.PriceData.ProductData.TaxDetails#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SessionCreateParams.LineItem.PriceData.ProductData.TaxDetails#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(EmptyParam taxCode) { + this.taxCode = taxCode; + return this; + } + } + } } @Getter @@ -7592,6 +7740,10 @@ public static class PaymentMethodOptions { @SerializedName("cashapp") Cashapp cashapp; + /** contains details about the Crypto payment method options. */ + @SerializedName("crypto") + Crypto crypto; + /** contains details about the Customer Balance payment method options. */ @SerializedName("customer_balance") CustomerBalance customerBalance; @@ -7721,6 +7873,10 @@ public static class PaymentMethodOptions { @SerializedName("twint") Twint twint; + /** contains details about the UPI payment method options. */ + @SerializedName("upi") + Upi upi; + /** contains details about the Us Bank Account payment method options. */ @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -7743,6 +7899,7 @@ private PaymentMethodOptions( Boleto boleto, Card card, Cashapp cashapp, + Crypto crypto, CustomerBalance customerBalance, DemoPay demoPay, Eps eps, @@ -7774,6 +7931,7 @@ private PaymentMethodOptions( Sofort sofort, Swish swish, Twint twint, + Upi upi, UsBankAccount usBankAccount, WechatPay wechatPay) { this.acssDebit = acssDebit; @@ -7789,6 +7947,7 @@ private PaymentMethodOptions( this.boleto = boleto; this.card = card; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.demoPay = demoPay; this.eps = eps; @@ -7820,6 +7979,7 @@ private PaymentMethodOptions( this.sofort = sofort; this.swish = swish; this.twint = twint; + this.upi = upi; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; } @@ -7855,6 +8015,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private DemoPay demoPay; @@ -7917,6 +8079,8 @@ public static class Builder { private Twint twint; + private Upi upi; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -7937,6 +8101,7 @@ public SessionCreateParams.PaymentMethodOptions build() { this.boleto, this.card, this.cashapp, + this.crypto, this.customerBalance, this.demoPay, this.eps, @@ -7968,6 +8133,7 @@ public SessionCreateParams.PaymentMethodOptions build() { this.sofort, this.swish, this.twint, + this.upi, this.usBankAccount, this.wechatPay); } @@ -8055,6 +8221,12 @@ public Builder setCashapp(SessionCreateParams.PaymentMethodOptions.Cashapp casha return this; } + /** contains details about the Crypto payment method options. */ + public Builder setCrypto(SessionCreateParams.PaymentMethodOptions.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** contains details about the Customer Balance payment method options. */ public Builder setCustomerBalance( SessionCreateParams.PaymentMethodOptions.CustomerBalance customerBalance) { @@ -8263,6 +8435,12 @@ public Builder setTwint(SessionCreateParams.PaymentMethodOptions.Twint twint) { return this; } + /** contains details about the UPI payment method options. */ + public Builder setUpi(SessionCreateParams.PaymentMethodOptions.Upi upi) { + this.upi = upi; + return this; + } + /** contains details about the Us Bank Account payment method options. */ public Builder setUsBankAccount( SessionCreateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { @@ -11053,6 +11231,128 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * 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; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

If you provide a Customer with the PaymentIntent, you can use this parameter to attach the payment method to the + * Customer after the PaymentIntent is confirmed and the customer completes any required + * actions. If you don't provide a Customer, you can still attach the payment method to a + * Customer after the transaction completes. + * + *

If the payment method is {@code card_present} and isn't a digital wallet, Stripe creates + * and attaches a generated_card + * payment method representing the card to the Customer instead. + * + *

When processing card payments, Stripe uses {@code setup_future_usage} to help you comply + * with regional legislation and network rules, such as SCA. + */ + @SerializedName("setup_future_usage") + SetupFutureUsage setupFutureUsage; + + private Crypto(Map extraParams, SetupFutureUsage setupFutureUsage) { + this.extraParams = extraParams; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private SetupFutureUsage setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.PaymentMethodOptions.Crypto build() { + return new SessionCreateParams.PaymentMethodOptions.Crypto( + this.extraParams, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SessionCreateParams.PaymentMethodOptions.Crypto#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SessionCreateParams.PaymentMethodOptions.Crypto#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment + * method. + * + *

If you provide a Customer with the PaymentIntent, you can use this parameter to attach the payment method to + * the Customer after the PaymentIntent is confirmed and the customer completes any required + * actions. If you don't provide a Customer, you can still attach the payment method to a + * Customer after the transaction completes. + * + *

If the payment method is {@code card_present} and isn't a digital wallet, Stripe + * creates and attaches a generated_card + * payment method representing the card to the Customer instead. + * + *

When processing card payments, Stripe uses {@code setup_future_usage} to help you + * comply with regional legislation and network rules, such as SCA. + */ + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Crypto.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -15438,7 +15738,7 @@ public static class MandateOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ @SerializedName("payment_schedule") PaymentSchedule paymentSchedule; @@ -15587,7 +15887,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Schedule at which the future payments will be charged. Defaults to {@code weekly}. */ + /** Schedule at which the future payments will be charged. Defaults to {@code monthly}. */ public Builder setPaymentSchedule( SessionCreateParams.PaymentMethodOptions.Pix.MandateOptions.PaymentSchedule paymentSchedule) { @@ -16608,7 +16908,7 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class UsBankAccount { + public static class Upi { /** * 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. @@ -16618,43 +16918,303 @@ public static class UsBankAccount { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Additional fields for Financial Connections Session creation. */ - @SerializedName("financial_connections") - FinancialConnections financialConnections; + /** Additional fields for Mandate creation. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - *

If you provide a Customer with the PaymentIntent, you can use this parameter to attach the payment method to the - * Customer after the PaymentIntent is confirmed and the customer completes any required - * actions. If you don't provide a Customer, you can still attach the payment method to a - * Customer after the transaction completes. - * - *

If the payment method is {@code card_present} and isn't a digital wallet, Stripe creates - * and attaches a generated_card - * payment method representing the card to the Customer instead. - * - *

When processing card payments, Stripe uses {@code setup_future_usage} to help you comply - * with regional legislation and network rules, such as SCA. - */ @SerializedName("setup_future_usage") - SetupFutureUsage setupFutureUsage; - - /** - * Controls when Stripe will attempt to debit the funds from the customer's account. The date - * must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 - * calendar days from now. - */ - @SerializedName("target_date") - String targetDate; - - /** Verification method for the intent. */ - @SerializedName("verification_method") - VerificationMethod verificationMethod; + ApiRequestParams.EnumParam setupFutureUsage; + + private Upi( + Map extraParams, + MandateOptions mandateOptions, + ApiRequestParams.EnumParam setupFutureUsage) { + this.extraParams = extraParams; + this.mandateOptions = mandateOptions; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private MandateOptions mandateOptions; + + private ApiRequestParams.EnumParam setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.PaymentMethodOptions.Upi build() { + return new SessionCreateParams.PaymentMethodOptions.Upi( + this.extraParams, this.mandateOptions, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SessionCreateParams.PaymentMethodOptions.Upi#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SessionCreateParams.PaymentMethodOptions.Upi#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Additional fields for Mandate creation. */ + public Builder setMandateOptions( + SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Upi.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + + public Builder setSetupFutureUsage(EmptyParam setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions { + /** Amount to be charged for future payments. */ + @SerializedName("amount") + Long amount; + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + @SerializedName("amount_type") + AmountType amountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + @SerializedName("description") + String description; + + /** End date of the mandate or subscription. */ + @SerializedName("end_date") + Long endDate; + + /** + * 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 MandateOptions( + Long amount, + AmountType amountType, + String description, + Long endDate, + Map extraParams) { + this.amount = amount; + this.amountType = amountType; + this.description = description; + this.endDate = endDate; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private AmountType amountType; + + private String description; + + private Long endDate; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions build() { + return new SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions( + this.amount, this.amountType, this.description, this.endDate, this.extraParams); + } + + /** Amount to be charged for future payments. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param + * refers to the exact amount to be charged in future payments. If {@code maximum}, the + * amount charged can be up to the value passed for the {@code amount} param. + */ + public Builder setAmountType( + SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions.AmountType amountType) { + this.amountType = amountType; + return this; + } + + /** + * A description of the mandate or subscription that is meant to be displayed to the + * customer. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** End date of the mandate or subscription. */ + public Builder setEndDate(Long endDate) { + this.endDate = endDate; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SessionCreateParams.PaymentMethodOptions.Upi.MandateOptions#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 AmountType implements ApiRequestParams.EnumParam { + @SerializedName("fixed") + FIXED("fixed"), + + @SerializedName("maximum") + MAXIMUM("maximum"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountType(String value) { + this.value = value; + } + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class UsBankAccount { + /** + * 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; + + /** Additional fields for Financial Connections Session creation. */ + @SerializedName("financial_connections") + FinancialConnections financialConnections; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

If you provide a Customer with the PaymentIntent, you can use this parameter to attach the payment method to the + * Customer after the PaymentIntent is confirmed and the customer completes any required + * actions. If you don't provide a Customer, you can still attach the payment method to a + * Customer after the transaction completes. + * + *

If the payment method is {@code card_present} and isn't a digital wallet, Stripe creates + * and attaches a generated_card + * payment method representing the card to the Customer instead. + * + *

When processing card payments, Stripe uses {@code setup_future_usage} to help you comply + * with regional legislation and network rules, such as SCA. + */ + @SerializedName("setup_future_usage") + SetupFutureUsage setupFutureUsage; + + /** + * Controls when Stripe will attempt to debit the funds from the customer's account. The date + * must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 + * calendar days from now. + */ + @SerializedName("target_date") + String targetDate; + + /** Verification method for the intent. */ + @SerializedName("verification_method") + VerificationMethod verificationMethod; private UsBankAccount( Map extraParams, @@ -19809,6 +20369,14 @@ public static class SubscriptionData { @SerializedName("on_behalf_of") String onBehalfOf; + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to + * calling Create an invoice for the + * given subscription at the specified interval. + */ + @SerializedName("pending_invoice_item_interval") + PendingInvoiceItemInterval pendingInvoiceItemInterval; + /** * Determines how to handle prorations resulting from the {@code billing_cycle_anchor}. If no * value is passed, the default is {@code create_prorations}. @@ -19851,6 +20419,7 @@ private SubscriptionData( InvoiceSettings invoiceSettings, Map metadata, String onBehalfOf, + PendingInvoiceItemInterval pendingInvoiceItemInterval, ProrationBehavior prorationBehavior, TransferData transferData, Long trialEnd, @@ -19865,6 +20434,7 @@ private SubscriptionData( this.invoiceSettings = invoiceSettings; this.metadata = metadata; this.onBehalfOf = onBehalfOf; + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; this.prorationBehavior = prorationBehavior; this.transferData = transferData; this.trialEnd = trialEnd; @@ -19895,6 +20465,8 @@ public static class Builder { private String onBehalfOf; + private PendingInvoiceItemInterval pendingInvoiceItemInterval; + private ProrationBehavior prorationBehavior; private TransferData transferData; @@ -19917,6 +20489,7 @@ public SessionCreateParams.SubscriptionData build() { this.invoiceSettings, this.metadata, this.onBehalfOf, + this.pendingInvoiceItemInterval, this.prorationBehavior, this.transferData, this.trialEnd, @@ -20053,6 +20626,18 @@ public Builder setOnBehalfOf(String onBehalfOf) { return this; } + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous + * to calling Create an invoice for + * the given subscription at the specified interval. + */ + public Builder setPendingInvoiceItemInterval( + SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval + pendingInvoiceItemInterval) { + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; + return this; + } + /** * Determines how to handle prorations resulting from the {@code billing_cycle_anchor}. If no * value is passed, the default is {@code create_prorations}. @@ -20483,6 +21068,130 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PendingInvoiceItemInterval { + /** + * 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. Specifies invoicing frequency. Either {@code day}, {@code week}, + * {@code month} or {@code year}. + */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals between invoices. For example, {@code interval=month} and {@code + * interval_count=3} bills every 3 months. Maximum of one year interval allowed (1 year, 12 + * months, or 52 weeks). + */ + @SerializedName("interval_count") + Long intervalCount; + + private PendingInvoiceItemInterval( + Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval build() { + return new SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval( + this.extraParams, this.interval, this.intervalCount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval#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. Specifies invoicing frequency. Either {@code day}, {@code + * week}, {@code month} or {@code year}. + */ + public Builder setInterval( + SessionCreateParams.SubscriptionData.PendingInvoiceItemInterval.Interval interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals between invoices. For example, {@code interval=month} and {@code + * interval_count=3} bills every 3 months. Maximum of one year interval allowed (1 year, 12 + * months, or 52 weeks). + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class TransferData { @@ -21231,6 +21940,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -21585,6 +22297,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("twint") TWINT("twint"), + @SerializedName("upi") + UPI("upi"), + @SerializedName("us_bank_account") US_BANK_ACCOUNT("us_bank_account"), @@ -21645,14 +22360,17 @@ public enum SubmitType implements ApiRequestParams.EnumParam { } public enum UiMode implements ApiRequestParams.EnumParam { - @SerializedName("custom") - CUSTOM("custom"), + @SerializedName("elements") + ELEMENTS("elements"), + + @SerializedName("embedded_page") + EMBEDDED_PAGE("embedded_page"), - @SerializedName("embedded") - EMBEDDED("embedded"), + @SerializedName("form") + FORM("form"), - @SerializedName("hosted") - HOSTED("hosted"); + @SerializedName("hosted_page") + HOSTED_PAGE("hosted_page"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java b/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java index f2eefb63789..ab0ba8bb577 100644 --- a/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java @@ -2286,6 +2286,14 @@ public static class ProductData { @SerializedName("tax_code") Object taxCode; + /** + * Tax details for this product, including the tax code and an optional performance + * location. + */ + @SerializedName("tax_details") + TaxDetails taxDetails; + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -2300,6 +2308,7 @@ private ProductData( Map metadata, Object name, Object taxCode, + TaxDetails taxDetails, Object unitLabel) { this.description = description; this.extraParams = extraParams; @@ -2307,6 +2316,7 @@ private ProductData( this.metadata = metadata; this.name = name; this.taxCode = taxCode; + this.taxDetails = taxDetails; this.unitLabel = unitLabel; } @@ -2327,6 +2337,8 @@ public static class Builder { private Object taxCode; + private TaxDetails taxDetails; + private Object unitLabel; /** Finalize and obtain parameter instance from this builder. */ @@ -2338,6 +2350,7 @@ public SessionUpdateParams.LineItem.PriceData.ProductData build() { this.metadata, this.name, this.taxCode, + this.taxDetails, this.unitLabel); } @@ -2471,6 +2484,17 @@ public Builder setTaxCode(EmptyParam taxCode) { return this; } + /** + * Tax details for this product, including the tax code and an optional performance + * location. + */ + public Builder setTaxDetails( + SessionUpdateParams.LineItem.PriceData.ProductData.TaxDetails taxDetails) { + this.taxDetails = taxDetails; + return this; + } + /** * A label that represents units of this product. When set, this will be included in * customers' receipts, invoices, Checkout, and the customer portal. @@ -2489,6 +2513,119 @@ public Builder setUnitLabel(EmptyParam unitLabel) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxDetails { + /** + * 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 tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + Object performanceLocation; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + private TaxDetails( + Map extraParams, Object performanceLocation, Object taxCode) { + this.extraParams = extraParams; + this.performanceLocation = performanceLocation; + this.taxCode = taxCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object performanceLocation; + + private Object taxCode; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionUpdateParams.LineItem.PriceData.ProductData.TaxDetails build() { + return new SessionUpdateParams.LineItem.PriceData.ProductData.TaxDetails( + this.extraParams, this.performanceLocation, this.taxCode); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SessionUpdateParams.LineItem.PriceData.ProductData.TaxDetails#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 + * SessionUpdateParams.LineItem.PriceData.ProductData.TaxDetails#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(EmptyParam performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** A tax code ID. */ + public Builder setTaxCode(EmptyParam taxCode) { + this.taxCode = taxCode; + return this; + } + } + } } @Getter @@ -3639,6 +3776,14 @@ public static class SubscriptionData { @SerializedName("invoice_settings") InvoiceSettings invoiceSettings; + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to + * calling Create an invoice for the + * given subscription at the specified interval. + */ + @SerializedName("pending_invoice_item_interval") + Object pendingInvoiceItemInterval; + /** * Unix timestamp representing the end of the trial period the customer will get before being * charged for the first time. Has to be at least 48 hours in the future. @@ -3656,10 +3801,12 @@ public static class SubscriptionData { private SubscriptionData( Map extraParams, InvoiceSettings invoiceSettings, + Object pendingInvoiceItemInterval, Long trialEnd, Object trialPeriodDays) { this.extraParams = extraParams; this.invoiceSettings = invoiceSettings; + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; this.trialEnd = trialEnd; this.trialPeriodDays = trialPeriodDays; } @@ -3673,6 +3820,8 @@ public static class Builder { private InvoiceSettings invoiceSettings; + private Object pendingInvoiceItemInterval; + private Long trialEnd; private Object trialPeriodDays; @@ -3680,7 +3829,11 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SessionUpdateParams.SubscriptionData build() { return new SessionUpdateParams.SubscriptionData( - this.extraParams, this.invoiceSettings, this.trialEnd, this.trialPeriodDays); + this.extraParams, + this.invoiceSettings, + this.pendingInvoiceItemInterval, + this.trialEnd, + this.trialPeriodDays); } /** @@ -3716,6 +3869,28 @@ public Builder setInvoiceSettings( return this; } + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous + * to calling Create an invoice for + * the given subscription at the specified interval. + */ + public Builder setPendingInvoiceItemInterval( + SessionUpdateParams.SubscriptionData.PendingInvoiceItemInterval + pendingInvoiceItemInterval) { + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; + return this; + } + + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous + * to calling Create an invoice for + * the given subscription at the specified interval. + */ + public Builder setPendingInvoiceItemInterval(EmptyParam pendingInvoiceItemInterval) { + this.pendingInvoiceItemInterval = pendingInvoiceItemInterval; + return this; + } + /** * Unix timestamp representing the end of the trial period the customer will get before being * charged for the first time. Has to be at least 48 hours in the future. @@ -3932,5 +4107,129 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PendingInvoiceItemInterval { + /** + * 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. Specifies invoicing frequency. Either {@code day}, {@code week}, + * {@code month} or {@code year}. + */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals between invoices. For example, {@code interval=month} and {@code + * interval_count=3} bills every 3 months. Maximum of one year interval allowed (1 year, 12 + * months, or 52 weeks). + */ + @SerializedName("interval_count") + Long intervalCount; + + private PendingInvoiceItemInterval( + Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionUpdateParams.SubscriptionData.PendingInvoiceItemInterval build() { + return new SessionUpdateParams.SubscriptionData.PendingInvoiceItemInterval( + this.extraParams, this.interval, this.intervalCount); + } + + /** + * 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 + * SessionUpdateParams.SubscriptionData.PendingInvoiceItemInterval#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 + * SessionUpdateParams.SubscriptionData.PendingInvoiceItemInterval#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. Specifies invoicing frequency. Either {@code day}, {@code + * week}, {@code month} or {@code year}. + */ + public Builder setInterval( + SessionUpdateParams.SubscriptionData.PendingInvoiceItemInterval.Interval interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals between invoices. For example, {@code interval=month} and {@code + * interval_count=3} bills every 3 months. Maximum of one year interval allowed (1 year, 12 + * months, or 52 weeks). + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } } } diff --git a/src/main/java/com/stripe/param/financialconnections/SessionCreateParams.java b/src/main/java/com/stripe/param/financialconnections/SessionCreateParams.java index c2a38e70062..d586e8157fb 100644 --- a/src/main/java/com/stripe/param/financialconnections/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/financialconnections/SessionCreateParams.java @@ -34,6 +34,10 @@ public class SessionCreateParams extends ApiRequestParams { @SerializedName("filters") Filters filters; + /** Settings for hosted Sessions. Required if {@code ui_mode} is {@code hosted}. */ + @SerializedName("hosted") + Hosted hosted; + /** Settings for configuring Session-specific limits. */ @SerializedName("limits") Limits limits; @@ -66,27 +70,35 @@ public class SessionCreateParams extends ApiRequestParams { @SerializedName("return_url") String returnUrl; + /** The UI mode of the Session. Defaults to {@code modal}. */ + @SerializedName("ui_mode") + UiMode uiMode; + private SessionCreateParams( AccountHolder accountHolder, List expand, Map extraParams, Filters filters, + Hosted hosted, Limits limits, ManualEntry manualEntry, List permissions, List prefetch, RelinkOptions relinkOptions, - String returnUrl) { + String returnUrl, + UiMode uiMode) { this.accountHolder = accountHolder; this.expand = expand; this.extraParams = extraParams; this.filters = filters; + this.hosted = hosted; this.limits = limits; this.manualEntry = manualEntry; this.permissions = permissions; this.prefetch = prefetch; this.relinkOptions = relinkOptions; this.returnUrl = returnUrl; + this.uiMode = uiMode; } public static Builder builder() { @@ -102,6 +114,8 @@ public static class Builder { private Filters filters; + private Hosted hosted; + private Limits limits; private ManualEntry manualEntry; @@ -114,6 +128,8 @@ public static class Builder { private String returnUrl; + private UiMode uiMode; + /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams build() { return new SessionCreateParams( @@ -121,12 +137,14 @@ public SessionCreateParams build() { this.expand, this.extraParams, this.filters, + this.hosted, this.limits, this.manualEntry, this.permissions, this.prefetch, this.relinkOptions, - this.returnUrl); + this.returnUrl, + this.uiMode); } /** The account holder to link accounts for. */ @@ -193,6 +211,12 @@ public Builder setFilters(SessionCreateParams.Filters filters) { return this; } + /** Settings for hosted Sessions. Required if {@code ui_mode} is {@code hosted}. */ + public Builder setHosted(SessionCreateParams.Hosted hosted) { + this.hosted = hosted; + return this; + } + /** Settings for configuring Session-specific limits. */ public Builder setLimits(SessionCreateParams.Limits limits) { this.limits = limits; @@ -271,6 +295,12 @@ public Builder setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; return this; } + + /** The UI mode of the Session. Defaults to {@code modal}. */ + public Builder setUiMode(SessionCreateParams.UiMode uiMode) { + this.uiMode = uiMode; + return this; + } } @Getter @@ -589,6 +619,96 @@ public enum AccountSubcategory implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Hosted { + /** + * How the user should enter the hosted flow. The values {@code email} and {@code url} can only + * be used if {@code relink_options} is provided. + */ + @SerializedName("delivery_method") + DeliveryMethod deliveryMethod; + + /** + * 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 Hosted(DeliveryMethod deliveryMethod, Map extraParams) { + this.deliveryMethod = deliveryMethod; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DeliveryMethod deliveryMethod; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.Hosted build() { + return new SessionCreateParams.Hosted(this.deliveryMethod, this.extraParams); + } + + /** + * How the user should enter the hosted flow. The values {@code email} and {@code url} can + * only be used if {@code relink_options} is provided. + */ + public Builder setDeliveryMethod(SessionCreateParams.Hosted.DeliveryMethod deliveryMethod) { + this.deliveryMethod = deliveryMethod; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SessionCreateParams.Hosted#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SessionCreateParams.Hosted#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 DeliveryMethod implements ApiRequestParams.EnumParam { + @SerializedName("email") + EMAIL("email"), + + @SerializedName("url") + URL("url"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + DeliveryMethod(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Limits { @@ -870,4 +990,19 @@ public enum Prefetch implements ApiRequestParams.EnumParam { this.value = value; } } + + public enum UiMode implements ApiRequestParams.EnumParam { + @SerializedName("hosted") + HOSTED("hosted"), + + @SerializedName("modal") + MODAL("modal"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + UiMode(String value) { + this.value = value; + } + } } diff --git a/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java b/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java index 79c47fc21cd..d185cfad08c 100644 --- a/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java @@ -2738,18 +2738,18 @@ public static class CardTestingRisk { * Required. The likelihood that this authorization is associated with card * testing activity. This is assessed by evaluating decline activity over the last hour. */ - @SerializedName("risk_level") - RiskLevel riskLevel; + @SerializedName("level") + Level level; private CardTestingRisk( Map extraParams, Long invalidAccountNumberDeclineRatePastHour, Long invalidCredentialsDeclineRatePastHour, - RiskLevel riskLevel) { + Level level) { this.extraParams = extraParams; this.invalidAccountNumberDeclineRatePastHour = invalidAccountNumberDeclineRatePastHour; this.invalidCredentialsDeclineRatePastHour = invalidCredentialsDeclineRatePastHour; - this.riskLevel = riskLevel; + this.level = level; } public static Builder builder() { @@ -2763,7 +2763,7 @@ public static class Builder { private Long invalidCredentialsDeclineRatePastHour; - private RiskLevel riskLevel; + private Level level; /** Finalize and obtain parameter instance from this builder. */ public AuthorizationCreateParams.RiskAssessment.CardTestingRisk build() { @@ -2771,7 +2771,7 @@ public AuthorizationCreateParams.RiskAssessment.CardTestingRisk build() { this.extraParams, this.invalidAccountNumberDeclineRatePastHour, this.invalidCredentialsDeclineRatePastHour, - this.riskLevel); + this.level); } /** @@ -2830,14 +2830,14 @@ public Builder setInvalidCredentialsDeclineRatePastHour( * Required. The likelihood that this authorization is associated with card * testing activity. This is assessed by evaluating decline activity over the last hour. */ - public Builder setRiskLevel( - AuthorizationCreateParams.RiskAssessment.CardTestingRisk.RiskLevel riskLevel) { - this.riskLevel = riskLevel; + public Builder setLevel( + AuthorizationCreateParams.RiskAssessment.CardTestingRisk.Level level) { + this.level = level; return this; } } - public enum RiskLevel implements ApiRequestParams.EnumParam { + public enum Level implements ApiRequestParams.EnumParam { @SerializedName("elevated") ELEVATED("elevated"), @@ -2859,7 +2859,7 @@ public enum RiskLevel implements ApiRequestParams.EnumParam { @Getter(onMethod_ = {@Override}) private final String value; - RiskLevel(String value) { + Level(String value) { this.value = value; } } @@ -3016,14 +3016,13 @@ public static class MerchantDisputeRisk { * Required. The likelihood that authorizations from this merchant will * result in a dispute based on their history on Stripe Issuing. */ - @SerializedName("risk_level") - RiskLevel riskLevel; + @SerializedName("level") + Level level; - private MerchantDisputeRisk( - Long disputeRate, Map extraParams, RiskLevel riskLevel) { + private MerchantDisputeRisk(Long disputeRate, Map extraParams, Level level) { this.disputeRate = disputeRate; this.extraParams = extraParams; - this.riskLevel = riskLevel; + this.level = level; } public static Builder builder() { @@ -3035,12 +3034,12 @@ public static class Builder { private Map extraParams; - private RiskLevel riskLevel; + private Level level; /** Finalize and obtain parameter instance from this builder. */ public AuthorizationCreateParams.RiskAssessment.MerchantDisputeRisk build() { return new AuthorizationCreateParams.RiskAssessment.MerchantDisputeRisk( - this.disputeRate, this.extraParams, this.riskLevel); + this.disputeRate, this.extraParams, this.level); } /** @@ -3086,14 +3085,14 @@ public Builder putAllExtraParam(Map map) { * Required. The likelihood that authorizations from this merchant will * result in a dispute based on their history on Stripe Issuing. */ - public Builder setRiskLevel( - AuthorizationCreateParams.RiskAssessment.MerchantDisputeRisk.RiskLevel riskLevel) { - this.riskLevel = riskLevel; + public Builder setLevel( + AuthorizationCreateParams.RiskAssessment.MerchantDisputeRisk.Level level) { + this.level = level; return this; } } - public enum RiskLevel implements ApiRequestParams.EnumParam { + public enum Level implements ApiRequestParams.EnumParam { @SerializedName("elevated") ELEVATED("elevated"), @@ -3115,7 +3114,7 @@ public enum RiskLevel implements ApiRequestParams.EnumParam { @Getter(onMethod_ = {@Override}) private final String value; - RiskLevel(String value) { + Level(String value) { this.value = value; } } diff --git a/src/main/java/com/stripe/param/issuing/CardCreateParams.java b/src/main/java/com/stripe/param/issuing/CardCreateParams.java index d7679ef3dd1..df1f69c0c8d 100644 --- a/src/main/java/com/stripe/param/issuing/CardCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardCreateParams.java @@ -61,6 +61,14 @@ public class CardCreateParams extends ApiRequestParams { @SerializedName("financial_account") String financialAccount; + /** + * Rules that control the lifecycle of this card, such as automatic cancellation. Refer to our documentation for more + * details. + */ + @SerializedName("lifecycle_controls") + LifecycleControls lifecycleControls; + /** * 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 @@ -126,6 +134,7 @@ private CardCreateParams( List expand, Map extraParams, String financialAccount, + LifecycleControls lifecycleControls, Map metadata, String personalizationDesign, Pin pin, @@ -143,6 +152,7 @@ private CardCreateParams( this.expand = expand; this.extraParams = extraParams; this.financialAccount = financialAccount; + this.lifecycleControls = lifecycleControls; this.metadata = metadata; this.personalizationDesign = personalizationDesign; this.pin = pin; @@ -174,6 +184,8 @@ public static class Builder { private String financialAccount; + private LifecycleControls lifecycleControls; + private Map metadata; private String personalizationDesign; @@ -204,6 +216,7 @@ public CardCreateParams build() { this.expand, this.extraParams, this.financialAccount, + this.lifecycleControls, this.metadata, this.personalizationDesign, this.pin, @@ -312,6 +325,16 @@ public Builder setFinancialAccount(String financialAccount) { return this; } + /** + * Rules that control the lifecycle of this card, such as automatic cancellation. Refer to our + * documentation for more + * details. + */ + public Builder setLifecycleControls(CardCreateParams.LifecycleControls lifecycleControls) { + this.lifecycleControls = lifecycleControls; + return this; + } + /** * Add a key/value pair to `metadata` 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 @@ -412,6 +435,155 @@ public Builder setType(CardCreateParams.Type type) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LifecycleControls { + /** Required. Cancels the card after the specified conditions are met. */ + @SerializedName("cancel_after") + CancelAfter cancelAfter; + + /** + * 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 LifecycleControls(CancelAfter cancelAfter, Map extraParams) { + this.cancelAfter = cancelAfter; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CancelAfter cancelAfter; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CardCreateParams.LifecycleControls build() { + return new CardCreateParams.LifecycleControls(this.cancelAfter, this.extraParams); + } + + /** Required. Cancels the card after the specified conditions are met. */ + public Builder setCancelAfter(CardCreateParams.LifecycleControls.CancelAfter cancelAfter) { + this.cancelAfter = cancelAfter; + 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 + * CardCreateParams.LifecycleControls#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.LifecycleControls#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CancelAfter { + /** + * 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 card is automatically cancelled when it makes this number of + * non-zero payment authorizations and transactions. The count includes penny authorizations, + * but doesn't include non-payment actions, such as authorization advice. + */ + @SerializedName("payment_count") + Long paymentCount; + + private CancelAfter(Map extraParams, Long paymentCount) { + this.extraParams = extraParams; + this.paymentCount = paymentCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long paymentCount; + + /** Finalize and obtain parameter instance from this builder. */ + public CardCreateParams.LifecycleControls.CancelAfter build() { + return new CardCreateParams.LifecycleControls.CancelAfter( + this.extraParams, this.paymentCount); + } + + /** + * 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.LifecycleControls.CancelAfter#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.LifecycleControls.CancelAfter#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 card is automatically cancelled when it makes this number + * of non-zero payment authorizations and transactions. The count includes penny + * authorizations, but doesn't include non-payment actions, such as authorization advice. + */ + public Builder setPaymentCount(Long paymentCount) { + this.paymentCount = paymentCount; + return this; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Pin { diff --git a/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java b/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java index 9cd961d5464..c97aa66a829 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java @@ -74,9 +74,9 @@ public class CardholderCreateParams extends ApiRequestParams { /** * The cardholder’s preferred locales (languages), ordered by preference. Locales can be {@code - * de}, {@code en}, {@code es}, {@code fr}, or {@code it}. This changes the language of the 3D Secure flow and one-time password - * messages sent to the cardholder. + * da}, {@code de}, {@code en}, {@code es}, {@code fr}, {@code it}, {@code pl}, or {@code sv}. + * This changes the language of the 3D Secure + * flow and one-time password messages sent to the cardholder. */ @SerializedName("preferred_locales") List preferredLocales; @@ -898,10 +898,7 @@ public Builder setUserTermsAcceptance( @Getter @EqualsAndHashCode(callSuper = false) public static class UserTermsAcceptance { - /** - * The Unix timestamp marking when the cardholder accepted the Authorized User Terms. - * Required for Celtic Spend Card users. - */ + /** The Unix timestamp marking when the cardholder accepted the Authorized User Terms. */ @SerializedName("date") Long date; @@ -915,10 +912,7 @@ public static class UserTermsAcceptance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The IP address from which the cardholder accepted the Authorized User Terms. Required for - * Celtic Spend Card users. - */ + /** The IP address from which the cardholder accepted the Authorized User Terms. */ @SerializedName("ip") String ip; @@ -956,10 +950,7 @@ public CardholderCreateParams.Individual.CardIssuing.UserTermsAcceptance build() this.date, this.extraParams, this.ip, this.userAgent); } - /** - * The Unix timestamp marking when the cardholder accepted the Authorized User Terms. - * Required for Celtic Spend Card users. - */ + /** The Unix timestamp marking when the cardholder accepted the Authorized User Terms. */ public Builder setDate(Long date) { this.date = date; return this; @@ -995,10 +986,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * The IP address from which the cardholder accepted the Authorized User Terms. Required - * for Celtic Spend Card users. - */ + /** The IP address from which the cardholder accepted the Authorized User Terms. */ public Builder setIp(String ip) { this.ip = ip; return this; diff --git a/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java b/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java index ce9031c30c7..d48c5d9d3dd 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java @@ -62,9 +62,9 @@ public class CardholderUpdateParams extends ApiRequestParams { /** * The cardholder’s preferred locales (languages), ordered by preference. Locales can be {@code - * de}, {@code en}, {@code es}, {@code fr}, or {@code it}. This changes the language of the 3D Secure flow and one-time password - * messages sent to the cardholder. + * da}, {@code de}, {@code en}, {@code es}, {@code fr}, {@code it}, {@code pl}, or {@code sv}. + * This changes the language of the 3D Secure + * flow and one-time password messages sent to the cardholder. */ @SerializedName("preferred_locales") List preferredLocales; @@ -924,10 +924,7 @@ public Builder setUserTermsAcceptance( @Getter @EqualsAndHashCode(callSuper = false) public static class UserTermsAcceptance { - /** - * The Unix timestamp marking when the cardholder accepted the Authorized User Terms. - * Required for Celtic Spend Card users. - */ + /** The Unix timestamp marking when the cardholder accepted the Authorized User Terms. */ @SerializedName("date") Long date; @@ -941,10 +938,7 @@ public static class UserTermsAcceptance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * The IP address from which the cardholder accepted the Authorized User Terms. Required for - * Celtic Spend Card users. - */ + /** The IP address from which the cardholder accepted the Authorized User Terms. */ @SerializedName("ip") Object ip; @@ -982,10 +976,7 @@ public CardholderUpdateParams.Individual.CardIssuing.UserTermsAcceptance build() this.date, this.extraParams, this.ip, this.userAgent); } - /** - * The Unix timestamp marking when the cardholder accepted the Authorized User Terms. - * Required for Celtic Spend Card users. - */ + /** The Unix timestamp marking when the cardholder accepted the Authorized User Terms. */ public Builder setDate(Long date) { this.date = date; return this; @@ -1021,19 +1012,13 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * The IP address from which the cardholder accepted the Authorized User Terms. Required - * for Celtic Spend Card users. - */ + /** The IP address from which the cardholder accepted the Authorized User Terms. */ public Builder setIp(String ip) { this.ip = ip; return this; } - /** - * The IP address from which the cardholder accepted the Authorized User Terms. Required - * for Celtic Spend Card users. - */ + /** The IP address from which the cardholder accepted the Authorized User Terms. */ public Builder setIp(EmptyParam ip) { this.ip = ip; return this; diff --git a/src/main/java/com/stripe/param/productcatalog/TrialOfferCreateParams.java b/src/main/java/com/stripe/param/productcatalog/TrialOfferCreateParams.java new file mode 100644 index 00000000000..04d2019601f --- /dev/null +++ b/src/main/java/com/stripe/param/productcatalog/TrialOfferCreateParams.java @@ -0,0 +1,491 @@ +// File generated from our OpenAPI spec +package com.stripe.param.productcatalog; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class TrialOfferCreateParams extends ApiRequestParams { + /** Required. Duration of one service period of the trial. */ + @SerializedName("duration") + Duration duration; + + /** Required. Define behavior that occurs at the end of the trial. */ + @SerializedName("end_behavior") + EndBehavior endBehavior; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** A brief, user-friendly name for the trial offer-for identification purposes. */ + @SerializedName("name") + String name; + + /** + * Required. Price configuration during the trial period (amount, billing scheme, + * etc). + */ + @SerializedName("price") + String price; + + private TrialOfferCreateParams( + Duration duration, + EndBehavior endBehavior, + List expand, + Map extraParams, + String name, + String price) { + this.duration = duration; + this.endBehavior = endBehavior; + this.expand = expand; + this.extraParams = extraParams; + this.name = name; + this.price = price; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Duration duration; + + private EndBehavior endBehavior; + + private List expand; + + private Map extraParams; + + private String name; + + private String price; + + /** Finalize and obtain parameter instance from this builder. */ + public TrialOfferCreateParams build() { + return new TrialOfferCreateParams( + this.duration, this.endBehavior, this.expand, this.extraParams, this.name, this.price); + } + + /** Required. Duration of one service period of the trial. */ + public Builder setDuration(TrialOfferCreateParams.Duration duration) { + this.duration = duration; + return this; + } + + /** Required. Define behavior that occurs at the end of the trial. */ + public Builder setEndBehavior(TrialOfferCreateParams.EndBehavior endBehavior) { + this.endBehavior = endBehavior; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * TrialOfferCreateParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * TrialOfferCreateParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * TrialOfferCreateParams#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 TrialOfferCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** A brief, user-friendly name for the trial offer-for identification purposes. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** + * Required. Price configuration during the trial period (amount, billing + * scheme, etc). + */ + public Builder setPrice(String price) { + this.price = price; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Duration { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * The relative duration of the trial period computed as the number of recurring price + * intervals. + */ + @SerializedName("relative") + Relative relative; + + /** Required. Specifies how the trial offer duration is determined. */ + @SerializedName("type") + Type type; + + private Duration(Map extraParams, Relative relative, Type type) { + this.extraParams = extraParams; + this.relative = relative; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Relative relative; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public TrialOfferCreateParams.Duration build() { + return new TrialOfferCreateParams.Duration(this.extraParams, this.relative, this.type); + } + + /** + * 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 + * TrialOfferCreateParams.Duration#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 TrialOfferCreateParams.Duration#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * The relative duration of the trial period computed as the number of recurring price + * intervals. + */ + public Builder setRelative(TrialOfferCreateParams.Duration.Relative relative) { + this.relative = relative; + return this; + } + + /** Required. Specifies how the trial offer duration is determined. */ + public Builder setType(TrialOfferCreateParams.Duration.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Relative { + /** + * 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 number of recurring price's interval to apply for the trial + * period. + */ + @SerializedName("iterations") + Long iterations; + + private Relative(Map extraParams, Long iterations) { + this.extraParams = extraParams; + this.iterations = iterations; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long iterations; + + /** Finalize and obtain parameter instance from this builder. */ + public TrialOfferCreateParams.Duration.Relative build() { + return new TrialOfferCreateParams.Duration.Relative(this.extraParams, this.iterations); + } + + /** + * 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 TrialOfferCreateParams.Duration.Relative#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 TrialOfferCreateParams.Duration.Relative#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 number of recurring price's interval to apply for the + * trial period. + */ + public Builder setIterations(Long iterations) { + this.iterations = iterations; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("relative") + RELATIVE("relative"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class EndBehavior { + /** + * 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 transition to apply when the trial offer ends. */ + @SerializedName("transition") + Transition transition; + + private EndBehavior(Map extraParams, Transition transition) { + this.extraParams = extraParams; + this.transition = transition; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Transition transition; + + /** Finalize and obtain parameter instance from this builder. */ + public TrialOfferCreateParams.EndBehavior build() { + return new TrialOfferCreateParams.EndBehavior(this.extraParams, this.transition); + } + + /** + * 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 + * TrialOfferCreateParams.EndBehavior#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 TrialOfferCreateParams.EndBehavior#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 transition to apply when the trial offer ends. */ + public Builder setTransition(TrialOfferCreateParams.EndBehavior.Transition transition) { + this.transition = transition; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Transition { + /** + * 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 price to transition the recurring item to when the trial + * offer ends. + */ + @SerializedName("price") + String price; + + private Transition(Map extraParams, String price) { + this.extraParams = extraParams; + this.price = price; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String price; + + /** Finalize and obtain parameter instance from this builder. */ + public TrialOfferCreateParams.EndBehavior.Transition build() { + return new TrialOfferCreateParams.EndBehavior.Transition(this.extraParams, this.price); + } + + /** + * 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 TrialOfferCreateParams.EndBehavior.Transition#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 TrialOfferCreateParams.EndBehavior.Transition#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 price to transition the recurring item to when the trial + * offer ends. + */ + public Builder setPrice(String price) { + this.price = price; + return this; + } + } + } + } +} diff --git a/src/main/java/com/stripe/param/radar/ValueListCreateParams.java b/src/main/java/com/stripe/param/radar/ValueListCreateParams.java index 9e056deef5d..209cd61b055 100644 --- a/src/main/java/com/stripe/param/radar/ValueListCreateParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListCreateParams.java @@ -32,9 +32,9 @@ public class ValueListCreateParams extends ApiRequestParams { /** * Type of the items in the value list. One of {@code card_fingerprint}, {@code card_bin}, {@code - * email}, {@code ip_address}, {@code country}, {@code string}, {@code case_sensitive_string}, - * {@code customer_id}, {@code sepa_debit_fingerprint}, or {@code us_bank_account_fingerprint}. - * Use {@code string} if the item type is unknown or mixed. + * crypto_fingerprint}, {@code email}, {@code ip_address}, {@code country}, {@code string}, {@code + * case_sensitive_string}, {@code customer_id}, {@code sepa_debit_fingerprint}, or {@code + * us_bank_account_fingerprint}. Use {@code string} if the item type is unknown or mixed. */ @SerializedName("item_type") ItemType itemType; @@ -150,9 +150,10 @@ public Builder putAllExtraParam(Map map) { /** * Type of the items in the value list. One of {@code card_fingerprint}, {@code card_bin}, - * {@code email}, {@code ip_address}, {@code country}, {@code string}, {@code - * case_sensitive_string}, {@code customer_id}, {@code sepa_debit_fingerprint}, or {@code - * us_bank_account_fingerprint}. Use {@code string} if the item type is unknown or mixed. + * {@code crypto_fingerprint}, {@code email}, {@code ip_address}, {@code country}, {@code + * string}, {@code case_sensitive_string}, {@code customer_id}, {@code sepa_debit_fingerprint}, + * or {@code us_bank_account_fingerprint}. Use {@code string} if the item type is unknown or + * mixed. */ public Builder setItemType(ValueListCreateParams.ItemType itemType) { this.itemType = itemType; @@ -205,6 +206,9 @@ public enum ItemType implements ApiRequestParams.EnumParam { @SerializedName("country") COUNTRY("country"), + @SerializedName("crypto_fingerprint") + CRYPTO_FINGERPRINT("crypto_fingerprint"), + @SerializedName("customer_id") CUSTOMER_ID("customer_id"), diff --git a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java index a854b816230..2a407945566 100644 --- a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java @@ -1132,7 +1132,7 @@ public enum TaxabilityOverride implements ApiRequestParams.EnumParam { public static class LineItem { /** * Required. A positive integer representing the line item's total price in the - * smallest currency unit. If + * smallest currency unit. If * {@code tax_behavior=inclusive}, then this amount includes taxes. Otherwise, taxes are * calculated on top of this amount. */ @@ -1156,6 +1156,14 @@ public static class LineItem { @SerializedName("metadata") Map metadata; + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + @SerializedName("performance_location") + String performanceLocation; + /** * If provided, the product's {@code tax_code} will be used as the line item's {@code tax_code}. */ @@ -1195,6 +1203,7 @@ private LineItem( Long amount, Map extraParams, Map metadata, + String performanceLocation, String product, Long quantity, String reference, @@ -1203,6 +1212,7 @@ private LineItem( this.amount = amount; this.extraParams = extraParams; this.metadata = metadata; + this.performanceLocation = performanceLocation; this.product = product; this.quantity = quantity; this.reference = reference; @@ -1221,6 +1231,8 @@ public static class Builder { private Map metadata; + private String performanceLocation; + private String product; private Long quantity; @@ -1237,6 +1249,7 @@ public CalculationCreateParams.LineItem build() { this.amount, this.extraParams, this.metadata, + this.performanceLocation, this.product, this.quantity, this.reference, @@ -1246,8 +1259,8 @@ public CalculationCreateParams.LineItem build() { /** * Required. A positive integer representing the line item's total price in - * the smallest currency unit. - * If {@code tax_behavior=inclusive}, then this amount includes taxes. Otherwise, taxes are + * the smallest currency unit. If + * {@code tax_behavior=inclusive}, then this amount includes taxes. Otherwise, taxes are * calculated on top of this amount. */ public Builder setAmount(Long amount) { @@ -1307,6 +1320,16 @@ public Builder putAllMetadata(Map map) { return this; } + /** + * A tax location ID. Depending on the tax + * code, this is required, optional, or not supported. + */ + public Builder setPerformanceLocation(String performanceLocation) { + this.performanceLocation = performanceLocation; + return this; + } + /** * If provided, the product's {@code tax_code} will be used as the line item's {@code * tax_code}. @@ -1639,7 +1662,7 @@ public Builder setState(EmptyParam state) { @EqualsAndHashCode(callSuper = false) public static class ShippingCost { /** - * A positive integer in the smallest + * A positive integer in the smallest * currency unit representing the shipping charge. If {@code tax_behavior=inclusive}, then * this amount includes taxes. Otherwise, taxes are calculated on top of this amount. */ @@ -1714,10 +1737,9 @@ public CalculationCreateParams.ShippingCost build() { } /** - * A positive integer in the smallest currency unit - * representing the shipping charge. If {@code tax_behavior=inclusive}, then this amount - * includes taxes. Otherwise, taxes are calculated on top of this amount. + * A positive integer in the smallest + * currency unit representing the shipping charge. If {@code tax_behavior=inclusive}, then + * this amount includes taxes. Otherwise, taxes are calculated on top of this amount. */ public Builder setAmount(Long amount) { this.amount = amount; diff --git a/src/main/java/com/stripe/param/tax/LocationCreateParams.java b/src/main/java/com/stripe/param/tax/LocationCreateParams.java new file mode 100644 index 00000000000..09c005d003b --- /dev/null +++ b/src/main/java/com/stripe/param/tax/LocationCreateParams.java @@ -0,0 +1,363 @@ +// File generated from our OpenAPI spec +package com.stripe.param.tax; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class LocationCreateParams extends ApiRequestParams { + /** Required. The physical address of the tax location. */ + @SerializedName("address") + Address address; + + /** + * Details to identify the tax location by its venue, types of events held, or available services, + * such as "A spacious auditorium suitable for large concerts and events.". + */ + @SerializedName("description") + String description; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. The type of tax location. The only supported value is + * "performance". + */ + @SerializedName("type") + Type type; + + private LocationCreateParams( + Address address, + String description, + List expand, + Map extraParams, + Type type) { + this.address = address; + this.description = description; + this.expand = expand; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private String description; + + private List expand; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public LocationCreateParams build() { + return new LocationCreateParams( + this.address, this.description, this.expand, this.extraParams, this.type); + } + + /** Required. The physical address of the tax location. */ + public Builder setAddress(LocationCreateParams.Address address) { + this.address = address; + return this; + } + + /** + * Details to identify the tax location by its venue, types of events held, or available + * services, such as "A spacious auditorium suitable for large concerts and events.". + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * LocationCreateParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * LocationCreateParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * LocationCreateParams#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 LocationCreateParams#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 type of tax location. The only supported value is + * "performance". + */ + public Builder setType(LocationCreateParams.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + Object city; + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + Object line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + Object line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + Object postalCode; + + /** + * State/province as an ISO 3166-2 + * subdivision code, without country prefix, such as "NY" or "TX". + */ + @SerializedName("state") + Object state; + + private Address( + Object city, + String 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 String 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 LocationCreateParams.Address build() { + return new LocationCreateParams.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(EmptyParam city) { + this.city = city; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(String 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 + * LocationCreateParams.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 LocationCreateParams.Address#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 1, such as the street, PO Box, or company name. */ + public Builder setLine1(EmptyParam line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(EmptyParam line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(EmptyParam postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * State/province as an ISO 3166-2 + * subdivision code, without country prefix, such as "NY" or "TX". + */ + public Builder setState(String state) { + this.state = state; + return this; + } + + /** + * State/province as an ISO 3166-2 + * subdivision code, without country prefix, such as "NY" or "TX". + */ + public Builder setState(EmptyParam state) { + this.state = state; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("performance") + PERFORMANCE("performance"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/tax/LocationListParams.java b/src/main/java/com/stripe/param/tax/LocationListParams.java new file mode 100644 index 00000000000..74a0c89d1b7 --- /dev/null +++ b/src/main/java/com/stripe/param/tax/LocationListParams.java @@ -0,0 +1,208 @@ +// File generated from our OpenAPI spec +package com.stripe.param.tax; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class LocationListParams extends ApiRequestParams { + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + @SerializedName("ending_before") + String endingBefore; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + @SerializedName("limit") + Long limit; + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, ending with + * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to + * fetch the next page of the list. + */ + @SerializedName("starting_after") + String startingAfter; + + /** + * Required. Type of the tax location. Currently the only option is {@code + * performance}. + */ + @SerializedName("type") + Type type; + + private LocationListParams( + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter, + Type type) { + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.startingAfter = startingAfter; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String endingBefore; + + private List expand; + + private Map extraParams; + + private Long limit; + + private String startingAfter; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public LocationListParams build() { + return new LocationListParams( + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter, + this.type); + } + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + public Builder setEndingBefore(String endingBefore) { + this.endingBefore = endingBefore; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * LocationListParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * LocationListParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * LocationListParams#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 LocationListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your + * place in the list. For instance, if you make a list request and receive 100 objects, ending + * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in + * order to fetch the next page of the list. + */ + public Builder setStartingAfter(String startingAfter) { + this.startingAfter = startingAfter; + return this; + } + + /** + * Required. Type of the tax location. Currently the only option is {@code + * performance}. + */ + public Builder setType(LocationListParams.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("performance") + PERFORMANCE("performance"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/tax/LocationRetrieveParams.java b/src/main/java/com/stripe/param/tax/LocationRetrieveParams.java new file mode 100644 index 00000000000..7bf5d7457eb --- /dev/null +++ b/src/main/java/com/stripe/param/tax/LocationRetrieveParams.java @@ -0,0 +1,100 @@ +// File generated from our OpenAPI spec +package com.stripe.param.tax; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class LocationRetrieveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private LocationRetrieveParams(List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public LocationRetrieveParams build() { + return new LocationRetrieveParams(this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * LocationRetrieveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * LocationRetrieveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * LocationRetrieveParams#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 LocationRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java index 3aeb2002231..6a8c1dce2e6 100644 --- a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java @@ -16261,12 +16261,33 @@ public enum Type implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("admissions_tax") + ADMISSIONS_TAX("admissions_tax"), + + @SerializedName("attendance_tax") + ATTENDANCE_TAX("attendance_tax"), + + @SerializedName("entertainment_tax") + ENTERTAINMENT_TAX("entertainment_tax"), + + @SerializedName("gross_receipts_tax") + GROSS_RECEIPTS_TAX("gross_receipts_tax"), + + @SerializedName("hospitality_tax") + HOSPITALITY_TAX("hospitality_tax"), + @SerializedName("local_amusement_tax") LOCAL_AMUSEMENT_TAX("local_amusement_tax"), @SerializedName("local_lease_tax") LOCAL_LEASE_TAX("local_lease_tax"), + @SerializedName("luxury_tax") + LUXURY_TAX("luxury_tax"), + + @SerializedName("resort_tax") + RESORT_TAX("resort_tax"), + @SerializedName("state_communications_tax") STATE_COMMUNICATIONS_TAX("state_communications_tax"), @@ -16274,7 +16295,10 @@ public enum Type implements ApiRequestParams.EnumParam { STATE_RETAIL_DELIVERY_FEE("state_retail_delivery_fee"), @SerializedName("state_sales_tax") - STATE_SALES_TAX("state_sales_tax"); + STATE_SALES_TAX("state_sales_tax"), + + @SerializedName("tourism_tax") + TOURISM_TAX("tourism_tax"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/tax/TransactionCreateReversalParams.java b/src/main/java/com/stripe/param/tax/TransactionCreateReversalParams.java index 7f345739fb4..56aefedb926 100644 --- a/src/main/java/com/stripe/param/tax/TransactionCreateReversalParams.java +++ b/src/main/java/com/stripe/param/tax/TransactionCreateReversalParams.java @@ -28,7 +28,7 @@ public class TransactionCreateReversalParams extends ApiRequestParams { /** * A flat amount to reverse across the entire transaction, in the smallest currency unit in negative. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. * This value represents the total amount to refund from the transaction, including taxes. */ @SerializedName("flat_amount") @@ -183,9 +183,8 @@ public Builder putAllExtraParam(Map map) { /** * A flat amount to reverse across the entire transaction, in the smallest currency unit in - * negative. This value represents the total amount to refund from the transaction, including - * taxes. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. + * This value represents the total amount to refund from the transaction, including taxes. */ public Builder setFlatAmount(Long flatAmount) { this.flatAmount = flatAmount; @@ -282,16 +281,14 @@ public Builder setShippingCost(TransactionCreateReversalParams.ShippingCost ship public static class LineItem { /** * Required. The amount to reverse, in the smallest currency unit in - * negative. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. */ @SerializedName("amount") Long amount; /** * Required. The amount of tax to reverse, in the smallest currency unit in - * negative. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. */ @SerializedName("amount_tax") Long amountTax; @@ -384,7 +381,7 @@ public TransactionCreateReversalParams.LineItem build() { /** * Required. The amount to reverse, in the smallest currency unit in + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in * negative. */ public Builder setAmount(Long amount) { @@ -394,7 +391,7 @@ public Builder setAmount(Long amount) { /** * Required. The amount of tax to reverse, in the smallest currency unit in + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in * negative. */ public Builder setAmountTax(Long amountTax) { @@ -489,16 +486,14 @@ public Builder setReference(String reference) { public static class ShippingCost { /** * Required. The amount to reverse, in the smallest currency unit in - * negative. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. */ @SerializedName("amount") Long amount; /** * Required. The amount of tax to reverse, in the smallest currency unit in - * negative. + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in negative. */ @SerializedName("amount_tax") Long amountTax; @@ -537,7 +532,7 @@ public TransactionCreateReversalParams.ShippingCost build() { /** * Required. The amount to reverse, in the smallest currency unit in + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in * negative. */ public Builder setAmount(Long amount) { @@ -547,7 +542,7 @@ public Builder setAmount(Long amount) { /** * Required. The amount of tax to reverse, in the smallest currency unit in + * href="https://docs.stripe.com/currencies#minor-units">smallest currency unit in * negative. */ public Builder setAmountTax(Long amountTax) { diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java index a4ae606600f..6eab345b23f 100644 --- a/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java @@ -1,7 +1,9 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; import java.util.HashMap; @@ -1016,6 +1018,7 @@ public Builder setRequestThreeDSecure( public static class MandateOptions { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java index b4eb433b47e..95fb6832134 100644 --- a/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java @@ -1,7 +1,9 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; @@ -1088,6 +1090,7 @@ public Builder setRequestThreeDSecure( public static class MandateOptions { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java index 7207fb5b9a9..6ec0da8bb02 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java @@ -3,6 +3,8 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -10095,17 +10097,26 @@ public static class Defaults { @SerializedName("responsibilities") Responsibilities responsibilities; + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + @SerializedName("timezone") + String timezone; + private Defaults( String currency, Map extraParams, List locales, Profile profile, - Responsibilities responsibilities) { + Responsibilities responsibilities, + String timezone) { this.currency = currency; this.extraParams = extraParams; this.locales = locales; this.profile = profile; this.responsibilities = responsibilities; + this.timezone = timezone; } public static Builder builder() { @@ -10123,10 +10134,17 @@ public static class Builder { private Responsibilities responsibilities; + private String timezone; + /** Finalize and obtain parameter instance from this builder. */ public AccountCreateParams.Defaults build() { return new AccountCreateParams.Defaults( - this.currency, this.extraParams, this.locales, this.profile, this.responsibilities); + this.currency, + this.extraParams, + this.locales, + this.profile, + this.responsibilities, + this.timezone); } /** @@ -10203,6 +10221,15 @@ public Builder setResponsibilities( this.responsibilities = responsibilities; return this; } + + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + public Builder setTimezone(String timezone) { + this.timezone = timezone; + return this; + } } @Getter @@ -12347,8 +12374,7 @@ public AccountCreateParams.Identity.BusinessDetails.AnnualRevenue build() { } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -12390,112 +12416,6 @@ public Builder setFiscalYearEnd(String fiscalYearEnd) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * 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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount build() { - return new AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount#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 - * AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount#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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -14710,8 +14630,7 @@ public AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue buil } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -14746,113 +14665,6 @@ public Builder putAllExtraParam(Map map) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * 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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - build() { - return new AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue - .Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#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 - * AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -18164,7 +17976,7 @@ public static class Relationship { /** The percent owned by the person of the account's legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** The person's title (e.g., CEO, Support Engineer). */ @SerializedName("title") @@ -18175,7 +17987,7 @@ private Relationship( Boolean executive, Map extraParams, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, String title) { this.director = director; this.executive = executive; @@ -18198,7 +18010,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private String title; @@ -18267,7 +18079,7 @@ public Builder setOwner(Boolean owner) { } /** The percent owned by the person of the account's legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java b/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java index 450fa2a860f..3039f5f39d4 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java @@ -4,6 +4,8 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -1567,8 +1569,7 @@ public AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue build() { } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -1612,112 +1613,6 @@ public Builder setFiscalYearEnd(String fiscalYearEnd) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * 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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount build() { - return new AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount#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 - * AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount#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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -3945,9 +3840,7 @@ public AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -3982,113 +3875,6 @@ public Builder putAllExtraParam(Map map) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * 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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - build() { - return new AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue - .Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#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 - * AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -7433,7 +7219,7 @@ public static class Relationship { /** The percent owned by the person of the account's legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** The person's title (e.g., CEO, Support Engineer). */ @SerializedName("title") @@ -7444,7 +7230,7 @@ private Relationship( Boolean executive, Map extraParams, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, String title) { this.director = director; this.executive = executive; @@ -7467,7 +7253,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private String title; @@ -7536,7 +7322,7 @@ public Builder setOwner(Boolean owner) { } /** The percent owned by the person of the account's legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java index c3bf4fce118..c81e4d3c054 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java @@ -4,6 +4,8 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -10668,17 +10670,26 @@ public static class Defaults { @SerializedName("responsibilities") Responsibilities responsibilities; + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + @SerializedName("timezone") + Object timezone; + private Defaults( Object currency, Map extraParams, List locales, Profile profile, - Responsibilities responsibilities) { + Responsibilities responsibilities, + Object timezone) { this.currency = currency; this.extraParams = extraParams; this.locales = locales; this.profile = profile; this.responsibilities = responsibilities; + this.timezone = timezone; } public static Builder builder() { @@ -10696,10 +10707,17 @@ public static class Builder { private Responsibilities responsibilities; + private Object timezone; + /** Finalize and obtain parameter instance from this builder. */ public AccountUpdateParams.Defaults build() { return new AccountUpdateParams.Defaults( - this.currency, this.extraParams, this.locales, this.profile, this.responsibilities); + this.currency, + this.extraParams, + this.locales, + this.profile, + this.responsibilities, + this.timezone); } /** @@ -10786,6 +10804,24 @@ public Builder setResponsibilities( this.responsibilities = responsibilities; return this; } + + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + public Builder setTimezone(String timezone) { + this.timezone = timezone; + return this; + } + + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + public Builder setTimezone(EmptyParam timezone) { + this.timezone = timezone; + return this; + } } @Getter @@ -13246,8 +13282,7 @@ public AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue build() { } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -13298,123 +13333,6 @@ public Builder setFiscalYearEnd(EmptyParam fiscalYearEnd) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - Object currency; - - /** - * 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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(Object currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Object currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount build() { - return new AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(EmptyParam currency) { - this.currency = currency; - 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 - * AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount#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 - * AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount#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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -15664,8 +15582,7 @@ public AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue buil } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -15700,124 +15617,6 @@ public Builder putAllExtraParam(Map map) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - Object currency; - - /** - * 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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(Object currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Object currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - build() { - return new AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue - .Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(EmptyParam currency) { - this.currency = currency; - 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 - * AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#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 - * AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#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. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -19536,7 +19335,7 @@ public Builder setOwner(Boolean owner) { } /** The percent owned by the person of the account's legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/BatchJobCreateParams.java b/src/main/java/com/stripe/param/v2/core/BatchJobCreateParams.java new file mode 100644 index 00000000000..34c67d543af --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/BatchJobCreateParams.java @@ -0,0 +1,356 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class BatchJobCreateParams extends ApiRequestParams { + /** Required. The endpoint configuration for the batch job. */ + @SerializedName("endpoint") + Endpoint endpoint; + + /** + * 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; + + /** + * Optional field that allows the user to control how fast they want this batch job to run. Gives + * them a control over the number of webhooks they receive. + */ + @SerializedName("maximum_rps") + Long maximumRps; + + /** Required. The metadata of the {@code BatchJob} object. */ + @SerializedName("metadata") + Map metadata; + + /** Notification suppression settings for the batch job. */ + @SerializedName("notification_suppression") + NotificationSuppression notificationSuppression; + + /** Required. Allows the user to skip validation. */ + @SerializedName("skip_validation") + Boolean skipValidation; + + private BatchJobCreateParams( + Endpoint endpoint, + Map extraParams, + Long maximumRps, + Map metadata, + NotificationSuppression notificationSuppression, + Boolean skipValidation) { + this.endpoint = endpoint; + this.extraParams = extraParams; + this.maximumRps = maximumRps; + this.metadata = metadata; + this.notificationSuppression = notificationSuppression; + this.skipValidation = skipValidation; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Endpoint endpoint; + + private Map extraParams; + + private Long maximumRps; + + private Map metadata; + + private NotificationSuppression notificationSuppression; + + private Boolean skipValidation; + + /** Finalize and obtain parameter instance from this builder. */ + public BatchJobCreateParams build() { + return new BatchJobCreateParams( + this.endpoint, + this.extraParams, + this.maximumRps, + this.metadata, + this.notificationSuppression, + this.skipValidation); + } + + /** Required. The endpoint configuration for the batch job. */ + public Builder setEndpoint(BatchJobCreateParams.Endpoint endpoint) { + this.endpoint = endpoint; + 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 + * BatchJobCreateParams#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 BatchJobCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Optional field that allows the user to control how fast they want this batch job to run. + * Gives them a control over the number of webhooks they receive. + */ + public Builder setMaximumRps(Long maximumRps) { + this.maximumRps = maximumRps; + return this; + } + + /** + * Add a key/value pair to `metadata` 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 + * BatchJobCreateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` 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 BatchJobCreateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** Notification suppression settings for the batch job. */ + public Builder setNotificationSuppression( + BatchJobCreateParams.NotificationSuppression notificationSuppression) { + this.notificationSuppression = notificationSuppression; + return this; + } + + /** Required. Allows the user to skip validation. */ + public Builder setSkipValidation(Boolean skipValidation) { + this.skipValidation = skipValidation; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Endpoint { + /** + * 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 HTTP method to use when calling the endpoint. */ + @SerializedName("http_method") + HttpMethod httpMethod; + + /** + * Required. The path of the endpoint to run this batch job against. In the + * form used in the documentation. For instance, for subscription migration this would be {@code + * /v1/subscriptions/:id/migrate}. + */ + @SerializedName("path") + String path; + + private Endpoint(Map extraParams, HttpMethod httpMethod, String path) { + this.extraParams = extraParams; + this.httpMethod = httpMethod; + this.path = path; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private HttpMethod httpMethod; + + private String path; + + /** Finalize and obtain parameter instance from this builder. */ + public BatchJobCreateParams.Endpoint build() { + return new BatchJobCreateParams.Endpoint(this.extraParams, this.httpMethod, this.path); + } + + /** + * 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 + * BatchJobCreateParams.Endpoint#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 BatchJobCreateParams.Endpoint#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 HTTP method to use when calling the endpoint. */ + public Builder setHttpMethod(BatchJobCreateParams.Endpoint.HttpMethod httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + /** + * Required. The path of the endpoint to run this batch job against. In the + * form used in the documentation. For instance, for subscription migration this would be + * {@code /v1/subscriptions/:id/migrate}. + */ + public Builder setPath(String path) { + this.path = path; + return this; + } + } + + public enum HttpMethod implements ApiRequestParams.EnumParam { + @SerializedName("post") + POST("post"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + HttpMethod(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NotificationSuppression { + /** + * 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 scope of notification suppression. */ + @SerializedName("scope") + Scope scope; + + private NotificationSuppression(Map extraParams, Scope scope) { + this.extraParams = extraParams; + this.scope = scope; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Scope scope; + + /** Finalize and obtain parameter instance from this builder. */ + public BatchJobCreateParams.NotificationSuppression build() { + return new BatchJobCreateParams.NotificationSuppression(this.extraParams, this.scope); + } + + /** + * 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 + * BatchJobCreateParams.NotificationSuppression#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 BatchJobCreateParams.NotificationSuppression#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 scope of notification suppression. */ + public Builder setScope(BatchJobCreateParams.NotificationSuppression.Scope scope) { + this.scope = scope; + return this; + } + } + + public enum Scope implements ApiRequestParams.EnumParam { + @SerializedName("all") + ALL("all"), + + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Scope(String value) { + this.value = value; + } + } + } +} diff --git a/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java b/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java index 946287f6e15..ac0f1c63ee2 100644 --- a/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java @@ -17,6 +17,10 @@ public class EventDestinationCreateParams extends ApiRequestParams { @SerializedName("amazon_eventbridge") AmazonEventbridge amazonEventbridge; + /** Azure Event Grid configuration. */ + @SerializedName("azure_event_grid") + AzureEventGrid azureEventGrid; + /** An optional description of what the event destination is used for. */ @SerializedName("description") String description; @@ -29,9 +33,16 @@ public class EventDestinationCreateParams extends ApiRequestParams { @SerializedName("event_payload") EventPayload eventPayload; - /** Where events should be routed from. */ + /** + * Specifies which accounts' events route to this destination. {@code @self}: Receive events from + * the account that owns the event destination. {@code @accounts}: Receive events emitted from + * other accounts you manage which includes your v1 and v2 accounts. + * {@code @organization_members}: Receive events from accounts directly linked to the + * organization. {@code @organization_members/@accounts}: Receive events from all accounts + * connected to any platform accounts in the organization. + */ @SerializedName("events_from") - List eventsFrom; + List eventsFrom; /** * Map of extra parameters for custom features not available in this client library. The content @@ -68,10 +79,11 @@ public class EventDestinationCreateParams extends ApiRequestParams { private EventDestinationCreateParams( AmazonEventbridge amazonEventbridge, + AzureEventGrid azureEventGrid, String description, List enabledEvents, EventPayload eventPayload, - List eventsFrom, + List eventsFrom, Map extraParams, List include, Map metadata, @@ -80,6 +92,7 @@ private EventDestinationCreateParams( Type type, WebhookEndpoint webhookEndpoint) { this.amazonEventbridge = amazonEventbridge; + this.azureEventGrid = azureEventGrid; this.description = description; this.enabledEvents = enabledEvents; this.eventPayload = eventPayload; @@ -100,13 +113,15 @@ public static Builder builder() { public static class Builder { private AmazonEventbridge amazonEventbridge; + private AzureEventGrid azureEventGrid; + private String description; private List enabledEvents; private EventPayload eventPayload; - private List eventsFrom; + private List eventsFrom; private Map extraParams; @@ -126,6 +141,7 @@ public static class Builder { public EventDestinationCreateParams build() { return new EventDestinationCreateParams( this.amazonEventbridge, + this.azureEventGrid, this.description, this.enabledEvents, this.eventPayload, @@ -146,6 +162,12 @@ public Builder setAmazonEventbridge( return this; } + /** Azure Event Grid configuration. */ + public Builder setAzureEventGrid(EventDestinationCreateParams.AzureEventGrid azureEventGrid) { + this.azureEventGrid = azureEventGrid; + return this; + } + /** An optional description of what the event destination is used for. */ public Builder setDescription(String description) { this.description = description; @@ -189,7 +211,7 @@ public Builder setEventPayload(EventDestinationCreateParams.EventPayload eventPa * and subsequent calls adds additional elements to the original list. See {@link * EventDestinationCreateParams#eventsFrom} for the field documentation. */ - public Builder addEventsFrom(EventDestinationCreateParams.EventsFrom element) { + public Builder addEventsFrom(String element) { if (this.eventsFrom == null) { this.eventsFrom = new ArrayList<>(); } @@ -202,7 +224,7 @@ public Builder addEventsFrom(EventDestinationCreateParams.EventsFrom element) { * and subsequent calls adds additional elements to the original list. See {@link * EventDestinationCreateParams#eventsFrom} for the field documentation. */ - public Builder addAllEventsFrom(List elements) { + public Builder addAllEventsFrom(List elements) { if (this.eventsFrom == null) { this.eventsFrom = new ArrayList<>(); } @@ -399,6 +421,110 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AzureEventGrid { + /** Required. The Azure region. */ + @SerializedName("azure_region") + String azureRegion; + + /** Required. The name of the Azure resource group. */ + @SerializedName("azure_resource_group_name") + String azureResourceGroupName; + + /** Required. The Azure subscription ID. */ + @SerializedName("azure_subscription_id") + String azureSubscriptionId; + + /** + * 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 AzureEventGrid( + String azureRegion, + String azureResourceGroupName, + String azureSubscriptionId, + Map extraParams) { + this.azureRegion = azureRegion; + this.azureResourceGroupName = azureResourceGroupName; + this.azureSubscriptionId = azureSubscriptionId; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String azureRegion; + + private String azureResourceGroupName; + + private String azureSubscriptionId; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public EventDestinationCreateParams.AzureEventGrid build() { + return new EventDestinationCreateParams.AzureEventGrid( + this.azureRegion, + this.azureResourceGroupName, + this.azureSubscriptionId, + this.extraParams); + } + + /** Required. The Azure region. */ + public Builder setAzureRegion(String azureRegion) { + this.azureRegion = azureRegion; + return this; + } + + /** Required. The name of the Azure resource group. */ + public Builder setAzureResourceGroupName(String azureResourceGroupName) { + this.azureResourceGroupName = azureResourceGroupName; + return this; + } + + /** Required. The Azure subscription ID. */ + public Builder setAzureSubscriptionId(String azureSubscriptionId) { + this.azureSubscriptionId = azureSubscriptionId; + 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 + * EventDestinationCreateParams.AzureEventGrid#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 EventDestinationCreateParams.AzureEventGrid#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class WebhookEndpoint { @@ -484,21 +610,6 @@ public enum EventPayload implements ApiRequestParams.EnumParam { } } - public enum EventsFrom implements ApiRequestParams.EnumParam { - @SerializedName("other_accounts") - OTHER_ACCOUNTS("other_accounts"), - - @SerializedName("self") - SELF("self"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - EventsFrom(String value) { - this.value = value; - } - } - public enum Include implements ApiRequestParams.EnumParam { @SerializedName("webhook_endpoint.signing_secret") WEBHOOK_ENDPOINT__SIGNING_SECRET("webhook_endpoint.signing_secret"), @@ -518,6 +629,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("amazon_eventbridge") AMAZON_EVENTBRIDGE("amazon_eventbridge"), + @SerializedName("azure_event_grid") + AZURE_EVENT_GRID("azure_event_grid"), + @SerializedName("webhook_endpoint") WEBHOOK_ENDPOINT("webhook_endpoint"); diff --git a/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java b/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java index cb190454762..23964e137e1 100644 --- a/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -2575,7 +2576,7 @@ public static class Relationship { /** The percentage of ownership the person has in the associated legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** Indicates whether the person is a representative of the associated legal entity. */ @SerializedName("representative") @@ -2592,7 +2593,7 @@ private Relationship( Map extraParams, Boolean legalGuardian, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, Boolean representative, String title) { this.authorizer = authorizer; @@ -2623,7 +2624,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private Boolean representative; @@ -2700,7 +2701,7 @@ public Builder setOwner(Boolean owner) { } /** The percentage of ownership the person has in the associated legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java b/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java index 5d4fae4ceb8..47d2c7f0f15 100644 --- a/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -2545,7 +2546,7 @@ public static class Relationship { /** The percentage of ownership the person has in the associated legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** Indicates whether the person is a representative of the associated legal entity. */ @SerializedName("representative") @@ -2562,7 +2563,7 @@ private Relationship( Map extraParams, Boolean legalGuardian, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, Boolean representative, String title) { this.authorizer = authorizer; @@ -2593,7 +2594,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private Boolean representative; @@ -2670,7 +2671,7 @@ public Builder setOwner(Boolean owner) { } /** The percentage of ownership the person has in the associated legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java b/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java index c886d483511..001c826555a 100644 --- a/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -2918,7 +2919,7 @@ public Builder setOwner(Boolean owner) { } /** The percentage of ownership the person has in the associated legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java b/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java index 99bab7392cc..d2d92082548 100644 --- a/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java @@ -11,7 +11,7 @@ @Getter @EqualsAndHashCode(callSuper = false) public class GbBankAccountCreateParams extends ApiRequestParams { - /** Required. The Account Number of the bank account. */ + /** The Account Number of the bank account. */ @SerializedName("account_number") String accountNumber; @@ -27,6 +27,10 @@ public class GbBankAccountCreateParams extends ApiRequestParams { @SerializedName("confirmation_of_payee") ConfirmationOfPayee confirmationOfPayee; + /** Required. The currency of the bank account. */ + @SerializedName("currency") + String currency; + /** * 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 @@ -36,7 +40,11 @@ public class GbBankAccountCreateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. The Sort Code of the bank account. */ + /** The IBAN of the bank account. */ + @SerializedName("iban") + String iban; + + /** The Sort Code of the bank account. */ @SerializedName("sort_code") String sortCode; @@ -44,12 +52,16 @@ private GbBankAccountCreateParams( String accountNumber, BankAccountType bankAccountType, ConfirmationOfPayee confirmationOfPayee, + String currency, Map extraParams, + String iban, String sortCode) { this.accountNumber = accountNumber; this.bankAccountType = bankAccountType; this.confirmationOfPayee = confirmationOfPayee; + this.currency = currency; this.extraParams = extraParams; + this.iban = iban; this.sortCode = sortCode; } @@ -64,8 +76,12 @@ public static class Builder { private ConfirmationOfPayee confirmationOfPayee; + private String currency; + private Map extraParams; + private String iban; + private String sortCode; /** Finalize and obtain parameter instance from this builder. */ @@ -74,11 +90,13 @@ public GbBankAccountCreateParams build() { this.accountNumber, this.bankAccountType, this.confirmationOfPayee, + this.currency, this.extraParams, + this.iban, this.sortCode); } - /** Required. The Account Number of the bank account. */ + /** The Account Number of the bank account. */ public Builder setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; return this; @@ -101,6 +119,12 @@ public Builder setConfirmationOfPayee( return this; } + /** Required. The currency of the bank account. */ + public Builder setCurrency(String currency) { + this.currency = currency; + 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 @@ -127,7 +151,13 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. The Sort Code of the bank account. */ + /** The IBAN of the bank account. */ + public Builder setIban(String iban) { + this.iban = iban; + return this; + } + + /** The Sort Code of the bank account. */ public Builder setSortCode(String sortCode) { this.sortCode = sortCode; return this; diff --git a/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java index a4e185f8968..fbfcc96efce 100644 --- a/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java @@ -19,6 +19,10 @@ public class UsBankAccountCreateParams extends ApiRequestParams { @SerializedName("bank_account_type") BankAccountType bankAccountType; + /** Required. The currency of the bank account. */ + @SerializedName("currency") + String currency; + /** * 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 @@ -45,11 +49,13 @@ public class UsBankAccountCreateParams extends ApiRequestParams { private UsBankAccountCreateParams( String accountNumber, BankAccountType bankAccountType, + String currency, Map extraParams, String fedwireRoutingNumber, String routingNumber) { this.accountNumber = accountNumber; this.bankAccountType = bankAccountType; + this.currency = currency; this.extraParams = extraParams; this.fedwireRoutingNumber = fedwireRoutingNumber; this.routingNumber = routingNumber; @@ -64,6 +70,8 @@ public static class Builder { private BankAccountType bankAccountType; + private String currency; + private Map extraParams; private String fedwireRoutingNumber; @@ -75,6 +83,7 @@ public UsBankAccountCreateParams build() { return new UsBankAccountCreateParams( this.accountNumber, this.bankAccountType, + this.currency, this.extraParams, this.fedwireRoutingNumber, this.routingNumber); @@ -92,6 +101,12 @@ public Builder setBankAccountType(UsBankAccountCreateParams.BankAccountType bank return this; } + /** Required. The currency of the bank account. */ + public Builder setCurrency(String currency) { + this.currency = currency; + 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 diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/InboundTransferCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/InboundTransferCreateParams.java index 15f5d5937f6..9be96532c88 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/InboundTransferCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/InboundTransferCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -75,7 +76,7 @@ public InboundTransferCreateParams build() { * Required. The amount, in specified currency, by which the FinancialAccount * balance will increase due to the InboundTransfer. */ - public Builder setAmount(InboundTransferCreateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -128,102 +129,6 @@ public Builder setTo(InboundTransferCreateParams.To to) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * 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. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public InboundTransferCreateParams.Amount build() { - return new InboundTransferCreateParams.Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * InboundTransferCreateParams.Amount#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 InboundTransferCreateParams.Amount#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. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } - @Getter @EqualsAndHashCode(callSuper = false) public static class From { diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java index cf6c6f060da..dc2fb29644a 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -128,7 +129,7 @@ public OutboundPaymentCreateParams build() { /** * Required. The "presentment amount" to be sent to the recipient. */ - public Builder setAmount(OutboundPaymentCreateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -236,102 +237,6 @@ public Builder setTo(OutboundPaymentCreateParams.To to) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * 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. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public OutboundPaymentCreateParams.Amount build() { - return new OutboundPaymentCreateParams.Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * OutboundPaymentCreateParams.Amount#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 OutboundPaymentCreateParams.Amount#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. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } - @Getter @EqualsAndHashCode(callSuper = false) public static class DeliveryOptions { diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentQuoteCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentQuoteCreateParams.java index 4f0fbdb08b0..fa3b0e333c8 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentQuoteCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentQuoteCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -73,7 +74,7 @@ public OutboundPaymentQuoteCreateParams build() { /** * Required. The "presentment amount" to be sent to the recipient. */ - public Builder setAmount(OutboundPaymentQuoteCreateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -126,104 +127,6 @@ public Builder setTo(OutboundPaymentQuoteCreateParams.To to) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * 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. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public OutboundPaymentQuoteCreateParams.Amount build() { - return new OutboundPaymentQuoteCreateParams.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * OutboundPaymentQuoteCreateParams.Amount#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 OutboundPaymentQuoteCreateParams.Amount#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. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } - @Getter @EqualsAndHashCode(callSuper = false) public static class DeliveryOptions { diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java index 91aeb2870da..43d39e9c4a3 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java @@ -247,6 +247,10 @@ public static class BankAccount { @SerializedName("country") String country; + /** Required. The currency of the bank account. */ + @SerializedName("currency") + String currency; + /** * 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. @@ -269,6 +273,7 @@ private BankAccount( BankAccountType bankAccountType, String branchNumber, String country, + String currency, Map extraParams, String routingNumber, String swiftCode) { @@ -276,6 +281,7 @@ private BankAccount( this.bankAccountType = bankAccountType; this.branchNumber = branchNumber; this.country = country; + this.currency = currency; this.extraParams = extraParams; this.routingNumber = routingNumber; this.swiftCode = swiftCode; @@ -294,6 +300,8 @@ public static class Builder { private String country; + private String currency; + private Map extraParams; private String routingNumber; @@ -307,6 +315,7 @@ public OutboundSetupIntentCreateParams.PayoutMethodData.BankAccount build() { this.bankAccountType, this.branchNumber, this.country, + this.currency, this.extraParams, this.routingNumber, this.swiftCode); @@ -338,6 +347,12 @@ public Builder setCountry(String country) { return this; } + /** Required. The currency of the bank account. */ + public Builder setCurrency(String currency) { + this.currency = currency; + 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 @@ -398,6 +413,10 @@ public enum BankAccountType implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Card { + /** Required. The currency of the card. */ + @SerializedName("currency") + String currency; + /** Required. The expiration month of the card. */ @SerializedName("exp_month") String expMonth; @@ -420,7 +439,12 @@ public static class Card { String number; private Card( - String expMonth, String expYear, Map extraParams, String number) { + String currency, + String expMonth, + String expYear, + Map extraParams, + String number) { + this.currency = currency; this.expMonth = expMonth; this.expYear = expYear; this.extraParams = extraParams; @@ -432,6 +456,8 @@ public static Builder builder() { } public static class Builder { + private String currency; + private String expMonth; private String expYear; @@ -443,7 +469,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public OutboundSetupIntentCreateParams.PayoutMethodData.Card build() { return new OutboundSetupIntentCreateParams.PayoutMethodData.Card( - this.expMonth, this.expYear, this.extraParams, this.number); + this.currency, this.expMonth, this.expYear, this.extraParams, this.number); + } + + /** Required. The currency of the card. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; } /** Required. The expiration month of the card. */ diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java index d40727bc9b0..6b0199fbf5d 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java @@ -226,6 +226,10 @@ public static class BankAccount { @SerializedName("country") Object country; + /** Required. The currency of the bank account. */ + @SerializedName("currency") + Object currency; + /** * 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. @@ -248,6 +252,7 @@ private BankAccount( BankAccountType bankAccountType, Object branchNumber, Object country, + Object currency, Map extraParams, Object routingNumber, Object swiftCode) { @@ -255,6 +260,7 @@ private BankAccount( this.bankAccountType = bankAccountType; this.branchNumber = branchNumber; this.country = country; + this.currency = currency; this.extraParams = extraParams; this.routingNumber = routingNumber; this.swiftCode = swiftCode; @@ -273,6 +279,8 @@ public static class Builder { private Object country; + private Object currency; + private Map extraParams; private Object routingNumber; @@ -286,6 +294,7 @@ public OutboundSetupIntentUpdateParams.PayoutMethodData.BankAccount build() { this.bankAccountType, this.branchNumber, this.country, + this.currency, this.extraParams, this.routingNumber, this.swiftCode); @@ -335,6 +344,18 @@ public Builder setCountry(EmptyParam country) { return this; } + /** Required. The currency of the bank account. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** Required. The currency of the bank account. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + 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 @@ -407,6 +428,10 @@ public enum BankAccountType implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Card { + /** The currency of the card. */ + @SerializedName("currency") + Object currency; + /** The expiration month of the card. */ @SerializedName("exp_month") Object expMonth; @@ -432,7 +457,12 @@ public static class Card { Object number; private Card( - Object expMonth, Object expYear, Map extraParams, Object number) { + Object currency, + Object expMonth, + Object expYear, + Map extraParams, + Object number) { + this.currency = currency; this.expMonth = expMonth; this.expYear = expYear; this.extraParams = extraParams; @@ -444,6 +474,8 @@ public static Builder builder() { } public static class Builder { + private Object currency; + private Object expMonth; private Object expYear; @@ -455,7 +487,19 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public OutboundSetupIntentUpdateParams.PayoutMethodData.Card build() { return new OutboundSetupIntentUpdateParams.PayoutMethodData.Card( - this.expMonth, this.expYear, this.extraParams, this.number); + this.currency, this.expMonth, this.expYear, this.extraParams, this.number); + } + + /** The currency of the card. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** The currency of the card. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + return this; } /** The expiration month of the card. */ diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java index 3004599d4a6..75ea1360a1a 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -96,7 +97,7 @@ public OutboundTransferCreateParams build() { } /** Required. The "presentment amount" for the OutboundPayment. */ - public Builder setAmount(OutboundTransferCreateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -181,102 +182,6 @@ public Builder setTo(OutboundTransferCreateParams.To to) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * 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. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public OutboundTransferCreateParams.Amount build() { - return new OutboundTransferCreateParams.Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * OutboundTransferCreateParams.Amount#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 OutboundTransferCreateParams.Amount#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. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } - @Getter @EqualsAndHashCode(callSuper = false) public static class DeliveryOptions { diff --git a/src/main/java/com/stripe/param/v2/testhelpers/FinancialAddressCreditParams.java b/src/main/java/com/stripe/param/v2/testhelpers/FinancialAddressCreditParams.java index fd374c5e1bd..8a0fd4193a7 100644 --- a/src/main/java/com/stripe/param/v2/testhelpers/FinancialAddressCreditParams.java +++ b/src/main/java/com/stripe/param/v2/testhelpers/FinancialAddressCreditParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -66,7 +67,7 @@ public FinancialAddressCreditParams build() { } /** Required. Object containing the amount value and currency to credit. */ - public Builder setAmount(FinancialAddressCreditParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -116,102 +117,6 @@ public Builder setStatementDescriptor(String statementDescriptor) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * 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. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public FinancialAddressCreditParams.Amount build() { - return new FinancialAddressCreditParams.Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * FinancialAddressCreditParams.Amount#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 FinancialAddressCreditParams.Amount#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. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } - public enum Network implements ApiRequestParams.EnumParam { @SerializedName("ach") ACH("ach"), diff --git a/src/main/java/com/stripe/service/CustomerPaymentSourceService.java b/src/main/java/com/stripe/service/CustomerPaymentSourceService.java index 3b28c7dfdf8..f7cd4a699f1 100644 --- a/src/main/java/com/stripe/service/CustomerPaymentSourceService.java +++ b/src/main/java/com/stripe/service/CustomerPaymentSourceService.java @@ -59,8 +59,8 @@ public StripeCollection list( * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create(String customer, CustomerPaymentSourceCreateParams params) throws StripeException { @@ -72,8 +72,8 @@ public PaymentSource create(String customer, CustomerPaymentSourceCreateParams p * *

If the card’s owner has no default card, then the new card will become the default. However, * if the owner already has a default, then it will not change. To change the default, you should - * update the customer to have a new - * {@code default_source}. + * update the customer to have a new {@code + * default_source}. */ public PaymentSource create( String customer, CustomerPaymentSourceCreateParams params, RequestOptions options) diff --git a/src/main/java/com/stripe/service/InvoiceService.java b/src/main/java/com/stripe/service/InvoiceService.java index 867d25a3d6e..16a9b0dab23 100644 --- a/src/main/java/com/stripe/service/InvoiceService.java +++ b/src/main/java/com/stripe/service/InvoiceService.java @@ -39,7 +39,7 @@ public InvoiceService(StripeResponseGetter responseGetter) { * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete(String invoice) throws StripeException { return delete(invoice, (RequestOptions) null); @@ -48,7 +48,7 @@ public Invoice delete(String invoice) throws StripeException { * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices * that are no longer in a draft state will fail; once an invoice has been finalized or if an * invoice is for a subscription, it must be voided. + * href="https://stripe.com/api/invoices/void">voided. */ public Invoice delete(String invoice, RequestOptions options) throws StripeException { String path = String.format("/v1/invoices/%s", ApiResource.urlEncodeId(invoice)); @@ -181,8 +181,8 @@ public StripeCollection list(InvoiceListParams params, RequestOptions o } /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public Invoice create(InvoiceCreateParams params) throws StripeException { @@ -190,8 +190,8 @@ public Invoice create(InvoiceCreateParams params) throws StripeException { } /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public Invoice create(RequestOptions options) throws StripeException { @@ -199,8 +199,8 @@ public Invoice create(RequestOptions options) throws StripeException { } /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public Invoice create() throws StripeException { @@ -208,8 +208,8 @@ public Invoice create() throws StripeException { } /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until - * you finalize the invoice, which - * allows you to pay or finalize the invoice, which allows + * you to pay or send the invoice to your customers. */ public Invoice create(InvoiceCreateParams params, RequestOptions options) throws StripeException { @@ -624,14 +624,14 @@ public Invoice updateLines( } /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(String invoice, InvoiceVoidInvoiceParams params) throws StripeException { @@ -639,42 +639,42 @@ public Invoice voidInvoice(String invoice, InvoiceVoidInvoiceParams params) } /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(String invoice, RequestOptions options) throws StripeException { return voidInvoice(invoice, (InvoiceVoidInvoiceParams) null, options); } /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice(String invoice) throws StripeException { return voidInvoice(invoice, (InvoiceVoidInvoiceParams) null, (RequestOptions) null); } /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to + * href="https://stripe.com/api/invoices/delete">deletion, however it only applies to * finalized invoices and maintains a papertrail where the invoice can still be found. * *

Consult with local regulations to determine whether and how an invoice might be amended, * canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe - * recommends that you consult with your legal counsel for advice specific to your business. + * href="https://stripe.com/api/invoices/create">issue another invoice or credit note instead. Stripe recommends + * that you consult with your legal counsel for advice specific to your business. */ public Invoice voidInvoice( String invoice, InvoiceVoidInvoiceParams params, RequestOptions options) diff --git a/src/main/java/com/stripe/service/PaymentIntentService.java b/src/main/java/com/stripe/service/PaymentIntentService.java index 5351ce25e3f..ac9e22343a8 100644 --- a/src/main/java/com/stripe/service/PaymentIntentService.java +++ b/src/main/java/com/stripe/service/PaymentIntentService.java @@ -294,9 +294,9 @@ public PaymentIntent applyCustomerBalance( * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(String intent, PaymentIntentCancelParams params) throws StripeException { @@ -312,9 +312,9 @@ public PaymentIntent cancel(String intent, PaymentIntentCancelParams params) * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(String intent, RequestOptions options) throws StripeException { return cancel(intent, (PaymentIntentCancelParams) null, options); @@ -329,9 +329,9 @@ public PaymentIntent cancel(String intent, RequestOptions options) throws Stripe * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel(String intent) throws StripeException { return cancel(intent, (PaymentIntentCancelParams) null, (RequestOptions) null); @@ -346,9 +346,9 @@ public PaymentIntent cancel(String intent) throws StripeException { * on the PaymentIntent fail with an error. For PaymentIntents with a {@code status} of {@code * requires_capture}, the remaining {@code amount_capturable} is automatically refunded. * - *

You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + *

You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent + * has a status of {@code requires_capture}. Otherwise, you must expire the Checkout Session. */ public PaymentIntent cancel( String intent, PaymentIntentCancelParams params, RequestOptions options) diff --git a/src/main/java/com/stripe/service/PayoutService.java b/src/main/java/com/stripe/service/PayoutService.java index b46edd7bcb7..4751e9a8cd8 100644 --- a/src/main/java/com/stripe/service/PayoutService.java +++ b/src/main/java/com/stripe/service/PayoutService.java @@ -75,8 +75,8 @@ public StripeCollection list(PayoutListParams params, RequestOptions opt * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public Payout create(PayoutCreateParams params) throws StripeException { return create(params, (RequestOptions) null); @@ -91,8 +91,8 @@ public Payout create(PayoutCreateParams params) throws StripeException { * *

If you create a manual payout on a Stripe account that uses multiple payment source types, * you need to specify the source type balance that the payout draws from. The balance object details available and - * pending amounts by source type. + * href="https://stripe.com/api/balances/object">balance object details available and pending + * amounts by source type. */ public Payout create(PayoutCreateParams params, RequestOptions options) throws StripeException { String path = "/v1/payouts"; diff --git a/src/main/java/com/stripe/service/ProductCatalogService.java b/src/main/java/com/stripe/service/ProductCatalogService.java new file mode 100644 index 00000000000..abfa4ccfa2c --- /dev/null +++ b/src/main/java/com/stripe/service/ProductCatalogService.java @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec +package com.stripe.service; + +import com.stripe.net.ApiService; +import com.stripe.net.StripeResponseGetter; + +public final class ProductCatalogService extends ApiService { + public ProductCatalogService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + public com.stripe.service.productcatalog.TrialOfferService trialOffers() { + return new com.stripe.service.productcatalog.TrialOfferService(this.getResponseGetter()); + } +} diff --git a/src/main/java/com/stripe/service/SubscriptionService.java b/src/main/java/com/stripe/service/SubscriptionService.java index e275a677335..9f58e62f243 100644 --- a/src/main/java/com/stripe/service/SubscriptionService.java +++ b/src/main/java/com/stripe/service/SubscriptionService.java @@ -34,9 +34,9 @@ public SubscriptionService(StripeResponseGetter responseGetter) { * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -56,9 +56,9 @@ public Subscription cancel(String subscriptionExposedId, SubscriptionCancelParam * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -78,9 +78,9 @@ public Subscription cancel(String subscriptionExposedId, RequestOptions options) * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * @@ -99,9 +99,9 @@ public Subscription cancel(String subscriptionExposedId) throws StripeException * href="https://stripe.com/metadata">metadata. * *

Any pending invoice items that you’ve created are still charged at the end of the period, - * unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations are also left - * in place and collected at the end of the period. But if the subscription is set to cancel + * unless manually deleted. If you’ve set + * the subscription to cancel at the end of the period, any pending prorations are also left in + * place and collected at the end of the period. But if the subscription is set to cancel * immediately, pending prorations are removed if {@code invoice_now} and {@code prorate} are both * set to true. * diff --git a/src/main/java/com/stripe/service/TaxService.java b/src/main/java/com/stripe/service/TaxService.java index bb805e3527d..c359f37c717 100644 --- a/src/main/java/com/stripe/service/TaxService.java +++ b/src/main/java/com/stripe/service/TaxService.java @@ -21,6 +21,10 @@ public com.stripe.service.tax.FormService forms() { return new com.stripe.service.tax.FormService(this.getResponseGetter()); } + public com.stripe.service.tax.LocationService locations() { + return new com.stripe.service.tax.LocationService(this.getResponseGetter()); + } + public com.stripe.service.tax.RegistrationService registrations() { return new com.stripe.service.tax.RegistrationService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/V1Services.java b/src/main/java/com/stripe/service/V1Services.java index 765e183fa26..d1048bac5eb 100644 --- a/src/main/java/com/stripe/service/V1Services.java +++ b/src/main/java/com/stripe/service/V1Services.java @@ -221,6 +221,10 @@ public com.stripe.service.PrivacyService privacy() { return new com.stripe.service.PrivacyService(this.getResponseGetter()); } + public com.stripe.service.ProductCatalogService productCatalog() { + return new com.stripe.service.ProductCatalogService(this.getResponseGetter()); + } + public com.stripe.service.ProductService products() { return new com.stripe.service.ProductService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/productcatalog/TrialOfferService.java b/src/main/java/com/stripe/service/productcatalog/TrialOfferService.java new file mode 100644 index 00000000000..70ff2641bcf --- /dev/null +++ b/src/main/java/com/stripe/service/productcatalog/TrialOfferService.java @@ -0,0 +1,37 @@ +// File generated from our OpenAPI spec +package com.stripe.service.productcatalog; + +import com.stripe.exception.StripeException; +import com.stripe.model.productcatalog.TrialOffer; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.ApiService; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.productcatalog.TrialOfferCreateParams; + +public final class TrialOfferService extends ApiService { + public TrialOfferService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Creates a trial offer. */ + public TrialOffer create(TrialOfferCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** Creates a trial offer. */ + public TrialOffer create(TrialOfferCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/product_catalog/trial_offers"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, TrialOffer.class); + } +} diff --git a/src/main/java/com/stripe/service/tax/LocationService.java b/src/main/java/com/stripe/service/tax/LocationService.java new file mode 100644 index 00000000000..4f62322aa36 --- /dev/null +++ b/src/main/java/com/stripe/service/tax/LocationService.java @@ -0,0 +1,129 @@ +// File generated from our OpenAPI spec +package com.stripe.service.tax; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.StripeCollection; +import com.stripe.model.tax.Location; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.ApiService; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.tax.LocationCreateParams; +import com.stripe.param.tax.LocationListParams; +import com.stripe.param.tax.LocationRetrieveParams; + +public final class LocationService extends ApiService { + public LocationService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public StripeCollection list(LocationListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + /** + * Retrieve a list of all tax locations. Tax locations can represent the venues for services, + * tickets, or other product types. + * + *

The response includes detailed information for each tax location, such as its address, name, + * description, and current operational status. + * + *

You can paginate through the list by using the {@code limit} parameter to control the number + * of results returned in each request. + */ + public StripeCollection list(LocationListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public Location create(LocationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** + * Create a tax location to use in calculating taxes for a service, ticket, or other type of + * product. The resulting object contains the id, address, name, description, and current + * operational status of the tax location. + */ + public Location create(LocationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/tax/locations"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Location.class); + } + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public Location retrieve(String location, LocationRetrieveParams params) throws StripeException { + return retrieve(location, params, (RequestOptions) null); + } + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public Location retrieve(String location, RequestOptions options) throws StripeException { + return retrieve(location, (LocationRetrieveParams) null, options); + } + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public Location retrieve(String location) throws StripeException { + return retrieve(location, (LocationRetrieveParams) null, (RequestOptions) null); + } + /** + * Fetch the details of a specific tax location using its unique identifier. Use a tax location to + * calculate taxes based on the location of the end product, such as a performance, instead of the + * customer address. For more details, check the integration guide. + */ + public Location retrieve(String location, LocationRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/tax/locations/%s", ApiResource.urlEncodeId(location)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Location.class); + } +} diff --git a/src/main/java/com/stripe/service/v2/CoreService.java b/src/main/java/com/stripe/service/v2/CoreService.java index 8e1990f3696..3e89f36e4cb 100644 --- a/src/main/java/com/stripe/service/v2/CoreService.java +++ b/src/main/java/com/stripe/service/v2/CoreService.java @@ -21,6 +21,10 @@ public com.stripe.service.v2.core.AccountService accounts() { return new com.stripe.service.v2.core.AccountService(this.getResponseGetter()); } + public com.stripe.service.v2.core.BatchJobService batchJobs() { + return new com.stripe.service.v2.core.BatchJobService(this.getResponseGetter()); + } + public com.stripe.service.v2.core.EventDestinationService eventDestinations() { return new com.stripe.service.v2.core.EventDestinationService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/v2/core/BatchJobService.java b/src/main/java/com/stripe/service/v2/core/BatchJobService.java new file mode 100644 index 00000000000..49f56c52677 --- /dev/null +++ b/src/main/java/com/stripe/service/v2/core/BatchJobService.java @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.core; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.ApiService; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.v2.core.BatchJobCreateParams; + +public final class BatchJobService extends ApiService { + public BatchJobService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Creates a new batch job. */ + public BatchJob create(BatchJobCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** Creates a new batch job. */ + public BatchJob create(BatchJobCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v2/core/batch_jobs"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, BatchJob.class); + } + /** Retrieves an existing batch job. */ + public BatchJob retrieve(String id) throws StripeException { + return retrieve(id, (RequestOptions) null); + } + /** Retrieves an existing batch job. */ + public BatchJob retrieve(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/core/batch_jobs/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + return this.request(request, BatchJob.class); + } + /** Cancels an existing batch job. */ + public BatchJob cancel(String id) throws StripeException { + return cancel(id, (RequestOptions) null); + } + /** Cancels an existing batch job. */ + public BatchJob cancel(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/core/batch_jobs/%s/cancel", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); + return this.request(request, BatchJob.class); + } +} diff --git a/src/test/java/com/stripe/StripeClientTest.java b/src/test/java/com/stripe/StripeClientTest.java index a26737f57cd..aa97216e5a4 100644 --- a/src/test/java/com/stripe/StripeClientTest.java +++ b/src/test/java/com/stripe/StripeClientTest.java @@ -140,7 +140,7 @@ public void checksWebhookSignature() StripeClient client = new StripeClient("sk_123"); String payload = - "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"event\"\n}"; + "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"v2.core.event\"\n}"; String secret = "whsec_test_secret"; Map options = new HashMap<>(); @@ -159,7 +159,7 @@ public void failsWebhookVerification() StripeClient client = new StripeClient("sk_123"); String payload = - "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"event\"\n}"; + "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"v2.core.event\"\n}"; String secret = "whsec_test_secret"; String signature = "bad signature"; @@ -173,7 +173,7 @@ public void failsWebhookVerification() static final String v2EventNotificationWithRelatedObject = "{\n" + " \"id\": \"evt_234\",\n" - + " \"object\": \"event\",\n" + + " \"object\": \"v2.core.event\",\n" + " \"type\": \"v1.billing.meter.error_report_triggered\",\n" + " \"livemode\": false,\n" + " \"context\": \"org_123\",\n" @@ -191,7 +191,7 @@ public void failsWebhookVerification() static final String v2EventNotificationWithoutRelatedObject = "{\n" + " \"id\": \"evt_234\",\n" - + " \"object\": \"event\",\n" + + " \"object\": \"v2.core.event\",\n" + " \"type\": \"v1.billing.meter.no_meter_found\",\n" + " \"livemode\": false,\n" + " \"created\": \"2022-02-15T00:27:45.330Z\"\n" @@ -200,7 +200,7 @@ public void failsWebhookVerification() static final String v2UnknownEventNotification = "{\n" + " \"id\": \"evt_234\",\n" - + " \"object\": \"event\",\n" + + " \"object\": \"v2.core.event\",\n" + " \"type\": \"v1.imaginary_event\",\n" + " \"livemode\": false,\n" + " \"created\": \"2022-02-15T00:27:45.330Z\"\n" @@ -417,4 +417,28 @@ public void parseEventNotificationAndPull() assertEquals("org_123", v.getOptions().getStripeContext()); } } + + @Test + public void parseEventNotificationRejectsV1Payload() + throws InvalidKeyException, NoSuchAlgorithmException { + StripeClient client = new StripeClient("sk_123"); + + String payload = + "{\n \"id\": \"evt_test_webhook\",\n \"object\": \"event\",\n \"type\": \"charge.succeeded\"\n}"; + String secret = "whsec_test_secret"; + + Map options = new HashMap<>(); + options.put("payload", payload); + options.put("secret", secret); + + String signature = WebhookTest.generateSigHeader(options); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> { + client.parseEventNotification(payload, signature, secret); + }); + assertTrue(exception.getMessage().contains("constructEvent")); + } } diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index 851f18d5980..076e0cfe8b9 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -25561,6 +25561,80 @@ public void testV2CoreAccountTokenGetServices() throws StripeException { null); } + @Test + public void testV2CoreBatchJobPostServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs", + null, + null, + com.stripe.model.v2.core.BatchJob.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"maximum_rps\":1686015830,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.core.batch_job\",\"skip_validation\":true,\"status\":\"batch_failed\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.BatchJobCreateParams params = + com.stripe.param.v2.core.BatchJobCreateParams.builder() + .setEndpoint( + com.stripe.param.v2.core.BatchJobCreateParams.Endpoint.builder() + .setHttpMethod( + com.stripe.param.v2.core.BatchJobCreateParams.Endpoint.HttpMethod.POST) + .setPath("path") + .build()) + .putMetadata("key", "metadata") + .setSkipValidation(true) + .build(); + + com.stripe.model.v2.core.BatchJob batchJob = client.v2().core().batchJobs().create(params); + assertNotNull(batchJob); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs", + params.toMap(), + null); + } + + @Test + public void testV2CoreBatchJobGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/batch_jobs/id_123", + null, + null, + com.stripe.model.v2.core.BatchJob.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"maximum_rps\":1686015830,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.core.batch_job\",\"skip_validation\":true,\"status\":\"batch_failed\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.core.BatchJob batchJob = client.v2().core().batchJobs().retrieve("id_123"); + assertNotNull(batchJob); + verifyRequest( + BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/batch_jobs/id_123", null, null); + } + + @Test + public void testV2CoreBatchJobPost2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs/id_123/cancel", + null, + null, + com.stripe.model.v2.core.BatchJob.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"maximum_rps\":1686015830,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.core.batch_job\",\"skip_validation\":true,\"status\":\"batch_failed\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.core.BatchJob batchJob = client.v2().core().batchJobs().cancel("id_123"); + assertNotNull(batchJob); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs/id_123/cancel", + null, + null); + } + @Test public void testV2CoreEventGetServices() throws StripeException { stubRequest( @@ -25816,7 +25890,7 @@ public void testV2CoreVaultGbBankAccountGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.core.vault.GbBankAccount>>() {}.getType(), - "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.GbBankAccountListParams params = @@ -25842,13 +25916,12 @@ public void testV2CoreVaultGbBankAccountPostServices() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.GbBankAccountCreateParams params = com.stripe.param.v2.core.vault.GbBankAccountCreateParams.builder() - .setAccountNumber("account_number") - .setSortCode("sort_code") + .setCurrency("usd") .build(); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -25871,7 +25944,7 @@ public void testV2CoreVaultGbBankAccountGet2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -25894,7 +25967,7 @@ public void testV2CoreVaultGbBankAccountPost2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -25917,7 +25990,7 @@ public void testV2CoreVaultGbBankAccountPost3Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -25940,7 +26013,7 @@ public void testV2CoreVaultGbBankAccountPost4Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.GbBankAccountInitiateConfirmationOfPayeeParams params = @@ -25969,7 +26042,7 @@ public void testV2CoreVaultUsBankAccountGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.core.vault.UsBankAccount>>() {}.getType(), - "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountListParams params = @@ -25995,12 +26068,13 @@ public void testV2CoreVaultUsBankAccountPostServices() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -26023,7 +26097,7 @@ public void testV2CoreVaultUsBankAccountGet2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -26046,7 +26120,7 @@ public void testV2CoreVaultUsBankAccountPost2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountUpdateParams params = @@ -26072,7 +26146,7 @@ public void testV2CoreVaultUsBankAccountPost3Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -26095,7 +26169,7 @@ public void testV2CoreVaultUsBankAccountPost4Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountConfirmMicrodepositsParams params = @@ -26121,7 +26195,7 @@ public void testV2CoreVaultUsBankAccountPost5Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -26146,7 +26220,7 @@ public void testV2MoneyManagementAdjustmentGetServices() throws StripeException new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.Adjustment>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.adjustment\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.adjustment\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.AdjustmentListParams params = @@ -26172,7 +26246,7 @@ public void testV2MoneyManagementAdjustmentGet2Services() throws StripeException null, null, com.stripe.model.v2.moneymanagement.Adjustment.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.adjustment\",\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.adjustment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.Adjustment adjustment = @@ -26197,7 +26271,7 @@ public void testV2MoneyManagementFinancialAccountGetServices() throws StripeExce new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.FinancialAccount>>() {}.getType(), - "{\"data\":[{\"balance\":{\"available\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"inbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"outbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"balance\":{\"available\":{\"key\":{\"currency\":\"USD\",\"value\":35}},\"inbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":11}},\"outbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":60}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.FinancialAccountListParams params = @@ -26223,7 +26297,7 @@ public void testV2MoneyManagementFinancialAccountPostServices() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.FinancialAccount.class, - "{\"balance\":{\"available\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"inbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"outbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}"); + "{\"balance\":{\"available\":{\"key\":{\"currency\":\"USD\",\"value\":35}},\"inbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":11}},\"outbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":60}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.FinancialAccountCreateParams params = @@ -26251,7 +26325,7 @@ public void testV2MoneyManagementFinancialAccountGet2Services() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.FinancialAccount.class, - "{\"balance\":{\"available\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"inbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"outbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}"); + "{\"balance\":{\"available\":{\"key\":{\"currency\":\"USD\",\"value\":35}},\"inbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":11}},\"outbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":60}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.FinancialAccount financialAccount = @@ -26274,7 +26348,7 @@ public void testV2MoneyManagementFinancialAccountPost2Services() throws StripeEx null, null, com.stripe.model.v2.moneymanagement.FinancialAccount.class, - "{\"balance\":{\"available\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"inbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"outbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}"); + "{\"balance\":{\"available\":{\"key\":{\"currency\":\"USD\",\"value\":35}},\"inbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":11}},\"outbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":60}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.FinancialAccountUpdateParams params = @@ -26300,7 +26374,7 @@ public void testV2MoneyManagementFinancialAccountPost3Services() throws StripeEx null, null, com.stripe.model.v2.moneymanagement.FinancialAccount.class, - "{\"balance\":{\"available\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"inbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"outbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}"); + "{\"balance\":{\"available\":{\"key\":{\"currency\":\"USD\",\"value\":35}},\"inbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":11}},\"outbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":60}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.FinancialAccountCloseParams params = @@ -26413,7 +26487,7 @@ public void testV2MoneyManagementInboundTransferGetServices() throws StripeExcep new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.InboundTransfer>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.InboundTransferListParams params = @@ -26439,16 +26513,12 @@ public void testV2MoneyManagementInboundTransferPostServices() throws StripeExce null, null, com.stripe.model.v2.moneymanagement.InboundTransfer.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.InboundTransferCreateParams params = com.stripe.param.v2.moneymanagement.InboundTransferCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.InboundTransferCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.InboundTransferCreateParams.From.builder() .setCurrency("usd") @@ -26481,7 +26551,7 @@ public void testV2MoneyManagementInboundTransferGet2Services() throws StripeExce null, null, com.stripe.model.v2.moneymanagement.InboundTransfer.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.InboundTransfer inboundTransfer = @@ -26506,7 +26576,7 @@ public void testV2MoneyManagementOutboundPaymentGetServices() throws StripeExcep new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.OutboundPayment>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundPaymentListParams params = @@ -26532,16 +26602,12 @@ public void testV2MoneyManagementOutboundPaymentPostServices() throws StripeExce null, null, com.stripe.model.v2.moneymanagement.OutboundPayment.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams params = com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.From.builder() .setCurrency("usd") @@ -26575,7 +26641,7 @@ public void testV2MoneyManagementOutboundPaymentGet2Services() throws StripeExce null, null, com.stripe.model.v2.moneymanagement.OutboundPayment.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundPayment outboundPayment = @@ -26598,7 +26664,7 @@ public void testV2MoneyManagementOutboundPaymentPost2Services() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.OutboundPayment.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundPayment outboundPayment = @@ -26621,17 +26687,12 @@ public void testV2MoneyManagementOutboundPaymentQuotePostServices() throws Strip null, null, com.stripe.model.v2.moneymanagement.OutboundPaymentQuote.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundPaymentQuoteCreateParams params = com.stripe.param.v2.moneymanagement.OutboundPaymentQuoteCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.OutboundPaymentQuoteCreateParams.Amount - .builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.OutboundPaymentQuoteCreateParams.From.builder() .setCurrency("usd") @@ -26665,7 +26726,7 @@ public void testV2MoneyManagementOutboundPaymentQuoteGetServices() throws Stripe null, null, com.stripe.model.v2.moneymanagement.OutboundPaymentQuote.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundPaymentQuote outboundPaymentQuote = @@ -26690,7 +26751,7 @@ public void testV2MoneyManagementOutboundSetupIntentGetServices() throws StripeE new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.OutboundSetupIntent>>() {}.getType(), - "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundSetupIntentListParams params = @@ -26716,7 +26777,7 @@ public void testV2MoneyManagementOutboundSetupIntentPostServices() throws Stripe null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundSetupIntentCreateParams params = @@ -26742,7 +26803,7 @@ public void testV2MoneyManagementOutboundSetupIntentGet2Services() throws Stripe null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundSetupIntent outboundSetupIntent = @@ -26765,7 +26826,7 @@ public void testV2MoneyManagementOutboundSetupIntentPost2Services() throws Strip null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundSetupIntentUpdateParams params = @@ -26791,7 +26852,7 @@ public void testV2MoneyManagementOutboundSetupIntentPost3Services() throws Strip null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundSetupIntent outboundSetupIntent = @@ -26816,7 +26877,7 @@ public void testV2MoneyManagementOutboundTransferGetServices() throws StripeExce new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.OutboundTransfer>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundTransferListParams params = @@ -26842,16 +26903,12 @@ public void testV2MoneyManagementOutboundTransferPostServices() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.OutboundTransfer.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundTransferCreateParams params = com.stripe.param.v2.moneymanagement.OutboundTransferCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.OutboundTransferCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.OutboundTransferCreateParams.From.builder() .setCurrency("usd") @@ -26884,7 +26941,7 @@ public void testV2MoneyManagementOutboundTransferGet2Services() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.OutboundTransfer.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundTransfer outboundTransfer = @@ -26907,7 +26964,7 @@ public void testV2MoneyManagementOutboundTransferPost2Services() throws StripeEx null, null, com.stripe.model.v2.moneymanagement.OutboundTransfer.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundTransfer outboundTransfer = @@ -26932,7 +26989,7 @@ public void testV2MoneyManagementPayoutMethodGetServices() throws StripeExceptio new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.PayoutMethod>>() {}.getType(), - "{\"data\":[{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.PayoutMethodListParams params = @@ -26958,7 +27015,7 @@ public void testV2MoneyManagementPayoutMethodGet2Services() throws StripeExcepti null, null, com.stripe.model.v2.moneymanagement.PayoutMethod.class, - "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); + "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.PayoutMethod payoutMethod = @@ -26981,7 +27038,7 @@ public void testV2MoneyManagementPayoutMethodPostServices() throws StripeExcepti null, null, com.stripe.model.v2.moneymanagement.PayoutMethod.class, - "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); + "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.PayoutMethod payoutMethod = @@ -27004,7 +27061,7 @@ public void testV2MoneyManagementPayoutMethodPost2Services() throws StripeExcept null, null, com.stripe.model.v2.moneymanagement.PayoutMethod.class, - "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); + "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.PayoutMethod payoutMethod = @@ -27057,7 +27114,7 @@ public void testV2MoneyManagementReceivedCreditGetServices() throws StripeExcept new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.ReceivedCredit>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"balance_transfer\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"balance_transfer\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.ReceivedCreditListParams params = @@ -27083,7 +27140,7 @@ public void testV2MoneyManagementReceivedCreditGet2Services() throws StripeExcep null, null, com.stripe.model.v2.moneymanagement.ReceivedCredit.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"balance_transfer\",\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"balance_transfer\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.ReceivedCredit receivedCredit = @@ -27108,7 +27165,7 @@ public void testV2MoneyManagementReceivedDebitGetServices() throws StripeExcepti new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.ReceivedDebit>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"bank_transfer\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"bank_transfer\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.ReceivedDebitListParams params = @@ -27134,7 +27191,7 @@ public void testV2MoneyManagementReceivedDebitGet2Services() throws StripeExcept null, null, com.stripe.model.v2.moneymanagement.ReceivedDebit.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"bank_transfer\",\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"bank_transfer\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.ReceivedDebit receivedDebit = @@ -27159,7 +27216,7 @@ public void testV2MoneyManagementTransactionGetServices() throws StripeException new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.Transaction>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"balance_impact\":{\"available\":{\"value\":111972721,\"currency\":\"usd\"},\"inbound_pending\":{\"value\":111972721,\"currency\":\"usd\"},\"outbound_pending\":{\"value\":111972721,\"currency\":\"usd\"}},\"category\":\"received_debit\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction\",\"status\":\"pending\",\"status_transitions\":{},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"category\":\"received_debit\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction\",\"status\":\"pending\",\"status_transitions\":{},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.TransactionListParams params = @@ -27185,7 +27242,7 @@ public void testV2MoneyManagementTransactionGet2Services() throws StripeExceptio null, null, com.stripe.model.v2.moneymanagement.Transaction.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"balance_impact\":{\"available\":{\"value\":111972721,\"currency\":\"usd\"},\"inbound_pending\":{\"value\":111972721,\"currency\":\"usd\"},\"outbound_pending\":{\"value\":111972721,\"currency\":\"usd\"}},\"category\":\"received_debit\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction\",\"status\":\"pending\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"category\":\"received_debit\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction\",\"status\":\"pending\",\"status_transitions\":{},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.Transaction transaction = @@ -27210,7 +27267,7 @@ public void testV2MoneyManagementTransactionEntryGetServices() throws StripeExce new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.TransactionEntry>>() {}.getType(), - "{\"data\":[{\"balance_impact\":{\"available\":{\"value\":111972721,\"currency\":\"usd\"},\"inbound_pending\":{\"value\":111972721,\"currency\":\"usd\"},\"outbound_pending\":{\"value\":111972721,\"currency\":\"usd\"}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction_entry\",\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"received_debit\",\"financial_account\":\"financial_account\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction_entry\",\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"received_debit\",\"financial_account\":\"financial_account\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.TransactionEntryListParams params = @@ -27236,7 +27293,7 @@ public void testV2MoneyManagementTransactionEntryGet2Services() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.TransactionEntry.class, - "{\"balance_impact\":{\"available\":{\"value\":111972721,\"currency\":\"usd\"},\"inbound_pending\":{\"value\":111972721,\"currency\":\"usd\"},\"outbound_pending\":{\"value\":111972721,\"currency\":\"usd\"}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction_entry\",\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"received_debit\",\"financial_account\":\"financial_account\"},\"livemode\":true}"); + "{\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction_entry\",\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"received_debit\",\"financial_account\":\"financial_account\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.TransactionEntry transactionEntry = @@ -27264,11 +27321,7 @@ public void testV2TestHelpersFinancialAddressPostServices() throws StripeExcepti com.stripe.param.v2.testhelpers.FinancialAddressCreditParams params = com.stripe.param.v2.testhelpers.FinancialAddressCreditParams.builder() - .setAmount( - com.stripe.param.v2.testhelpers.FinancialAddressCreditParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setNetwork(com.stripe.param.v2.testhelpers.FinancialAddressCreditParams.Network.RTP) .build(); @@ -27292,7 +27345,7 @@ public void testV2TestHelpersFinancialAddressPost2Services() throws StripeExcept null, null, com.stripe.model.v2.FinancialAddressGeneratedMicrodeposits.class, - "{\"amounts\":[{\"value\":111972721,\"currency\":\"usd\"}],\"object\":\"financial_address_generated_microdeposits\",\"status\":\"accepted\",\"livemode\":true}"); + "{\"amounts\":[{\"currency\":\"USD\",\"value\":1}],\"object\":\"financial_address_generated_microdeposits\",\"status\":\"accepted\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.FinancialAddressGeneratedMicrodeposits @@ -27379,6 +27432,7 @@ public void testBlockedByStripeErrorServices() throws StripeException { com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); try { @@ -27529,11 +27583,7 @@ public void testInsufficientFundsErrorServices() throws StripeException { com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams params = com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.From.builder() .setCurrency("usd") @@ -27574,6 +27624,7 @@ public void testInvalidPaymentMethodErrorServices() throws StripeException { com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); try { @@ -27689,6 +27740,7 @@ public void testQuotaExceededErrorServices() throws StripeException { com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); try { @@ -27744,11 +27796,7 @@ public void testRecipientNotNotifiableErrorServices() throws StripeException { com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams params = com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.From.builder() .setCurrency("usd") diff --git a/src/test/java/com/stripe/net/WebhookTest.java b/src/test/java/com/stripe/net/WebhookTest.java index c6a9c89aa77..3e1357b6bf3 100644 --- a/src/test/java/com/stripe/net/WebhookTest.java +++ b/src/test/java/com/stripe/net/WebhookTest.java @@ -335,4 +335,42 @@ public void testConstructEventWithRawJson() assertNotNull(event.getRawJsonObject()); } + + @Test + public void testConstructEventRejectsV2Payload() + throws NoSuchAlgorithmException, InvalidKeyException { + final String v2Payload = + "{\n \"id\": \"evt_test_webhook\",\n \"object\": \"v2.core.event\"\n}"; + final Map options = new HashMap<>(); + options.put("payload", v2Payload); + final String sigHeader = generateSigHeader(options); + + Throwable exception = + assertThrows( + IllegalArgumentException.class, + () -> { + Webhook.constructEvent(v2Payload, sigHeader, secret); + }); + assertTrue(exception.getMessage().contains("StripeClient.parseEventNotification")); + } + + @Test + public void testClientConstructEventRejectsV2Payload() + throws NoSuchAlgorithmException, InvalidKeyException { + StripeClient client = new StripeClient(new LiveStripeResponseGetter()); + + final String v2Payload = + "{\n \"id\": \"evt_test_webhook\",\n \"object\": \"v2.core.event\"\n}"; + final Map options = new HashMap<>(); + options.put("payload", v2Payload); + final String sigHeader = generateSigHeader(options); + + Throwable exception = + assertThrows( + IllegalArgumentException.class, + () -> { + client.constructEvent(v2Payload, sigHeader, secret); + }); + assertTrue(exception.getMessage().contains("StripeClient.parseEventNotification")); + } }